Users/Groups

List all groups

>_ getent group
copy
>_ cat /etc/group
copy

List all users

>_ getent passwd
copy
>_ cat /etc/passwd
copy

Remove user from group

>_ gpasswd -d [user] [group]
copy
>_ deluser [user] [group]
copy

Add new user to group

>_ useradd -G [group] [user]
copy

Add existing user to group

>_ usermod -aG [groupName] [userName]
copy
>_ adduser [userName] [groupName]
copy
>_ gpasswd -a [userName] [groupName]
copy

User information

>_ finger [user]
copy

Grant sudo privileges to an existing user

>_ usermod -a -G sudo [user]
copy
>_ adduser [user] sudo
copy

Set user password

>_ passwd [name]
copy

Rename user

>_ usermod -l [newUsername] [oldUsername]
copy

Delete user

>_ userdel [name]
copy
>_ deluser [name]
copy

Create user

>_ useradd [name]
copy
>_ adduser [name]
copy

Rename group

>_ groupmod -n [newGroupname] [oldGroupname]
copy

Delete group

>_ groupdel [name]
copy

Create group

>_ groupadd [name]
copy
>_ addgroup [name]
copy
Copied to clipboard
free 100$ digital ocean credit