CentOS No “you have new mail” ssh login Fix

LINUX – Command Line Login “You have mail.” Fix

This makes the SSH / command line login say if you have new mail at the time of log on:

Edit two files as root – Adding the text in the file 

Vi — > /etc/pam.d/login

add the following line to bottom of file

session optional pam_mail.so standard

pamLogin

 

Vi — >/etc/pam.d/sshd

add the following line:

session optional pam_mail.so standard noenv

pamSSHD

 

 

By default it seems that CentOS linux does not have the “you have mail ” feature enabled for ssh logins. My issue was that  I had a brand new  Cetos 7 server -> Installed sendmail, setup the box as  mail server and then never the email  notification”you have new mail” at time of ssh login. This sent me down a long path to find the under documented pam.d feature.

share with friends

Share to Google Buzz
Share to Google Plus
Share to LiveJournal
Share to Odnoklassniki
No comments yet.

Leave a Reply