I'm on aix 7.1,my shell is bash

if i did

ssh ibmunix 
gqlplus  user/pass

All works and gqlplus start,gqlplus is on /opt/freeware/bin If i did from another machine

  ssh ibmunix "gqlplus  user/pass"

Give me the error message "gqlplus: command not found"

If i did

ssh -t  ibmunix "source .bash_profile; gqlplus  user/pass"

Works fine The question is: is possible with ssh to read automatically .bash_profile?

  • 1
    Check sshd's man page, and the section Login Process. – ott-- May 17 '15 at 18:28
  • I have add PATH in .ssh/environment but nothing change – elbarna May 17 '15 at 19:14

I have found the solution first enable on sshd_config user environement

PermitUserEnvironment yes

Then edit $HOME/.ssh/environement and put PATH and whatever you want

The $HOME/.ssh/environment file can't contain other than variables and comments for example good environment


bad environment

source $HOME/.profile
export PATH=$PATH:/usr/bin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.