Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: su command does not work as expected

  1. #1
    Join Date
    Oct 2010
    Beans
    66

    su command does not work as expected

    Hello,


    I have a number of machines running Ubuntu. On one machine I have the problem that the "su"-command does not work as expected.

    When login as the local user "myroot", I can execute "sudo su -" and switch to root-user. Trying executing "su bjoern" (a valid user in an LDAP directory), I get the error message "setgid: Die Operation ist nicht erlaubt".

    When login as the user "bjoern", I can login. When I try to execute "su myroot", I get the error message "su: Fehler bei Authentifizierung". I am quite sure that I have given the correct password.

    As root, I can do both "su bjoern" and "su myroot" without problem.

    What could be the problem?

    Code:
    which su
    returns
    Code:
    /bin/su
    Code:
    ls -Al /bin/su
    returns
    Code:
    -rwsr-xr-x 1 root root 36864 2011-02-14 23:11 /bin/su
    Thank you very much for your assistance.
    Bjoern

  2. #2
    Join Date
    Feb 2011
    Location
    not in Slovenia anymore
    Beans
    1,137
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: su command does not work as expected

    Here too, if I run just
    Code:
    su
    I get the password prompt, but it seems, that it wants the root password
    when
    Code:
    sudo su
    It asks me explicitly for the password for my account, then I have root access.

    PS.
    Code:
    man su
    provides additional data.
    Don't ask what your company can do for you.
    Ask what you can do for
    your company!

  3. #3
    Join Date
    Feb 2011
    Location
    not in Slovenia anymore
    Beans
    1,137
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: su command does not work as expected

    Yes, that's a way to solve this ... I just don't think it is up to the security standards, Linux should stand for...

    A normal user, that is also a sudoer, does not need to have root access, that's why "sudo su"
    Don't ask what your company can do for you.
    Ask what you can do for
    your company!

  4. #4
    Join Date
    Oct 2010
    Beans
    66

    Re: su command does not work as expected

    I agree with An Sanct. Of course, I could set a root-password that I know. But:

    (1) it would not solve the problem, that I cannot "su bjoern" from myroot account (vice versa)

    (2) it works on another machine

    I would highly appreciate hints for further analysis to solve this problem.

  5. #5
    Join Date
    Mar 2007
    Beans
    112
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: su command does not work as expected

    Have you tried "sudo su bjoern" from myroot?
    Sandy Bridge i5-2500, Asus P8Z68-V Pro

  6. #6
    Join Date
    Oct 2010
    Beans
    66

    Re: su command does not work as expected

    I have just tried

    Code:
    sudo su bjoern
    from user myroot and could login. Fine, this could be a workaround for switching to other users from myroot-account.

    Nevertheless, there is still the open point that I cannot su anywhere from bjoern-account on that machine. But this is the much more occasional thing to happen since I am usually working from my user account and not the myroot-account.

    Thank you
    Bjoern

  7. #7
    Join Date
    Oct 2010
    Beans
    66

    Re: su command does not work as expected

    Searching further, I could find the following instruction which solved my problem.

    http://ubuntuforums.org/showthread.php?t=1509778

    Thank you.

  8. #8
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: su command does not work as expected

    1) Don't use su. If you want a root shell, use sudo -s.

    2) Don't set a root password. It enables security holes and if you forget the password, you'll have trouble booting into rescue mode.

  9. #9
    Join Date
    Nov 2006
    Location
    Oregon
    Beans
    4,434
    Distro
    Ubuntu Development Release

    Re: su command does not work as expected

    Quote Originally Posted by psusi View Post
    1) Don't use su. If you want a root shell, use sudo -s.

    2) Don't set a root password. It enables security holes and if you forget the password, you'll have trouble booting into rescue mode.
    Booting into rescue mode shouldn't have any issues if there is a root user password set. It boots into single user mode which shouldn't prompt for that information at all.
    *Don't PM me directly for support, open a new thread
    *Looking for a MythTV quick start guide?

  10. #10
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: su command does not work as expected

    Quote Originally Posted by tgm4883 View Post
    Booting into rescue mode shouldn't have any issues if there is a root user password set. It boots into single user mode which shouldn't prompt for that information at all.
    No, booting into rescue mode requires the root password, unless there isn't one. The default Ubuntu install has no root password; the account is just locked so normal logins can't use it, but rescue mode bypasses the lock. If you set a password, then you will be prompted for it when booting into rescue mode.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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