Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-21-2007, 05:01 PM
|
#1
|
Member
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276
Rep:
|
disable or enable a user from login
How to disable or enable a user from login with both ssh and serial port?
Do I do
passwd -l user
passwd -u user?
|
|
|
06-21-2007, 05:28 PM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
Quote:
Originally Posted by powah
How to disable or enable a user from login with both ssh and serial port?
Do I do
passwd -l user
passwd -u user?
|
did you try those commands?? did they work?? another approach would be to simply change the account's shell to /usr/sbin/nologin or something like that, by editing /etc/passwd...
Last edited by win32sux; 06-21-2007 at 05:32 PM.
|
|
|
06-21-2007, 06:44 PM
|
#3
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
06-21-2007, 08:00 PM
|
#4
|
Member
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276
Original Poster
Rep:
|
Quote:
Originally Posted by jschiwal
So you want to limit where certain users or group(s) of users and login from, rather than lock out their account.
|
What is the difference between disable users from login and lock out their account?
|
|
|
06-22-2007, 05:05 AM
|
#5
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
Last edited by jschiwal; 06-22-2007 at 05:09 AM.
|
|
|
All times are GMT -5. The time now is 10:59 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|