UNIX / Linux: Send E-mail When sudo Runs

last updated in Categories , , , , , , , , , , ,

I‘m not told to use the root user to perform activities that do not require it. I’ve configured sudo for myself and for other web developers so that they can restart MySQL or Apache web server. How do I send email when sudo run by one of my user? How do I keep track of user login done via sudo command?

Linux / UNIX Automatically Logout BASH / TCSH / SSH Users After a Period of Inactivity

last updated in Categories , , , , , , , , , , , ,

My development and testing webserver is used by over 100s of users. These users login from Windows XP, Linux, Mac OS X system via ssh. How do I set or automatically log users out after a period of inactivity under CentOS Linux server to improve server security and save some resources?

BASH Shell Redirect Output and Errors To /dev/null

last updated in Categories , , , , , , , , , , , , ,

How do I redirect output and errors to /dev/null under bash / sh shell scripting? How do I redirect the output of stderr to stdout, and then redirect this combined output to /dev/null device? In Unix, how do I redirect error messages to /dev/null?