I am trying to execute a command from ssh directly and I need to change the PATH of the directories.
> ssh myserver 'echo $PATH' myuser@myserver's password: /usr/local/bin:/bin:/usr/bin
I am getting /usr/local/bin, but I need only /bin instead of that. I have .bashrc and .bash_profile set in my home directory but the PATH is not taking from there. I tried to change /etc/bashrc and /etc/profile but still no luck.
I have seen the sshd_config file that ssh is compiled with PATH=/usr/local/bin:/bin:/usr/bin . So is there a way to change this default path.?
> cat /etc/ssh/sshd_config # $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin