Many system services and automated jobs (cron) are setup to send notifications the root email account for the server by default. If you need a way to quickly capture the root email and redirect them to another account, the quick steps below will get this taken care of.

First step is to edit your aliases file located at /etc/aliases using a text editor on your server. Personally I like to use pico/nano. You will need to add the following line to this file:

root: [email protected]
 (replace [email protected] with your real email address) 

Next step after saving the aliases file is to let the server know you have new aliases. This can be done by simply running the newaliases command.

You can test to see if your change is working by running the following command which will send a test email.

echo test | mail -s "test message" root

With that your root email will now go to the email account you defined in the aliases file. These same steps can be performed for any accounts on the server.

Follow Me

Kevin Fairbanks

Kevin Fairbanks is the Managing Partner at Purple Monkey Studio located in Syracuse, NY, Co-Owner/Programmer at bivvy located in Utica, NY and a Web Developer/Programmer for Quadsimia located in New York Mills, NY where he builds everything from responsive websites to applications. In his spare-time he is either spending it with his daughter or tinkering with electronics.
Follow Me

Latest posts by Kevin Fairbanks (see all)