Memo of basic user management commands on Debian
Reminder: you can left-scroll and right-scroll the long code blocks
Create users and groups
1 | # create group "bar" |
Find a user’s UID and GID
1 | # get the UID of user "foo" |
Assign to a user a given UID
1 | # create group "bar" with GID 3000 |
Password management
Notes: most password operations affect the /etc/passwd
and/or the /etc/shadow
files (and also etc/group
and /etc/gshadow
).
/etc/shadow
stores the hashed passphrases (with additional properties)./etc/passwd
keeps track of every registered user that has access to the system.
1 | # change the password of the current user (interactive) |
Access right management
1 | # set user "foo" of group "bar" as the owner of file "baz" |
Interactives commands (adduser and addgroup)
1 | # create group "bar" |
Leave a comment ✍️ and a “Like” ❤️ if you found this post useful 😉
Thanks for reading !
See you soon !
Keep learning !
Written on Thu Dec 1st 2022, 6:50 GMT+00:00.
Last updated on Thu Dec 1st 2022, 6:50 GMT+00:00.