Powerful Linux ways to control users
Not every user on linux is equal and many times you would want to create a user but not only limit there access but maybe freeze there account or define for how long will there account be active. That's the main topic of this lesson.
To lock a user we would call this command:
usermod -L demo
and to unlock the user:
usermod -U demo
Notice that we are not deleting the account of the user but not letting the user in when we lock them out. We talked about deleting users a few lessons ago. Another powerful feature is setting an expiration date to a user:
usermod -e 2015-01-01 demo
now we updated the user demo to expire on january first 2015. We can extend that user at any point but once that date would reach the user account would be locked.
Ready to Level Up Your Skills?
Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!
Enroll Now for Free!