RE: Activity of the $HOME/.kshrc

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

 



There is no difference in login process for both version's sshd manual:

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 ~/.hushlogin; see the FILES
                section).

           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.

           6.   Reads the file ~/.ssh/environment, if it exists, and
users
                are allowed to change their environment.  See the
                PermitUserEnvironment option in sshd_config(5).

           7.   Changes to user's home directory.

           8.   If ~/.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.
                See SSHRC, below.

           9.   Runs user's shell or command.


The fact is if I do a "real" login (ssh without command), server2 has
the variable be set:

Localhost$ ssh server2 echo $LIC_HOST

Localhost$ ssh server2
$ hostname
server2
$ cat $HOME/.kshrc
LIC_HOST=licserv; export LIC_HOST;
$ echo $LIC_HOST
licserv

When running "ssh ssh_server command", I guess the difference between
the two versions is at step 9, where server1 runs the command with
user's shell but server2 runs the command with a "default shell".

I am not sure how the latest Openssh dose on this point. If the user can
not specify different environment/shell variables for different server
when doing "ssh ssh_server command", that is a restriction for remote
application submission.
 
Jialing


-----Original Message-----
From: Greg Wooledge [mailto:wooledg@xxxxxxxxxxx] 
Sent: Thursday, March 05, 2009 11:54 AM
To: Jialing Liang
Cc: secureshell@xxxxxxxxxxxxxxxxx
Subject: Re: Activity of the $HOME/.kshrc

On Thu, Mar 05, 2009 at 11:43:39AM -0700, Jialing Liang wrote:

> > I have ssh login to two Linux - Openssh server. They share one $Home
> > directory. server1 runs Redhat 3 with Openssh 3.6.1 and sever2 runs
> > Redhat 5 with Openssh 4.3

> >Check the user's shell and make sure it's actually ksh.
> It is ksh:
> Localhost$ ssh server1 echo $SHELL
> /usr/bin/ksh
> Localhost$ ssh server2 echo $SHELL
> /usr/bin/ksh

In that case, look for the manuals for OpenSSH 3.6.1 and 4.3 and make
sure the features you're relying on (~/.ssh/environment) are actually
available in both versions.  Also, check the server configs to make
sure PermitUserEnvironment is set to yes (the default is ``no'').


[Index of Archives]     [Open SSH Unix Development]     [Fedora Users]     [Fedora Desktop]     [Yosemite Backpacking]     [KDE Users]     [Gnome Users]

  Powered by Linux