Running script and commands through SSH

Hello All,
I am trying to run some simulations through SSH from my mac on our university SOLARIS system. My problem is that whenever I want to execute a command I get an error which says "Invalid argument".
Maybe I should explain more what I want to do and what I did.
Firstly I installed a software which I need to run, I did it through ThinLink, and it seems that it is running fine without a problems. I can execute all commands and scripts. Installed software contains tens of small programs. I have compiled it and assign the PATH to be able to use the software. This was still via ThinLink. Then I wanted to start to use SSH since it should be more secure and also faster for me. When I wanted to do same think as in ThinLink I got the message Invalid argument. For example I run a command which use program gensky.
I wrote:

gray1(dava) $ gensky 4 4 4

I got:

-bash: ............/Radiance_install/bin/gensky: Invalid argument
~

(i replaced the path to my home directory by dots)
The PATH to the program seams correct but it does not run correctly.
With SSH I can log into the remote machine and see all the files which I have on the disk as well as to run standard commands like mkdir etc. But I cannot run the programs which I installed.
Could anyone advice me on this or possible to show me some examples or give me some reference which I can study. I have tried to read man page for shh but it did not helped me that much since there is many things which I don't understand.
I am probably doing something wrong or missing something completely.

Thank you for any comments and advices.

I don't think the man page for ssh will be helpful here.

There must be some difference between the environment when you login locally, and the environment when you login with ssh. Can you compare the output of env in both?

Hello, thank your for response.
Should I look for anything specific? There is quite a lot information, and probably not all of them are relevant.

I can't be specific, sorry, I don't know what things in the environment the dozens of programs you mentioned use. I'm just wondering what's different. You could do:

# when logged in locally
env > localenv
# when logged in through ssh
env > remoteenv
diff localenv remotenv

to see the differences listed explicitly.

There are some differences definitely, unfortunately I don't understand it. I have attached three files with info about the environment. envlocal (logged through ThinLink), envremove (logged through SHH) and their difference diff.
Maybe some one can see from the files what is the problem.
Thank you

Your environments are so different there wasn't much point diffing it. I don't suppose you're getting a different shell when you ssh in than when you login locally?

I am not sure if I understand it correctly. But I guess that not. When I ssh I use

ssh username@login.gbar.dtu.dk

However I am not logged exactly on the machine when I am "locally" logged because I also use remote access by ThinLink.

I guess that it can be something with permissions since regular things are working with shh but not newly installed programs. But I don't understnad that much all of this, so it could be also something else.

Yes, but your shell, what is it? When you ssh in you get bash, what do you get when you do so "locally"?

Yes, I am running bash in both.

---------- Post updated at 05:22 PM ---------- Previous update was at 03:16 PM ----------

I have now discovered new thing which will be probably the problem, but still don't know how to solve it.

When I am logged to Solaris system bu ThinLink there is several options for running terminal. When I run Terminal on solaris then I get same user name as when using shh, which is gray1(dava) $. And it is doing same thing and I am not able to execute the commands.

While I used terminal (not sure what kind, it just say terminal) then I get user name "n-62-13-32(dava) $, and with this terminal I am able to do what I want.

I guess it can be somehow related to the problem. Maybe I am just logging-in in wrong way.

Which are what?

For one reason or another, different profiles are being loaded when you login one way than another.

Try echo $SHELL ; echo $USER in both to make double-sure you're actually running bash, and as the same user.

You could run exec bash -l to make sure you're running in your preferred shell.

Everything is identical on both, shh log in as well as on machine which I log to by ThinLink.

I really thing that the problem is that I am logged to wrong server, because I have just find that there are three different types of servers and I need to be probably logged to application servers which I am apparently not when I am using shh. I have contacted support of the servers but it will take some time to get answer back. When I will get an answer I will post it here too, if it will solve the problem

Thank you very much for your help.