Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

command to lock a user

sudo usermod -L username

#to disable all login methods
sudo usermod -L -e 1 username

#to unlock a user
sudo usermod -U USER

#to verify
sudo chage -l linuxize
Source by linuxize.com #
 
PREVIOUS NEXT
Tagged: #command #lock #user
ADD COMMENT
Topic
Name
5+2 =