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, 03:36 PM   #31
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
yep I left Ubuntututu for more than that reason, admitting I never looked into that part of it, as I left Ubuntututu long before, for reasons other than root issues, I only read in here all of the issues users where having with Ubuntututu after I left it to backdoor into Ubunutututu to fix something when a normal Linux distro all that user had to do was type su : passwd. instead the user had to go through a complicated list of commands. maybe they fixed that part of it, but I still stand that it should not even be hidden. this is Linux/GNU so yes if you are going to be using it then learn about that end of it too, and not have it hidden from the users, it keeps them dumb down. an attempt to burn books, yes it is.

I bet if it were possible to remove root all together then the *untutututu would do that.
You can place that bet with me if you want. Very generous terms will be given.

I honestly believe that this is all a mountain out of a molehill territory, over a distro's decision to implement an easily-over-rideable security measure aimed at the default protection of users from logging in as root and inadvertently causing damage to their systems or allowing malware/viruses to do the same.

You could argue that it's actually "dumber" to simply be root for everything, rather than have a nuanced knowledge of what requires root privileges in a Linux system brought about by having to put on the administrator hat when the activity genuinely requires it.
 
2 members found this post helpful.
Old 10-11-2018, 03:43 PM   #32
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Quote:
Originally Posted by rknichols View Post
I always keep a root terminal window handy for administrative things. That window has a light red background as a reminder to be careful when using it.
I've done exactly that with terminal windows to the production server...even when not root ('tho it is more often than not)
 
1 members found this post helpful.
Old 10-11-2018, 05:25 PM   #33
fido_dogstoyevsky
Member
 
Registered: Feb 2015
Location: Victoria, Australia
Distribution: Slackware 15
Posts: 490
Blog Entries: 2

Rep: Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576Reputation: 576
Code:
su
And think to myself "su ROOT" before hitting the Return key.
 
1 members found this post helpful.
Old 10-11-2018, 05:45 PM   #34
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 hydrurga View Post
You can place that bet with me if you want. Very generous terms will be given.

I honestly believe that this is all a mountain out of a molehill territory, over a distro's decision to implement an easily-over-rideable security measure aimed at the default protection of users from logging in as root and inadvertently causing damage to their systems or allowing malware/viruses to do the same.

You could argue that it's actually "dumber" to simply be root for everything, rather than have a nuanced knowledge of what requires root privileges in a Linux system brought about by having to put on the administrator hat when the activity genuinely requires it.
if they log in as root and screw up their system then no one is to blame but the one that logged in as root and screwed up the system. then one can only hope that one can learn from their mistakes. to put on the admin hat when needed is why su and su- existed. even though sudo was still around then, pertaining to Linux. removing the root account then caused what that needed to take place?

sudo su and all of the other variation, because the root user cannot be destroyed only hidden. therefore Ubuntutu and other linux/GNU cannot remove it. the only one that should have the root account access is the one that installed it, of course I speak of the home user more than the corporations which have a sudoers file too that can have adjustments added to it to limit someone rights to do this or that.

I still see no reason whatsoever to remove it in the first place. as you stated one line and its back again, so why bother in the first place?

I do remember seeing a youtube vid where the CEO of Red Hat destroyed his system running as root, so it can happen to the best of anyone.

Last edited by BW-userx; 10-11-2018 at 05:56 PM.
 
1 members found this post helpful.
Old 10-11-2018, 08:25 PM   #35
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,385
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
sudo was designed to give users limited access to specific commands that they might need in the course of their duties. The *buntus' use of it is not (you will pardon the expression) canonical. It is not a use, but a misuse of sudo.
 
1 members found this post helpful.
Old 10-11-2018, 10:42 PM   #36
Mike25
Member
 
Registered: Feb 2003
Location: ON, Canada
Distribution: Fedora & RH3
Posts: 56
Blog Entries: 2

Rep: Reputation: 11
As soon as I boot up, I bring up a shell and su, then just minimize it until I need to do something in shell. If I'm going to be doing a few things, and don't need to be root, I'll exit from root and run as user, but otherwise I like to have root shell always ready for me.

I learned the hard way how to be careful in root shell. I got my first server back in 2000. A few months later I was doing some temporary stuff...

in / I did something like this:
mkdir temp
did stuff, then when done, still in root dir
rm -Rf temp *

It was supposed to be temp/* but somehow I goofed. lol
Good thing I didn't have much on it yet and was still practising.

We learn by trial and error, right?
 
1 members found this post helpful.
Old 10-12-2018, 12:53 AM   #37
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
Whenever I am doing a particularly long operation (such as repartition to LV creation, or troubleshooting an issue), I use root account. I hate putting sudo on every line I type, when the behavior/result is expected and known.

Other than that, sudo for quick one time operations (such as connecting to a VPN, move something to/from, custom scripts etc) and when setting up something new from scratch (either try-fail-review-repeat or following a HOWTO).

The poll lacks a "both" option.
 
1 members found this post helpful.
Old 10-12-2018, 05:52 AM   #38
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
I use sudo without a password for shutting down or rebooting, because you can't do any harm with those commands on a single-user system. I don't like no-password sudo for potentially dangerous commands. Having to give a password slows you down just that little bit and gives you time to consider what you have just typed. I consider this a security feature.
 
2 members found this post helpful.
Old 10-12-2018, 05:59 AM   #39
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
@Hazel,

In CentOS/Suse, I can shutdown/reboot without sudo.
Code:
systemctl reboot/shutdown -i
I know Crux and AntiX are SysV init based (do correct me if I am wrong). But you have any systemd based OS, it would be interesting to know if it works.
 
1 members found this post helpful.
Old 10-12-2018, 06:11 AM   #40
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
systemd/systemctl use polkit2 to set particular internal operations as permitted or not permitted to certain classes of users. This is quite independent of the traditional unix su/sudo system, which works on complete processes only. Sysvinit uses the shutdown program, which is not polkit-aware, so can't use this technique.

If you try to use systemctl to start or stop a daemon as an unprivileged user, you'll probably find that it doesn't work.

Last edited by hazel; 10-12-2018 at 06:13 AM.
 
1 members found this post helpful.
Old 10-12-2018, 06:39 AM   #41
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
When I saw this thread I guessed it would quickly turn into yet another "Ubuntu use of sudo" discussion.

The sudo website and maintainer (OpenBSD developer Todd C Miller) are a good source of info.

Overview of sudo: https://www.sudo.ws/intro.html
History of sudo: https://www.sudo.ws/history.html

su(1) dates back to AT&T UNIX. Traditionally only members of the wheel group could su, but RMS removed that restriction from the GNU version.

Neither one is the "correct" method. It's a matter of best use case / personal preference. However the average home desktop user probably doesn't need it's features, but still might prefer it.

Ubuntu's implementation wasn't "wrong" per se, it was just the attitude from the distribution/canonical/it's website and forums where users trying to set a password for the root account were actually censored.

This gave rise to some people responding to questions on forums, etc with commands preceded by sudo, rather than using traditional $/# notation and leaving it to the user to decide. In many cases commands which did not need root privileges were still being preceded with sudo, as well as many "howto" and blog articles containing similar commands.

Last edited by cynwulf; 10-12-2018 at 06:43 AM.
 
3 members found this post helpful.
Old 10-12-2018, 07:38 AM   #42
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: Arch Linux && OpenBSD 7.4 && Pop!_OS && Kali && Qubes-Os
Posts: 824

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
i use root acc at my openbsd bridge, not surfing the net with it tho - just "pkg_add -u && syspatch".
i use "sudo su" at my desktop computer (fedora 28).
 
1 members found this post helpful.
Old 10-12-2018, 07:39 AM   #43
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: Arch Linux && OpenBSD 7.4 && Pop!_OS && Kali && Qubes-Os
Posts: 824

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
EDIT: sry bout double post.
 
Old 10-12-2018, 08:17 AM   #44
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
I only used Ubuntu once for a short while. It was Dapper Drake, so you can see how long ago that was! I quite liked the universal sudo thing in practice, so I have used it since on all of my distros. But of course I have a root account too on all of them.

By default AntiX gives the first registered user full sudo rights like the *buntus, but has a root account too. Best of both worlds.
 
1 members found this post helpful.
Old 10-12-2018, 08:35 AM   #45
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by jsbjsb001 View Post
While I understand why sudo exists; Personally, it's annoying to have to put "sudo" front of every command you want to run with root permissions.
Time to think outside the box. There are ways to run sudo commands without having to place sudo in front of them.

Last edited by lazydog; 10-12-2018 at 08:38 AM.
 
  


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 08:20 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