Essential Ubuntu user management commands
Every single time I set up a new Ubuntu server, I need to create a bunch of groups & users. Instead of Googling for the same commands every time, I thought I’d save my future self some time and just list them here.
Also, here is a nice Digital Ocean article which I find useful as a reference when spinning up a new server.
List all users
cut -d: -f1 /etc/passwd
Add new user
Add user to group
adduser <username> <group>
Check groups that a user belongs to
Login as another user
sudo su <username>