Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Usage of sudo vs su

  1. #1

    Default Usage of sudo vs su

    For some reason I have had a strange idea/doubt for a long time, and wondering if you could help me...

    Did usage of "sudo" over "su -" use to be discouraged on openSUSE in general in the past? Or is it just idea of mine?

    If not, when do you normally use one or the other?

    Thanks.

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,680
    Blog Entries
    15

    Default Re: Usage of sudo vs su

    Quote Originally Posted by F_style View Post
    For some reason I have had a strange idea/doubt for a long time, and wondering if you could help me...

    Did usage of "sudo" over "su -" use to be discouraged on openSUSE in general in the past? Or is it just idea of mine?

    If not, when do you normally use one or the other?

    Thanks.
    Hi
    I for one discourage it's use..... If you want to use sudo, then it's better to configure the sudoers file since it's not really configured....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default Re: Usage of sudo vs su

    So it wasn't just idea of mine...

    Why is sudo discouraged in openSUSE and not in other distros? What's different here?

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,139

    Default Re: Usage of sudo vs su

    It isn't discouraged in openSUSE IMHO. It is just one of the ways to get a root owned process.

    Personally I never use it, but I use
    Code:
    su -
    That - is crucial!

    The implementation in KDE of the menu item "System" > "Terminal - Super User Mode" does do an su -. Thus that is the way I normally do it. It has also the avantage that I can give that terminal a different background colour as an alert.

    AFAIK the default sudo configuration as installed with openSUSE results in the same allowances as su -. But in that case, I do not see any advantage in using the fat sudo over the tiny su - (and no surprises in case the sudo configuration is a bit different from what you assumed it is).

    But I may be biased by the fact that su existed looooong before sudo.
    Henk van Velden

  5. #5
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    14,417
    Blog Entries
    3

    Default Re: Usage of sudo vs su

    Quote Originally Posted by F_style View Post
    Did usage of "sudo" over "su -" use to be discouraged on openSUSE in general in the past? Or is it just idea of mine?
    I don't think openSUSE is actively discouraging "sudo". I think SuSE existed before "sudo" existed.

    My view from early on is:

    System administrators us "su" to get permission for their administrative tasks.
    Other people use "sudo" to handle more limited responsibilities. For example, you could setup "sudo" so that some operational staff could use it to take backups but could not do other administrative tasks.

    And then Ubuntu happened, and they adopted the policy that "sudo" was the way to administer the system. That's one of the things that I dislike about Ubuntu.
    openSUSE Leap 15.2; KDE Plasma 5.18.5;

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,139

    Default Re: Usage of sudo vs su

    I am fully with @nrickert. It seems that other distros (I am not that fluent in all of them, but I accept that it starts with Ubuntu) misuse sudo with the effect that the Linux world is full of advice to precede almost every command with sudo .

    But the way sudo is configured on those systems differ from what openSUSE does by default. In short, you need the root password "to get Superuser status" and not the user password. And that is as it should be.

    But I differ about the age of sudo. See https://en.wikipedia.org/wiki/Sudo.
    I can add that it isn't in the man pages of HP-UX 10.0 (1995, which I still have in print here), but it certainly was available then from other sources (univerity?) then or short after. We (my IT department) rejected it, because it was not from the provider Hewlett Packard and not opensource and thus we would have nobody to go to when there was a security hole).
    Last edited by hcvv; 30-Sep-2020 at 13:47.
    Henk van Velden

  7. #7
    Join Date
    Jun 2008
    Location
    Yorkshire
    Posts
    368

    Default Re: Usage of sudo vs su

    If I try out a buntu based distro (currently kde-neon) I always set up sudoers like opensuse and create a root password.
    Pete

  8. #8

    Default Re: Usage of sudo vs su

    I think Debian has both sudo and su, like openSUSE, but IIRC from somewhere in their forums, they think "sudo is the way to go because it's safer than su: with sudo the root session ends as soon as command ends; with su you run the risk of the root shell remaining open". Or so I understood...

    @malcolmlewis:
    Why do you discourage sudo?

  9. #9
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    22,082
    Blog Entries
    1

    Default Re: Usage of sudo vs su

    Quote Originally Posted by F_style View Post
    I think Debian has both sudo and su, like openSUSE, but IIRC from somewhere in their forums, they think "sudo is the way to go because it's safer than su: with sudo the root session ends as soon as command ends; with su you run the risk of the root shell remaining open". Or so I understood...
    Yes, that is one criticism of the root terminal approach. Of course similar to sudo (non-persistent approach), there is also the possibility to do
    Code:
    su -c <command>
    Last edited by deano_ferrari; 30-Sep-2020 at 15:38.
    openSUSE Leap 15.2; KDE Plasma 5

  10. #10
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    29,680
    Blog Entries
    15

    Default Re: Usage of sudo vs su

    Quote Originally Posted by F_style View Post
    I think Debian has both sudo and su, like openSUSE, but IIRC from somewhere in their forums, they think "sudo is the way to go because it's safer than su: with sudo the root session ends as soon as command ends; with su you run the risk of the root shell remaining open". Or so I understood...

    @malcolmlewis:
    Why do you discourage sudo?
    Hi
    On a single user system, little point, sure for managed systems to control user access and specific applications (I use it for osc and building packages with /usr/bin/build configured with visudo).

    Switch to root user with su - (and not su) perform the required task(s) and exit.... one task per sudo command, seems pointless?

    I like a separate user password and root password, on other distributions that I have played with I always sudo -i and set a root password
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •