Loading...

CTRL of user accounts in Linux – Quick tips

Disable an account

sudo vipw

Modify the appropriate user you wish to disable from /bin/bash to /bin/disabled

webuser:x:500:500:webuser:/home/webuser:/bin/disabled

***This option will NOT prevent login over SSH***

Modify account password or lockout account

Lockout:

passwd -l <<username>>

The -u argument instead of -l will set the account as unlocked.

Modify Password:

passwd <<username>>

Curious for more details on who has attempted logon?

faillog -a

 

Keep in mind, aside from locking a user out, it is equally important to make sure you properly lock down your firewall to expose ports like 22 only to specific IPs. Don’t leave yourself exposed to the world.

error: