When you log in to Linux, either by fashion of SSH or the console, you are greeted with a banner that offers up a few important bits of information. If you lot're doing everything y'all can to secure that Linux server, the information shared by that banner can be a gilded mine to ne'er practise wells and would-be attackers. Data like kernel release, distribution type, available updates, and more tin can be revealed.

So how do y'all prevent that information from being displayed when users log into your Linux systems? Let me show you.

SEE: Checklist: Securing digital data (TechRepublic Premium)

The most constructive way to do this is by way of creating a per-user file that disables the login banner. To do that, log in to your Linux server and consequence the command:

sudo bear on /habitation/USER/.hushlogin              

Where USER is the proper name of the user who logs into the auto. The next time that user logs in to the system, they will no longer see the imprint. That method works great if yous only have a few users.

If you're on a system that houses a big number of users, yous need a more efficient style of handling this task. For that, yous will get-go open up the sshd_config file with the control:

sudo nano /etc/ssh/sshd_config

In that file, remove the # character earlier the line PrintMotd no and so add together the line PrintLastLog no beneath it.

Save and close the file. On Ruby Hat distributions, restart SSH with the command:

sudo systemctl restart ssh on Ubuntu distributions and sudo systemctl restart sshd

Side by side, open the PAM SSH config file with the control:

sudo nano /etc/pam.d/sshd

In that file, comment out (by calculation a # character) the line session optional pam_motd.then motd=/run/motd.dynamic and the line session optional pam_motd.so noupdate.

With these configurations in place, information technology won't matter who logs into your Linux auto, they won't see the banner. This is merely a tiny stride forward in gaining more than security on your Linux servers, but even small progress is nevertheless progress.

Subscribe to TechRepublic'southward How To Make Tech Work on YouTube for all the latest tech advice for business organisation pros from Jack Wallen.


Image: iStock/structuresxx