Re: ssh or telnet: different pathspec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday, Aug 7th 2006 at 14:18 -0700, quoth Alan M. Evans:

=>Sorry that this probably isn't Fedora specific, but it's happening to me
=>on my FC4 server. I couldn't think of where else to ask.
=>
=>Why is /usr/local/bin missing if I telnet rather than slogin?
=>
=>$ telnet localhost
=>$ set | grep ^PATH
=>PATH=/usr/kerberos/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/alan/bin
=>$ slogin alan@localhost
=>$ set | grep ^PATH
=>PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/alan/bin

Interesting. People respond to the question by not answering. This looks 
like a job for (drum roll please) Obvious Man!

If you actually use the slogin (alias of ssh) to login, there are 
opportunities for the remote side to set environment variables, both from 
the client side and from the server side.

In addition, if you use ssh to execute a remote command and not create a 
login session, the remote command will not be going through your 
~/.bash_profile. You will only get your .bashrc. So the trick is to test 
inside your .bashrc to see if you are in a non-interactive session and to 
then set whatever environment variables you need. Personally, I don't set 
the whole magilla, I just set the PATH variable.

in your .bashrc:

if [[ -n "$PS1" ]]
then
	# Do your interactive stuff
else
	export PATH=$SOMEBETTERVALUE
fi

See the ssh and ssh_config as well as sshd_config man pages.

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux