As a Linux system administrator, you may want to restrict access to a Linux system for specified users or groups. In this section, we will learn how to use two files, /etc/securetty
and /etc/security/access.conf
, to restrict user access.
All the steps given here have been tried on an Ubuntu system; however, you can follow these on any other Linux distribution also.
Let's learn how to edit the two files mentioned before to apply different restrictions to user access on a Linux system:
- First, we will check the content of the
/etc/securetty
file using themore
command:
more /etc/securetty
As we can see in the preceding screenshot, the file specifies the Terminals on which root is allowed to log in.
- Now, edit the file using any editor of your choice and comment the
tty1
entry as shown here:
Save and exit the editor after making the changes mentioned in the preceding step.
- Now, switch to Terminal
tty1
by running the commandchvt 1
. If we...