I reciently decided to manage my own web server (Ubuntu/Nginx) and as best practices I went and disabled the root user and created a new one with root privileges. When I created the new user I didn't specify what group to add it to, this is how I created it.
adduser newUserName
Then I added to the sudo group
gpasswd -a newUserName sudo
What confuses me is that when I type cat /etc/group
to see all groups there is a group with the name of the user I created.
root
...
newUserName
So I started wondering if the way I created the new user is the right way to do it or it's better to create a group first and then add any user with the same privileges to the same group.
Can someone suggest a best practice to manage users/groups in Ubuntu Server or direct me to where I can find more information?
What would happen if I create a new group with the same privileges as the existing user and move the existing user newUserName to this folder?
I guess I'm looking to have a better understanding of how users are typically managed in Ubuntu Server.
Thanks a lot.