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

From: Benjamin Rutt (rutt+news_at_bmi.osu.edu)
Date: 11/26/03

  • Next message: Darren Tucker: "Re: problem after patching openssh 3.7.1p2"
    Date: Wed, 26 Nov 2003 11:36:15 -0500
    
    

    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,

    -- 
    Benjamin Rutt
    

  • Next message: Darren Tucker: "Re: problem after patching openssh 3.7.1p2"

    Relevant Pages

    • Re: passing arguments to remote: quoting problem?
      ... in a shell script. ... and the remote one. ... parameter to ssh. ...
      (comp.security.ssh)
    • Frob tty settings locally?
      ... I'm writing a program which uses ssh to log in to a remote host, ... Talking to the shell is much easier when you ... But the ssh documentation talks about ssh "allocating a pseudo tty" ...
      (comp.unix.shell)
    • preserving (juggling) jobs among shells?...
      ... Is there a way to preserve job started with remote ... shell, so that it would continue after logging off (say, I log in by ... ssh from remote place to my home machine, start a looong job there, ...
      (comp.unix.shell)
    • Re: passing arguments to remote: quoting problem?
      ... There are two shells in your example, the local one (running the ssh ... and the remote one. ... So the local one uses the quotes to create a ... the remote shell turns it into two tokens for the 'ls'. ...
      (comp.security.ssh)
    • Re: shell var and awk (Im trying export and ENVIRON but not working)
      ... > The problem with ssh is that it concatenates the arguments to ... > awk whatever solution in the FAQ' ... > doesn't provide any way to provide the remote sh with additional ... so obviously the shell is looking for /tmp/file} rather than ...
      (comp.unix.shell)