Skip to Content
SSH, The Secure Shell: The Definitive Guide, 2nd Edition
book

SSH, The Secure Shell: The Definitive Guide, 2nd Edition

by Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes
May 2005
Intermediate to advanced
666 pages
21h 5m
English
O'Reilly Media, Inc.
Book available
Content preview from SSH, The Secure Shell: The Definitive Guide, 2nd Edition

User Logins and Accounts

When a login occurs, the SSH server can take special actions. Here, we discuss:

  • Printing welcome messages for the user

  • Setting environment variables

  • Taking arbitrary actions with initialization scripts

5.6.1 Welcome Messages for the User

sshd can display custom messages for the user before and after authentication. Before authentication, the SSH server can optionally display the contents of any file you select with the Banner keyword (OpenSSH) or BannerMessageFile keyword (Tectia):

    # OpenSSH
    Banner /usr/local/etc/warning.txt

    # Tectia
    BannerMessageFile  /usr/local/etc/warning.txt

By default, OpenSSH displays no banner message, whereas Tectia displays the contents of /etc/ssh2/ssh_banner_message if the file exists.[76] The banner message is often used for legal statements that forbid unauthorized access. Since the file is sent before authentication, be careful that it doesn’t reveal sensitive information.

After authentication, both OpenSSH’s and Tectia’s sshd optionally prints the standard Unix “message of the day” file ( /etc/motd ). This output may be turned on and off with the PrintMotd keyword with the value yes (the default) or no:

    PrintMotd no

Since most Unix shells print /etc/motd on login, this SSH feature is often redundant and turned off.

For Tectia, a message about email (e.g., “You have mail”) is printed on login if the CheckMail keyword has the value of yes (the default), or the message is skipped if the value is no:

 # Tectia CheckMail yes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Basics for Hackers

Linux Basics for Hackers

OccupyTheWeb .

Publisher Resources

ISBN: 0596008953Errata Page