This may happen because you do not have the right environment variables set up on linux machine. The best pointer to this is that, when you are logged in as db2 unix user (note that in db2 database user is also an operating system user) you are able to connect to the database, but when you are logged in as some other user, it fails.
The environment variables that you need to set are:
You can see that these environment variables do exist when you login as the db2 unix user. This you can see by typing: