Am doing remote ssh connection to one box like below and executing the command.

ssh <userid>@<hostname> 

While executing the scripts the values defined in .profile not loaded properly.

But if we login directly in that box it is working fine.

Could anyone pls help on this ?


As this excerpt from man ssh states,

When the user's identity has been accepted by the server, the server
either executes the given command in a non-interactive session or, if no
command has been specified, logs into the machine and gives the user a
normal shell as an interactive session.

.profile is read only in interactive login shells. So everything is ok. Take a look at this answer. It explains what an interactive shell is.

  • but we do have same scenario in different boxes working fine. This is new box which we are facing issue while doing remote ssh values from .bash_profile / .profile values not loading properly. May 18 '17 at 14:08
  • @Rajagopalarao It may be about sshd or .bashrc. Take a look at unix.stackexchange.com/a/79783/181255 and compare your old .bashrcs with the new one. There may be a fix in them. Also you can add more details in your question about the old OS's that do work and the new one that doesn't. Someone might be able to know and point at the difference. The way sshd was compiled might have a difference too.
    – user147505
    May 18 '17 at 15:19

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.