Whilst solving the problems I encountered with the use of sudo I did some searching and I discovered the following 2 pages which I hope will be useful to other less experienced Users.
All of the distributions I have used or tested, so far, if I recall correctly, have had the use of sudo enabled for the User account that is created when the operating system is installed. So, I was not aware that this is not the case for all distributions of Linux.
I have seen su mentioned in the past but maybe there was not enough detail provided to prompt me to further investigate the use of it and hence I did not have the knowledge to know that I could use it to achieve the same things I was accustomed to doing with sudo.
What is the philosophy followed by Calculate/Gentoo with regards to sudo and su?
In Calculate Linux sudo is configured in Live USB. Once installed, you can get the right ‘root’ from the user using the ‘su’. To do this the user must belong to a group ‘wheel’. This is done for the default user ‘guest’.
I would say for a home system with you being the only admin, acting as user and admin My_User_Account ALL=(ALL) ALL is OK but like Alexander stated its not all that safe here are my reasons why.
ALL=(ALL) ALL:
Allowed the user access to everything, unrestricted elevated privileges. The main point for adding users or groups to the sudoers file is to give elevated privileges to that user/group for certain areas on the system. Like say if I were a dev team lead where all the devs under we worked off of one sever:
Well the admin would add me to the sudoers file with elevated privileges to /home/dev/ not to the rest of the system only /home/dev/ so I can have access to all of the home directories of the devs on my team.
Adding
leadDeveloper ALL=(ALL) ALL gives me access to the whole system [I would love this if our admins did this :-)].
Back to what I stated above I personally have My_User_Account ALL=(ALL) ALL [on my home system], its just me as a user and the admin.
When it comes to philosophy, in my opinion there isn’t one there is just a set of best practices. In general you want to preform commands with ‘sudo’ that way you don’t loose your history of who changed what, and you don’t end up with root owning everything [although its easy to chown back to your user if you need to].
A few things I would never do as root ‘su’ [just my opinion here]:
Compile software as root. Especially run GCC as root. I don’t/can’t remember recent reasons not to do this I just have bad memories dealing with permissions and mangled software I compiled as root.
Install software as root. Things like git come to mind. The last thing you want to do is install something and root be the only user that can use the application.
Other than that I think its just personal preference. To me, typing ‘sudo’ makes me think about the command that is going to follow next. But your mileage may vary.