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.

Jailshell login to the server takes me to /

Discussion in 'General Discussion' started by suscp, Sep 25, 2003.

  1. suscp

    suscp Member

    Joined:
    Mar 27, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    This is the exact problem I am facing.

    1)I am logged into the server as root.

    2) I do su username.

    3) I am taken to the jailshell of the user.

    4) I do pwd over there and I get '/'

    5) I can change to his home by doing /home/username.

    6) However this user here doesn't want to do it.


    As soon as he logs into his jailshell he should be default be taken to the following folder.
    /home/username

    There should be a setting somewhere where we can change that right ???

    Someone Help asap.

    I looked through the /etc/passwd file and found that the folder is specified correctly. Any idea whether anything can be set in the virtfs file
    for this particular user.

    cPanel.net Support Ticket Number:
     
  2. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    You misunderstand what a root jailshell is...
    To him, /home/username becomes /
    cd /home/username only works because of symlink tricks...
    Unless your /home/virtfs is damaged, somehow, everything is fine
    Have you tried, as this user, to actually READ or WRITE files outside the jail? Unless you have a broken install, you'll quickly find there's not much to see...

    cPanel.net Support Ticket Number:
     
  3. suscp

    suscp Member

    Joined:
    Mar 27, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I should have explained this better. I login to the server as a user, by doing
    ssh -l username domainname
    I am taken to the following folder '/'
    My user is too lazy to do cd /home/username.
    He wants this to be such that as soon as he logs in , he should be taken to the following folder.
    /home/username/
    Hope this has explained my question better.

    cPanel.net Support Ticket Number:
     
  4. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    Has your user tried to write to / ?
    You should find that he IS inside /home/username...
    The chroot system call from the root jail is a trick
    which makes links relatives to /home/username/
    so /home/username/ = / when inside the root jail I hope I am expressing myself better.

    --
    Lazy users who cannot be bothered to buy automatable clients are just there to make service providers lives difficult...

    cPanel.net Support Ticket Number:
     
  5. suscp

    suscp Member

    Joined:
    Mar 27, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Heh ... Of course .. Thats the first thing we confirm right .. I have found that he is indeed right. In fact that is the case with all our accounts. The / indicates that alone and he has to do cd /home/username to switch to his home directory.

    cPanel.net Support Ticket Number:
     
  6. Curious Too

    Curious Too Well-Known Member

    Joined:
    Aug 31, 2001
    Messages:
    427
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    What build are you running? On WHM 8.2.1 cPanel 8.4.0-E53 the user is dropped into his home directory when logging into the jailshell.

    cPanel.net Support Ticket Number:
     
  7. goodmove

    goodmove Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    I haven't got that version as yet... Can a user still switch to server / when he does a cd / ?
     
  8. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    No it doesn't indicate that, that was my point.
    A chroot will appear as / to the unitiated, until you actually try to write files(lots of files are readable in the root to allow for some applications)

    Try this, in the jailed shell
    cat /etc/passwd
    In a jail shell, there will be only this user's passwords(only a few) but NO ROOT in this password file
    Can you confirm that?

    cPanel.net Support Ticket Number:
     
  9. Curious Too

    Curious Too Well-Known Member

    Joined:
    Aug 31, 2001
    Messages:
    427
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Yes, but the files the users sees are restricted. For example, the /etc/passwd file will not have other users entries. There is no access to /usr/local.

    cPanel.net Support Ticket Number:
     
  10. jcn

    jcn Well-Known Member

    Joined:
    Sep 17, 2003
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    From what I can tell, this was an issue with older (7.4.2) versions of the jailshell. I just upgraded to 8.2-R(something) and the jailshell behaves correctly.

    And just so everyone knows, the jailed environment is read out of /home/virtfs/username.

    Yeah.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page