The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

su in jailed shell

Discussion in 'General Discussion' started by Alarion, May 4, 2003.

  1. Alarion

    Alarion Member

    Joined:
    Sep 3, 2001
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Currently I am SSHing in to my server as root. However, I would prefer to use jailed shell of a normal user account to su to root.

    Whenever I "su" in a jailed shell it automatically returns with "incorrect password" without even prompting.

    Any way to fix this? I don't want to enable a normal shell if I don't have to, and I want to dissallow root from SSHing directly into the server.

    Ideas?
     
  2. Alarion

    Alarion Member

    Joined:
    Sep 3, 2001
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    I have tried:
    su
    su root
    su - root
    su root password
    su - root password

    I made sure no one else was on the system when passing the password on the commandline ;)
     
  3. carperman

    carperman Well-Known Member

    Joined:
    Feb 7, 2002
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    you have added the user you are using for ssh to wheel group?
     
  4. Alarion

    Alarion Member

    Joined:
    Sep 3, 2001
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    yes

    otherwise the user would get a "permission denied" error when trying to execute the su command.
     
  5. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    you can't su to root in a jailed shell for secuirty reasons
     
  6. xsenses

    xsenses Well-Known Member

    Joined:
    Aug 29, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Huntington Beach, Ca
    I figured I would piggy back rather than create another thread.

    I su to root in a non jailed account and for some reason I can't run up2date "command not found", but it works fine if I permit root login.

    Any ideas?
     
  7. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Are using su or su -
     
  8. Alarion

    Alarion Member

    Joined:
    Sep 3, 2001
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Makes sense, but I wanted to be sure.

    thanks for the reply :)
     
  9. xsenses

    xsenses Well-Known Member

    Joined:
    Aug 29, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Huntington Beach, Ca
    su but su - works thanks. What is the difference?
     
  10. Alarion

    Alarion Member

    Joined:
    Sep 3, 2001
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    by adding the "-" it tells su to transfer the environment of the target user.

    If you leave off the "-" things like the PATH environment variable remain as set by the first user you logged in as.
     
  11. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    well said :D
     
  12. xsenses

    xsenses Well-Known Member

    Joined:
    Aug 29, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Huntington Beach, Ca
    Thanks guys - very informative.
     
Loading...

Share This Page