Skip to content

Instantly share code, notes, and snippets.

@vutranvn
Last active October 7, 2017 19:05
Show Gist options
  • Save vutranvn/9b9bf7d5930d817a7d677a7f773c271d to your computer and use it in GitHub Desktop.
Save vutranvn/9b9bf7d5930d817a7d677a7f773c271d to your computer and use it in GitHub Desktop.
/**
* For me use ^^
**/
- List all users:
> awk -F':' '{ print $1}' /etc/passwd
or
> cut -d: -f1 /etc/passwd
OR
> cat /etc/passwd
- List all groups
> cat etc/group
- User add
> useradd username (useradd -g|-G groupname username)
> passwd username
> usermod -g|-G groupname usernamev
- Remove user and his directory
> sudo deluser --remove-home username
OR
> sudo deluser --remove-all-files username
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment