LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


View Poll Results: root or sudo?
root 14 51.85%
sudo 10 37.04%
Don't know 1 3.70%
Other (please specify in post) 2 7.41%
Voters: 27. You may not vote on this poll

Reply
  Search this Thread
Old 10-11-2018, 10:15 AM   #1
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
root or sudo?


I was wondering if people here prefer using the "root user" account or if you prefer "sudo" ?

Personally, I prefer "root" over "sudo" because if you can't trust yourself to know which user account you are running under, well maybe you should get someone else to administer your machine(s). And I like the old fashioned approach!

I know that the "root user" account is disabled by default in at least some distro's (like the *buntu's etc), but it can be quite easily re-enabled. Does anyone actually do that for another question?

Thanks for your thoughts!
 
Old 10-11-2018, 10:30 AM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Sudo for me. That way I am more aware of what I'm doing when I'm actually root - I can't stay hyper focused and vigilant the whole day and the potential damage I can do is less when I'm running as a non-root user. To add to that, running some GUI apps as root, such as the browser, can be a huge security problem.

The way I see it is that command-line server distros are best run as root, desktop distros as an ordinary user using sudo when required.
 
1 members found this post helpful.
Old 10-11-2018, 10:34 AM   #3
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Sudo is safer if you limit the commands the user you run sudo under can run. This can be inconvenient but nobody said security was convenient, lol. Most distros that disable root have ALL:ALL in etc/sudoers anyway so really what sudo gains you in that regard is an audit trail. If you use the root user, you have no idea who ran a given command in a multi-user environment, especially if folks login directly as root. If you run sudo, there is a log kept of who ran what. If you religiously su to root, then this is also logged so you can see who su'd ad at what time. That's better than nothing.
 
1 members found this post helpful.
Old 10-11-2018, 10:34 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Sudo for me except when I need to do a sequence of root operations. Then it's quicker just to become root for the duration using su.
 
3 members found this post helpful.
Old 10-11-2018, 11:01 AM   #5
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
Quote:
Originally Posted by hazel View Post
Sudo for me except when I need to do a sequence of root operations. Then it's quicker just to become root for the duration using su.
Wouldn't "sudo su" work for that, if you have a distro that doesn't use a root password? I suspect that all your distros do what you want them to, though!

Personally, I use whatever the distro wants me to. If, for example, you enable the use of a root password on a distro that uses sudo, you can find yourself instinctively using it when a GUI tool asks for a password and that won't do.
 
1 members found this post helpful.
Old 10-11-2018, 11:04 AM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Code:
su -
It's no problem for me to remember two passwords. Of course if I'm trying a distro that uses sudo as default, I'll use that.
 
1 members found this post helpful.
Old 10-11-2018, 11:07 AM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
I always have a root password. As far as I know, it's only the *buntus that don't support root logins natively.

@BrianL: I thought I had no problem remembering both my passwords until I broke my right shoulder in February and had to spend a week in hospital. When I got home, I found that my rather complicated root password was actually stored in "muscle memory" and not in my head. Typing with the left hand, I couldn't reconstruct it. Fortunately I had given myself full sudo rights so I got by!

Last edited by hazel; 10-11-2018 at 11:13 AM.
 
1 members found this post helpful.
Old 10-11-2018, 12:20 PM   #8
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,493

Rep: Reputation: Disabled
Another vote for sudo as a general user, quick & easy for the odd command that needs it, like mounting/unmounting drives, (I don't like having them automatically mounted) - but if I need to work as root, then I'll switch to root.
 
1 members found this post helpful.
Old 10-11-2018, 12:45 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
I use sudo with no passwd, and su at times, I detest distro's that decided to take control of are lives in dedicating that root account is not needed. who are they to dictate such rules?
 
1 members found this post helpful.
Old 10-11-2018, 12:54 PM   #10
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Code:
su -
always. I worked as UID 0 for many years before I even heard of sudo. I've never learned to use it.

And what BW-userx said!
 
1 members found this post helpful.
Old 10-11-2018, 01:11 PM   #11
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by BW-userx View Post
I use sudo with no passwd, and su at times, I detest distro's that decided to take control of are lives in dedicating that root account is not needed. who are they to dictate such rules?
"Control of our lives"?

There are rules all throughout Linux - file attributes, access rights, password requirements, all intended to make Linux more secure. "Power users" can easily tweak Linux, and that includes giving root a password for those distros who make the root password empty and locked by default (and these distros are not "dictators", they're just trying to improve security for the normal user).
 
1 members found this post helpful.
Old 10-11-2018, 01:12 PM   #12
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Quote:
Originally Posted by BW-userx View Post
I use sudo with no passwd, and su at times, I detest distro's that decided to take control of are lives in dedicating that root account is not needed. who are they to dictate such rules?
Flame bait if I ever saw it...
 
Old 10-11-2018, 01:13 PM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by sevendogsbsd View Post
Flame bait if I ever saw it...
someone asked my option..... (darn no open flame emojo icons) LQ needs a icon update. ;D
 
Old 10-11-2018, 01:18 PM   #14
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
Quote:
Originally Posted by BW-userx View Post
someone asked my option..... (darn no open flame emojo icons) LQ needs a icon update. ;D
Point taken! And yes, a flame emoji would be useful
 
1 members found this post helpful.
Old 10-11-2018, 01:19 PM   #15
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Original Poster
Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by sevendogsbsd View Post
Flame bait if I ever saw it...
While it's like everything else here it's open to interpretation, personally I didn't see it like that. BW-userx is still on-topic. As long as it's about the thread topic (which I must say all posts so far have been) and no rules have been broken, then it's fine by me.

I must say while I didn't intend on responding this soon, some great comments so far! Thanks guys!
 
  


Reply

Tags
root, sudo, system administration



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sudo to user other than root but do not allow sudo to root Westmoreland Linux - Security 4 07-13-2022 01:09 PM
sudo: effective uid is not 0, is sudo installed setuid root? awladnas Linux - Newbie 10 08-30-2014 06:03 PM
Question about the sudo command, specifically how to have sudo act as if user is root slacker_ Linux - Newbie 17 09-22-2013 03:48 PM
sudo cd /root gives 'sudo: cd: command not found'. stf92 Linux - Newbie 4 03-03-2012 09:05 AM
Can't use sudo, only account that's not root is not a sudo'ers [Ubuntu 9.10] randyriver10 Linux - Desktop 1 01-09-2010 07:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration