Click to See Complete Forum and Search --> : Disabling user log on


Linux
12-18-2000, 05:01 PM
How can I disable certain account on my RH7 box from being able to log on. I have tried to delete default shell from /etc/passwd for that particular user but user is still able to log in with new shell sh-2.04???

ThanX

toolie
12-18-2000, 05:03 PM
As root, edit /etc/passwd (or the shadowed password file) and change the first character of the login to an asterisk - *.

That signifies that the account is locked and the login program will not verify the password.

mastersibn
12-18-2000, 05:10 PM
Originally posted by Linux:
How can I disable certain account on my RH7 box from being able to log on. I have tried to delete default shell from /etc/passwd for that particular user but user is still able to log in with new shell sh-2.04???

ThanX

userdel <username>

If you want to keep the account, but prevent it from being logged into, then you might have to find its password in /etc/shadow and remove it from there.

An example entry begins like this:

root http://www.linuxnewbie.org/ubb/redface.gif*#8hvLI3yQ])(93*"p'#$0297#9j*382.O*3:

You replace the characters between the first and second : with an asterisk, *, to make that account inaccessible. Btw, I don't advise that you do this. If you don't want anybody to login as that user, you might consider just hitting loads of random keys when you change that user's password. You can probably have up to 255 characters in your password, so it's really unlikely that anybody would ever guess such a long one.

I would do that instead of edit /etc/shadow any day...


------------------
grab my gnupg key (http://jove.prohosting.com/~msibn/sibn-p.asc) if you feel so inclined.


cAPS lOCK? wHAT cAPS lOCK?
I cna ytpe 300 wrods pre mniuet!!!
an operating system has not just advantages...

Linux
12-18-2000, 05:39 PM
Putting * at the begging of account in /etc/passwd worked and that is exactly what I need.

ThanX

Linux
12-18-2000, 11:13 PM
Sorry, it does not work how I need it to work. I have Samba set up and I am not able to acces Linux share from windows since account is disabled and windows can not connect and verify user name and password.

SlCKB0Y
12-18-2000, 11:51 PM
WHAT are you on about?

you say you dont want a user to be able to long in, and then when we tell you how to accomplish this you complain that you cant login?

So then set samba up so that it doesnt use /etc/passwd

Linux
12-19-2000, 12:55 AM
I want to have specific account on my Linux box, but without the option to login on Linux (i.e no default shell or home dir), so when user tries to login, user name and password will be verified but won't allow logon. When I disable default shell in /etc/passwd and default directory user can login and gets new shell and default directory of /. Can a valid (i.e user name and password will be verified)user account exist on Linux box without being able to logon to it? I am using RH 7.

tko fx
12-19-2000, 03:29 AM
adduser

when it prompts you for the shell use
/bin/false
instead of the default /bin/bash

they won't be able to use the shell, but the account will be there(I think, if i'm not mistaken, you can change the shell in /etc/passwd)

hope this helps out

Linux
12-19-2000, 11:41 PM
ThanX tko fx. That is what I need. /bin/false for shell automatically disconnects user from Linux login screen and windows can connect to samba share on linux since account exists. I tried deleting default shell from /etc/passwd but RH 7 gives it different one