achrn
Posts: 412
Joined: Wed Feb 13, 2013 1:22 pm

tip of day - root password

Wed Dec 18, 2013 2:06 pm

Tip of the day today is "Type sudo passwd root to give your root user a password. Now you can simple su - when you have lots of commands to execute as root, instead of having to put sudo in front of each one."

Clearly this works, but is it wise? If you actually have a series of commands to type and don't want to sudo each individually, I would have thought a better solution than that set out above is to 'sudo /bin/su'. That is, to simple su by using sudo. This way, you don't need a root password, which is presumably considered a good thing by whoever decided that most distros wouldn't have one.

Personally, I don't have any problem logging in as root, but someone thinks sudo is an improvement, so if it is an improvement, a solution that doesn't circumvent it is probably a good thing.

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: tip of day - root password

Wed Dec 18, 2013 2:34 pm

I thought most of the reason for not having root enabled was to help novice user not have to remember 2 sets of passwords. The problem with that is some applications when started via the GUI require the root password. For example the Aptitude package manager which is pre installed in the Raspbian image, asks for root password when doing certain functions. So if root is not set then it won't work. However, if the user starts aptitude from the command prompt with sudo aptitude, then it works as expected, but is counter intuitive to the novice user who would probably want to click on the GUI icon.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

999frogs
Posts: 25
Joined: Thu Dec 22, 2011 1:57 pm

Re: tip of day - root password

Wed Dec 18, 2013 3:54 pm

The point of encouraging use of sudo is to get people to think about what they are doing as root and try to shield unintentional consequences - being constantly logged in as root can cause complacency and allow one to forget the extended privileges enjoyed

Any number of unintentional commands executed as normal user cause minor irritation, whereas if run as root will trash your system

Return to “General discussion”