Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Member
    Join Date
    Apr 2007
    Posts
    100

    Default Jailshell Doesn't Allow 'ls'

    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. #2
    Member
    Join Date
    Aug 2004
    Posts
    472

    Default

    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. #3
    Member
    Join Date
    Apr 2007
    Posts
    100

    Default

    Quote Originally Posted by david510 View Post
    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.

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

  4. #4
    Member
    Join Date
    Aug 2004
    Posts
    472

    Default

    When the issue with the jail shell persists a reboot of the server should solve it.

  5. #5
    Member
    Join Date
    Oct 2006
    Posts
    8

    Default

    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. #6
    Registered User
    Join Date
    Jul 2007
    Posts
    3

    Default Ssh

    Hi,

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







    Danijel,

  7. #7
    Member
    Join Date
    May 2006
    Location
    Johannesburg, South Africa
    Posts
    931
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by swapneel View Post
    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.


    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
    • cPanel :: Fantastico :: RVSkin :: WHM :: ModernBill
    • Reseller Hosting :: SSL Certificates :: Domain Registrations :: Affiliate Program
    • Blog Hosting :: CMS Hosting :: Forum Hosting :: E-Commerce Hosting
    SoftDux- The Leaders in Software
    Use the coupon: cpanel-06 to get 20% off our packages

  8. #8
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,782
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Please open a support ticket.

    https://tickets.cpanel.net/submit/

  9. #9
    Member
    Join Date
    May 2007
    Posts
    50

    Default

    Quote Originally Posted by cpanelkenneth View Post
    Please open a support ticket.

    https://tickets.cpanel.net/submit/
    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. #10
    Member
    Join Date
    Dec 2002
    Posts
    240

    Default

    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. #11
    Member
    Join Date
    Jan 2006
    Posts
    5

    Default

    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 [~]#

Similar Threads & Tags
Similar threads

  1. Jailshell ?
    By Getenks in forum New User Questions
    Replies: 2
    Last Post: 11-23-2009, 05:21 PM
  2. su from jailshell
    By mwmconsulting in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-12-2009, 05:25 PM
  3. About jailshell
    By kalitebil in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 12-12-2003, 10:05 AM
  4. About Jailshell.
    By ruv in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-04-2003, 06:04 AM
  5. jailshell
    By silvernetuk in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-30-2003, 03:00 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube