I'm pretty new to this whole Linux and Ubuntu universe.
I've been configuring a server for development and I have run into a problem: some of the directories and files were owned by root, even though I tried to change the ownership and permissions but I had no luck.
I'm curious about how this works: is the user that you have when you install ubuntu has broad priviliges as su? If so, adding a new user would automatically change that?
1 Answer
In Ubuntu the first user or owner of the system is automatically added to the sudo group and can act like as an sudo member. There two ways in which you can act or exercise sudo or root powers, these are:
When you run a command that needs sudo privileges like say:
sudo apt update- here you will be asked for password which will be used to check if you belong to the sudo group like the root user, if so the command will run else it will not
When you switch to the root user with the command:
used when root account has been unlocked and here root password will be needed
su -used when root account has not been unlocked you will be asked for your password to check if you belong to root group
sudo -i
Adding a new user to Ubuntu does not change that, and if you want that user to have root powers or sudo powers you will need to add the user to the sudo group with:
sudo usermod -G sudo -a user 3