1827671 Members
3451 Online
109967 Solutions
New Discussion

Re: Lock user

 
kenlo
Advisor

Lock user

Everybody know how to lock the user account. Or limit user to use some command on Linux9.
2 REPLIES 2
xyko_1
Esteemed Contributor

Re: Lock user

Hi Ken,

What you mean about "lock the user" ?

If you have a user that you need to avoid him to login you may change the password via passwd command (#passwd user), or you may change /etc/passwd last field, the shell field, to point to a script that sends a message (or not) and immediately exit from the system.

Now I don't know how to limmit the commands that a user can execute, I'll try to find something on the web (google is our everytime friend).

regards,
xyko
Rick Garland
Honored Contributor

Re: Lock user

I have RH so here is what I find.

Do a man on passwd.
To lock a user account user 'passwd -l $LOGNAME'

To limit the commands of a user you might want to look at implementing SUDO and only put the commands to be executed in the sudoers file.

Another option might be to setup ACLs.