SSH - Session (Login)

> SSH (Secure Shell) - Remote Access

2 - Login Process

For sshd. See sshd

When a user successfully logs in, sshd does the following:

  • 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).
  • If the login is on a tty, records login time.
  • Checks /etc/nologin; if it exists, prints contents and quits (unless root).
  • Changes to run with normal user privileges.
  • Sets up basic environment.
  • Reads the file ~/.ssh/environment, if it exists, and users are allowed to change their environment. See the PermitUserEnvironmentoption in sshd_config
  • Changes to user's home directory.
  • If ~/.ssh/rc exists and the sshd_config(5) PermitUserRC option is set, 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.
  • Runs user's shell or command. All commands are run under the user's login shell as specified in the system password database.
Advertising
ssh/session.txt · Last modified: 2019/05/19 11:50 by gerardnico