Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
So you want to limit where certain users or group(s) of users and login from, rather than lock out their account.
For ssh, you can use AllowUsers or AllowGroups to explicitly determine who is allowed to login via ssh. Using AllowUser user1
will only allow user1 to log in and will deny all other users, including system users who are targets of brute force attacks.
Suppose you only want root to be able to login to tty1.
You can control that with an /etc/security/access.conf entry.
-:ALL EXCEPT root:tty1
This file is well commented. If yours isn't, then look in man 5 access.conf and man pam_access.
You can prevent a normal user from logging in on certain terminals. They will still be able to log in on other terminals. For example, you asked about a serial terminal. Maybe you only want a member of an admin group to be allowed to login to that terminal. Suppose that you only want three particular users to be able to use ssh. They might be the people who administer the server and need to do so remotely. Adding their names to the AllowUsers entry will deny ssh logins under any other account. You still want a normal user to be able to login normally.
I just reviewed the manpage for the "passwd" command. I should have used the term "lock" instead of disable. The root user can lock an account using the passwd command. That user will not be able to login. Your query seemed to me to be about limiting logins on certain terminals and on restricting who can use ssh to login. In other words, about controlling access rather than denying it completely.