Managing Users In Linux
May 11, 2022
In this article, we will learn :
- Add users into the server
- Create a
SuperHero
group - Set `wheel` Group as the the `tstark` Account’s Primary Group
- Add `superhero` as a Supplementary Group on All Three Users
- Lock an account
Adding a User into Server
- $ssh user_name@publicIPAddress
Enter the Password : — —
Login as the remote user/ root user of your system.
(To login as Root : $ sudo -i )
2. Adding users:
$useradd tstark
$useradd user1
$useradd user2
$groupadd superhero (should have root previleges to execute this function)
3. Set `wheel` Group as the the `tstark` Account’s Primary Group
$usermod -g wheel tstark
$id tstark
- uid=1002(tstark) gid=10(wheel) groups=10(wheel)
4. Add superheroes group as supplementary group on all the 3 users
$usermod -aG superhero tstark
$usermod -aG superhero user1
$id user1
5. Lock the user
$usermod -L user1