Re: ssh.com's ssh isn't executing my bash startup files

From: UnixFan (gxy1997_at_yahoo.com.au)
Date: 11/27/03


Date: 26 Nov 2003 23:28:07 -0800

Benjamin Rutt <rutt+news@bmi.osu.edu> wrote in message news:<5vn0aj9jeo.fsf@akron.bmi.ohio-state.edu>...
> I have two remote hosts, one dc01 and one marion, that both are
> NFS-mounting the same home directory, so I know they are using the
> same shell startup files. Here are their respective ssh server
> versions:
>
> dc01: SSH-1.99-OpenSSH_3.4p1
> marion: SSH-1.99-3.2.3 SSH Secure Shell (non-commercial)
>
> Marion is using a version from ssh.com, apparently non-commercial. My
> problem is, when I ssh to marion, it isn't executing my bash startup
> files. Here are some example symptoms:
>
> $ ssh dc01 'echo $PATH'
> /home/rutt/opt/j2sdk1.4.2_01/bin:/home/rutt/bin:/home/rutt/local/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/sbin:/usr/sbin
>
> $ ssh marion 'echo $PATH'
> /usr/bin:/bin:/usr/local/bin
>
> Note that my remote .bashrc prepends several directories to the
> default PATH.
>
> Marion's sshd(8) man pages show the following steps about the login
> process:
>
> LOGIN PROCESS
> When a user successfully logs in, sshd2 does the following:
>
> 1. Change process to run with normal user privileges.
>
> 2. Set up basic environment.
>
> 3. Read /etc/environment if it exists.
>
> 4. Change to the user's home directory.
>
> 5. Run the user's shell or command.
>
> While dc01's sshd(8) man pages describe a somewhat different login
> process:
>
> LOGIN PROCESS
> When a user successfully logs in, sshd does the following:
>
> 1. If the login is on a tty, and no command has been specified,
> prints last login time and /etc/motd (unless prevented in the
> configuration file or by $HOME/.hushlogin; see the FILES sec-
> tion).
>
> 2. If the login is on a tty, records login time.
>
> 3. Checks /etc/nologin; if it exists, prints contents and quits
> (unless root).
>
> 4. Changes to run with normal user privileges.
>
> 5. Sets up basic environment.
> ar
> 6. Reads $HOME/.ssh/environment if it exists.
>
> 7. Changes to user's home directory.
>
> 8. If $HOME/.ssh/rc exists, runs it; else if /etc/ssh/sshrc
> exists, runs it; otherwise runs xauth. The ``rc'' files are
> given the X11 authentication protocol and cookie in standard
> input.
>
> 9. Runs user's shell or command.
>
>
> Obviously, step 5 of marion's (ssh.com) isn't working as I expected,
> since I would expect that "Run the user's shell or command." would
> include sourcing my login shell's startup files, as is happening on
> dc01. Is there anything else I can do to get those startup files
> sourced on marion for every ssh (and scp)?
>
> P.S.: the real problem is that I want to get 'fsh' to work. I want
> 'in.fshd' in my path, but I installed it remotely as
> $HOME/local/bin/in.fshd, and I need the remote $HOME/local/bin in my
> path, in order for 'fcp' to work. Thanks,

Check /etc/passwd file on marion to see whether the account's shell is
/bin/bash or /bin/sh.