Thursday, May 21, 2009

Login Banner | SSH Banner Howto

Tech Blog - This is a quick howto on adding a login banner to your ssh session before the password prompt during interactive session using SSH, Warning banners are necessary at all access points in the event an organization wishes to prosecute an unauthorized user.

To add a warning banner to SSH, create a banner first


$ cd /etc/ssh/
$ vi ssh-banner

Type in the Warning message you want such as the one below, then save the file.


************************************************
NOTICE TO USERS WARNING! The use of this system is restricted to authorized users, unauthorized access is forbidden and will be prosecuted by law. All information and communications on this system are subject to review, monitoring and recording at any time, without notice or permission. Users should have no expectation of privacy. *************************************************

After creating the banner file, edit the ssh configuration file

$ vi sshd_config

Look for the part below on sshd_config

# no default banner path
#Banner /path/banner file


And change it to

# no default banner path
Banner /etc/ssh/ssh-banner
Save the file then restart SSH

$ /etc/init.d/ssh restart

next time you login you should see something like the screenshot below.













Then your done.


Recent Tech Blog Gadget Review

2 comments:

Anonymous said...

the last row has more stars

Greylocks said...

Thanks for this it works great and is a wonderful idea.

For suggestion and concerns E-mail