Showing posts with label Security. Show all posts
Showing posts with label Security. Show all posts

Friday, September 16, 2011

How to restrict linux users logging from shell except root?

Sometimes you have to disable the login to all users,except root
e.g. when you have to do a backup, you have to use pam_nologin.so

1) Edit the pam file for the service you want to control, in this example i modify ssh pam control file, located in /etc/pam.d/sshd

Add this line
account required pam_nologin.so


2) touch /etc/nologin

This should disable the login from ssh. If you want to disable the login from terminal, modify the /etc/pam.d/login file.

3) To re-enable the login just remove /etc/nologin



Wednesday, October 27, 2010

Tighten up your Exim (mail server)

For WHM versions 11.27/11.28

You may want to prevent users from bypassing your mail server to send mail. This feature allows you to configure your server so that the mail transport agent (MTA), Mailman mailing list software, and root user are the only accounts able to connect to remote SMTP servers.

To enable or disable users from bypassing your mail server:
Click Enable or Disable.


Please make sure that SMTP Tweak is turned on:

/scripts/smtpmailgidonly on

It’s also a good idea to require sender verification, which can be enabled in WHM >> Exim Configuration Editor