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 Doesn't Allow 'ls'

Discussion in 'General Discussion' started by jonwatson, Apr 1, 2007.

  1. jonwatson

    jonwatson Well-Known Member

    Joined:
    Apr 1, 2007
    Messages:
    101
    Likes Received:
    1
    Trophy Points:
    16
    Hi All,

    New to cPanel, but not new to control panels in general. I'm preparing to migrate a server from ISPConfig to cPanel, but I can't seem to get any joy out of the jailshell. When a jail a user, that user can no longer ls his directory or create files...seems he no longer has permissions to his own directory. This snippet is from one such user in his own home directory:
    Code:
    jailshell-3.00$ ls
    ls: .: Permission denied
    jailshell-3.00$ touch test
    touch: cannot touch `test': No such file or directory
    jailshell-3.00$ mkdir test
    mkdir: cannot create directory `test': No such file or directory
    jailshell-3.00$ 

    Any ideas what's going on here?

    Thanks!
     
  2. david510

    david510 Well-Known Member

    Joined:
    Aug 22, 2004
    Messages:
    473
    Likes Received:
    0
    Trophy Points:
    16
    Get into the directory /home/virtfs/username/home/ from SSH and check the ownership and permission of the folder named username inside this directory. Make sure it has got the ownership username.username and permission 711.
     
  3. jonwatson

    jonwatson Well-Known Member

    Joined:
    Apr 1, 2007
    Messages:
    101
    Likes Received:
    1
    Trophy Points:
    16

    I think perhaps I was a little hasty. Things just started working after a while.
     
  4. david510

    david510 Well-Known Member

    Joined:
    Aug 22, 2004
    Messages:
    473
    Likes Received:
    0
    Trophy Points:
    16
    When the issue with the jail shell persists a reboot of the server should solve it.
     
  5. swapneel

    swapneel Member

    Joined:
    Oct 2, 2006
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Facing this same issue. The Permission denied was fixed after giving the correct ownership to the folder ''/home/virtfs/username/home/username". However, now when I try logging in via SSH and try accessing or listing any files I get nothing,

    Code:
    [digen@redux ~]$ ssh username@domain.com
    username@domain's password:
    Last login: Thu Apr 19 21:34:03 2007 from server.hostname
    -jailshell-3.00$ ls -al
    total 0
    -jailshell-3.00$ ls -al
    total 0
    -jailshell-3.00$
    The shell has been set to ''/usr/local/cpanel/bin/jailshell'' in /etc/passwd. The prompt to isn't changing to username@serverhostname.

    This is happening for only one account. Also when I check the files in the user's home directory /home/username they are there.
     
  6. Danijell

    Danijell Registered

    Joined:
    Jul 12, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Ssh

    Hi,

    When login with problematic user type "pwd" and copy here the output.







    Danijel,
     
  7. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator


    I'm having EXACTLY the same problem. I have recreated this user MANY times, and I still have a problem with his SSH access. Changing his SHELL to a normal shell works fine. The user can logon, and do whatever he needs to, but this isn't desired.

    Code:
    [root@gandalf oostdco]# ll /home/virtfs/oostdco/
    total 175
    drwxr-xr-x   2 root root   4096 Aug 27 04:03 bin
    -rwxr-xr-x   1 root root   1320 Sep 21 08:34 checkvirtfs
    drwxr-xr-x  10 root root  13640 Sep 11 07:58 dev
    drwxr-xr-x   4 root root   4096 Sep 19 11:52 etc
    drwxr-xr-x   3 root root   4096 Sep 19 11:52 home
    drwxr-xr-x  14 root root   4096 Sep  9 04:02 lib
    dr-xr-xr-x 210 root root      0 Sep  7 18:41 proc
    drwxrwxrwt  22 root root 141312 Sep 21 08:38 tmp
    drwxr-xr-x  12 root root   4096 Sep 19 11:52 usr
    drwxr-xr-x   6 root root   4096 Sep 19 11:52 var
    [root@gandalf oostdco]# ll /home/virtfs/oostdco/home/
    total 4
    drwx--x--x 0 oostdco oostdco 0 Sep 20 21:42 oostdco
    [root@gandalf oostdco]# ll /home/virtfs/oostdco/home/oostdco/
    total 0
    
    Looking at another account, which works with jailshell, I get this:

    Code:
    [root@gandalf oostdco]# ll /home/virtfs/bonzai/
    total 175
    drwxr-xr-x   2 root root   4096 Aug 27 04:03 bin
    -rwxr-xr-x   1 root root   1320 Sep 21 08:23 checkvirtfs
    drwxr-xr-x  10 root root  13640 Sep 11 07:58 dev
    drwxr-xr-x   4 root root   4096 Sep 21 08:23 etc
    drwxr-xr-x   3 root root   4096 Sep 21 08:23 home
    drwxr-xr-x  14 root root   4096 Sep  9 04:02 lib
    dr-xr-xr-x 214 root root      0 Sep  7 18:41 proc
    drwxrwxrwt  22 root root 141312 Sep 21 08:39 tmp
    drwxr-xr-x  12 root root   4096 Sep 21 08:23 usr
    drwxr-xr-x   6 root root   4096 Sep 21 08:23 var
    [root@gandalf oostdco]# ll /home/virtfs/bonzai/home/
    total 4
    drwx--x--x 36 bonzai bonzai 4096 Sep  3 08:30 bonzai
    [root@gandalf oostdco]# ll /home/virtfs/bonzai/home/bonzai/
    total 120
    lrwxrwxrwx  1 bonzai bonzai    32 Aug 15 02:21 access-logs -> /usr/local/apache/domlogs/bonzai
    drwxr-xr-x  2 bonzai bonzai  4096 May 31 12:31 bin
    drwxr-xr-x  2 bonzai bonzai  4096 May 29  2004 catalogs
    drwxr-xr-x  4 bonzai bonzai  4096 Aug 15 02:14 cpanel3-skel
    drwxr-xr-x  6 bonzai bonzai  4096 Aug 15 02:13 cpanelbranding
    drwxr-x--- 17 bonzai mail    4096 Aug 15 02:13 etc
    drwxr-xr-x  2 bonzai bonzai  4096 Mar  3  2007 fantastico_backups
    drwxr-xr-x  2 bonzai bonzai  4096 Aug 15 02:13 images
    drwx------  2 bonzai bonzai 20480 Sep  1 05:46 logs
    drwxrwx--- 32 bonzai bonzai  4096 Aug 15 02:13 mail
    drwxr-xr-x  8 bonzai bonzai  4096 Aug 15 02:14 php
    -rwx------  1 bonzai bonzai 44881 Mar 19  2006 pkgacct
    drwxr-xr-x  3 bonzai bonzai  4096 Aug 22 05:46 public_ftp
    drwxr-x--- 23 bonzai nobody  4096 Sep 15 00:28 public_html
    drwxr-xr-x  5 bonzai bonzai  4096 Aug 15 02:13 ruby
    drwxr-xr-x  2 bonzai bonzai  4096 Aug 15 02:13 rvadmin
    drwx------  9 bonzai bonzai  4096 Sep 16 16:00 tmp
    lrwxrwxrwx  1 bonzai bonzai    11 Aug 15 02:21 www -> public_html
    
    
    So, there's some files in /home/virtfs/bonzai/home/bonzai/ but NOT IN /home/virtfs/oostdco/home/oostdco/

    Now, logged in as the user oostdco, with jailshell access, I get this:

    Code:
    -jailshell-3.1$ pwd
    /home/oostdco
    -jailshell-3.1$ ls -la
    total 0
    -jailshell-3.1$ pwd
    /home/oostdco
    -jailshell-3.1$ cd public_html
    -jailshell: cd: public_html: No such file or directory
    -jailshell-3.1$
    
    Then, I change this users shell to Normal Shell, and get this:

    Code:
    [oostdco@gandalf ~]$ pwd
    /home/oostdco
    [oostdco@gandalf ~]$ ls -la
    total 48
    drwx--x--x   7 oostdco oostdco 4096 Sep 21 08:24 .
    drwx--x--x 179 root    root    4096 Sep 21 08:15 ..
    lrwxrwxrwx   1 oostdco oostdco   33 Sep 21 08:24 access-logs -> /usr/local/apache/domlogs/oostdco
    -rw-r--r--   1 oostdco oostdco   24 Sep 21 08:15 .bash_logout
    -rw-r--r--   1 oostdco oostdco  176 Sep 21 08:15 .bash_profile
    -rw-r--r--   1 oostdco oostdco  124 Sep 21 08:15 .bashrc
    -rw-------   1 oostdco oostdco   19 Sep 21 08:15 .contactemail
    drwxr-xr-x   2 oostdco oostdco 4096 Sep 21 08:15 etc
    drwxr-x---   5 oostdco mail    4096 Sep 21 08:40 mail
    drwxr-xr-x   3 oostdco oostdco 4096 Aug 14 05:51 public_ftp
    drwxr-x---   3 oostdco nobody  4096 Aug 14 05:51 public_html
    drwxr-xr-x   6 oostdco oostdco 4096 Sep 21 08:24 tmp
    lrwxrwxrwx   1 oostdco oostdco   11 Sep 21 08:15 www -> public_html
    [oostdco@gandalf ~]$ cd public_html/
    [oostdco@gandalf public_html]$ ll
    total 4
    drwxr-xr-x 2 oostdco oostdco 4096 Sep 21 08:15 cgi-bin
    [oostdco@gandalf public_html]$
    
    

    Any suggestions? It's only happening with ths one account, all other accounts are fine
     
  8. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
  9. mstuebner

    mstuebner Well-Known Member

    Joined:
    May 13, 2007
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    I have something similar. The home dir in virtfs/user/home/user is just empty. Is there any way I can recreate those (hard?) links to make it working?

    WHM 11.11.0 cPanel 11.15.0-R17665
     
  10. VeZoZ

    VeZoZ Well-Known Member

    Joined:
    Dec 14, 2002
    Messages:
    248
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    I just had this issue with a client account and I made a ticket about it. The customer is willing to wait so we can figure out what causes this. So hopefully cPanel can get to the bottom of this and it won't be happening in the future.
     
  11. mynameanu

    mynameanu Member

    Joined:
    Jan 17, 2006
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    This happens from time to time, and it is really easy to fix, simply umount the entire virtfs directory, then log back in to the SSH user, and it will be fine;

    root@server [~]# umount /home/virtfs/<user>/home/<user>/
    root@server [~]#
     
Loading...

Share This Page