Jailkit : users can't login

Discussion in 'Installation/Configuration' started by traaf, Jun 11, 2013.

  1. traaf

    traaf New Member

    hi there,
    i am trying to run jailkit 2.13 on a debian ispconfig 3.0.5.2 server

    i just deleted all users and sites, then created new test user to show you these logs, if anyone can help :eek:

    Code:
    sshd[5148]: Accepted password for test from 109.190.IP.IP port 60527 ssh2
    sshd[5148]: pam_unix(sshd:session): session opened for user test by (uid=0)
    jk_chrootsh[5151]: now entering jail /var/www/clients/client2/web6 for user test (5008)
    jk_chrootsh[5151]: abort, failed to find user 5008 in /var/www/clients/client2/web6/etc/passwd
    sshd[5150]: Received disconnect from 109.190.IP.IP: 11: disconnected by user
    Code:
    cat /etc/passwd
    
    web6:x:5008:5006::/var/www/clients/client2/web6/./home/test:/usr/sbin/jk_chrootsh
    test:x:5008:5006::/var/www/clients/client2/web6/./home/test:/usr/sbin/jk_chrootsh
    
    
    Code:
    cat /var/www/clients/client2/web6/etc/passwd 
    
    root:x:0:0:root:/root:/bin/bash
    test:x:5008:5006:::/bin/bash
    Code:
    11.06.2013-07:19 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:19 - DEBUG - Found 2 changes, starting update process.
    11.06.2013-07:19 - DEBUG - Calling function 'update' from plugin 'apps_vhost_plugin' raised by event 'server_update'.
    11.06.2013-07:19 - DEBUG - Calling function 'update' from plugin 'network_settings_plugin' raised by event 'server_update'.
    11.06.2013-07:19 - DEBUG - Network configuration disabled in server settings.
    11.06.2013-07:19 - DEBUG - Calling function 'update' from plugin 'postfix_server_plugin' raised by event 'server_update'.
    11.06.2013-07:19 - DEBUG - Processed datalog_id 279
    11.06.2013-07:19 - DEBUG - Calling function 'update' from plugin 'apps_vhost_plugin' raised by event 'server_update'.
    11.06.2013-07:19 - DEBUG - Calling function 'update' from plugin 'network_settings_plugin' raised by event 'server_update'.
    11.06.2013-07:19 - DEBUG - Network configuration disabled in server settings.
    11.06.2013-07:19 - DEBUG - Calling function 'update' from plugin 'postfix_server_plugin' raised by event 'server_update'.
    11.06.2013-07:19 - DEBUG - Processed datalog_id 280
    11.06.2013-07:19 - DEBUG - Calling function 'restartHttpd' from module 'web_module'.
    11.06.2013-07:19 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:20 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:20 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:21 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:21 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:22 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:22 - DEBUG - Found 3 changes, starting update process.
    11.06.2013-07:22 - DEBUG - Calling function 'ssl' from plugin 'apache2_plugin' raised by event 'web_domain_insert'.
    11.06.2013-07:22 - DEBUG - Calling function 'insert' from plugin 'apache2_plugin' raised by event 'web_domain_insert'.
    11.06.2013-07:22 - DEBUG - Adding the user: web6
    11.06.2013-07:22 - DEBUG - Creating symlink: ln -s /var/www/clients/client2/web6/ /var/www/test.breizh-ardente.fr
    11.06.2013-07:22 - DEBUG - Creating symlink: ln -s /var/www/clients/client2/web6/ /var/www/clients/client2/test.breizh-ardente.fr
    11.06.2013-07:22 - DEBUG - exec: chown -R web6:client2 /var/www/clients/client2/web6/web
    11.06.2013-07:22 - DEBUG - exec: chown web6:client2 /var/www/clients/client2/web6/web
    11.06.2013-07:22 - DEBUG - exec: usermod --groups sshusers web6 2>/dev/null
    11.06.2013-07:22 - DEBUG - Creating fastcgi starter script directory: /var/www/php-fcgi-scripts/web6/
    11.06.2013-07:22 - DEBUG - Creating fastcgi starter script: /var/www/php-fcgi-scripts/web6/.php-fcgi-starter
    11.06.2013-07:22 - DEBUG - Writing the vhost file: /etc/apache2/sites-available/test.breizh-ardente.fr.vhost
    11.06.2013-07:22 - DEBUG - Creating symlink: /etc/apache2/sites-enabled/100-test.breizh-ardente.fr.vhost->/etc/apache2/sites-available/test.breizh-ardente.fr.vhost
    11.06.2013-07:22 - DEBUG - Apache status is: 1
    11.06.2013-07:22 - DEBUG - Calling function 'restartHttpd' from module 'web_module'.
    11.06.2013-07:22 - DEBUG - Apache online status after restart is: 1
    11.06.2013-07:22 - DEBUG - Processed datalog_id 281
    11.06.2013-07:22 - DEBUG - Calling function 'delete' from plugin 'shelluser_base_plugin' raised by event 'shell_user_delete'.
    11.06.2013-07:22 - DEBUG - Calling function 'delete' from plugin 'shelluser_jailkit_plugin' raised by event 'shell_user_delete'.
    11.06.2013-07:22 - DEBUG - Jailkit Plugin -> delete chroot home:/var/www/clients/client2/web5/home/toto
    11.06.2013-07:22 - DEBUG - Jailkit Plugin -> delete username:toto
    11.06.2013-07:22 - DEBUG - Processed datalog_id 282
    11.06.2013-07:22 - DEBUG - Calling function 'insert' from plugin 'shelluser_base_plugin' raised by event 'shell_user_insert'.
    11.06.2013-07:22 - DEBUG - Executed command: useradd -d /var/www/clients/client2/web6 -g client2 -o  -p \$1\$3ixOfoWJ\$BgMSBOTS0Ou.pDzzKalU61 -s /bin/bash -u 5008 test
    11.06.2013-07:22 - DEBUG - Added shelluser: test
    11.06.2013-07:22 - DEBUG - ssh-rsa setup shelluser_base
    11.06.2013-07:22 - DEBUG - ssh-rsa authorisation keyfile created in /var/www/clients/client2/web6/.ssh/authorized_keys
    11.06.2013-07:22 - DEBUG - ssh-rsa key updated in /var/www/clients/client2/web6/.ssh/authorized_keys
    11.06.2013-07:22 - DEBUG - Disabling shelluser temporarily: usermod -s /bin/false -L test 2>/dev/null
    11.06.2013-07:22 - DEBUG - Calling function 'insert' from plugin 'shelluser_jailkit_plugin' raised by event 'shell_user_insert'.
    11.06.2013-07:22 - DEBUG - Added jailkit chroot with command: /usr/local/ispconfig/server/scripts/create_jailkit_chroot.sh /var/www/clients/client2/web6 'basicshell editors extendedshell netutils ssh sftp scp groups jk_lsh'
    11.06.2013-07:22 - DEBUG - Added programs to jailkit chroot with command: /usr/local/ispconfig/server/scripts/create_jailkit_programs.sh /var/www/clients/client2/web6 '/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico'
    11.06.2013-07:22 - DEBUG - Added bashrc script : /var/www/clients/client2/web6/etc/bash.bashrc
    11.06.2013-07:22 - DEBUG - Added jailkit user to chroot with command: /usr/local/ispconfig/server/scripts/create_jailkit_user.sh test /var/www/clients/client2/web6 /home/test /bin/bash web6 /home/web6
    11.06.2013-07:22 - DEBUG - Added created jailkit user home in : /var/www/clients/client2/web6/home/test
    11.06.2013-07:22 - DEBUG - Added jailkit parent user home in : /var/www/clients/client2/web6/home/web6
    11.06.2013-07:22 - DEBUG - ssh-rsa setup shelluser_jailkit
    11.06.2013-07:22 - DEBUG - ssh-rsa authorisation keyfile created in /var/www/clients/client2/web6//home/test/.ssh/authorized_keys
    11.06.2013-07:22 - DEBUG - ssh-rsa key updated in /var/www/clients/client2/web6//home/test/.ssh/authorized_keys
    11.06.2013-07:22 - DEBUG - Jailkit Plugin -> insert username:test
    11.06.2013-07:22 - DEBUG - Processed datalog_id 283
    11.06.2013-07:22 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:23 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:23 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:24 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:24 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:25 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:25 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:26 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:26 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:27 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:27 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:28 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:28 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:29 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:29 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:30 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:30 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:31 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:31 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:32 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:32 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:33 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    11.06.2013-07:33 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    
     
  2. traaf

    traaf New Member

    hi,

    i tried to manually edit /var/www/clients/client2/web6/etc/passwd adding /path/to/home


    Code:
    test:x:5008:5006::/home/test:/bin/bash
    and it works !

    i tried with another new user and another site

    Code:
    Jun 12 10:52:14 panel sshd[6041]: Accepted password for test2 from 109.190.IP.IP port 58665 ssh2
    Jun 12 10:52:14 panel sshd[6041]: pam_unix(sshd:session): session opened for user test2 by (uid=0)
    Jun 12 10:52:14 panel jk_chrootsh[6044]: now entering jail /var/www/clients/client2/web5 for user test2 (5007)
    Jun 12 10:52:14 panel jk_chrootsh[6044]: abort, failed to find user 5007 in /var/www/clients/client2/web5/etc/passwd
    Jun 12 10:52:15 panel sshd[6043]: Received disconnect from 109.190.55.133: 11: disconnected by user
    Jun 12 10:52:15 panel sshd[6041]: pam_unix(sshd:session): session closed for user test2
    still not working...
    i edited passwd in /var/www/clients/client2/web5/etc
    and it works...

    Code:
    Jun 12 10:53:33 panel sshd[6053]: Accepted password for test2 from 109.190.IP.IP port 52381 ssh2
    Jun 12 10:53:33 panel sshd[6053]: pam_unix(sshd:session): session opened for user test2 by (uid=0)
    Jun 12 10:53:33 panel jk_chrootsh[6056]: now entering jail /var/www/clients/client2/web5 for user test2 (5007)

    Code:
    $pwd
    /home/test2
    $ ls -la /web
    total 36
    drwx--x---  4 test2 client2 4096 Mar 14 10:48 .
    drwxr-xr-x 17 root  root    4096 May 30 02:35 ..
    -rwxr-xr--  1 test2 client2   26 Mar 14 10:48 .htaccess
    drwxr-xr-x  2 test2 client2 4096 Mar 14 10:48 error
    -rwxr-xr--  1 test2 client2 7358 Mar 14 10:48 favicon.ico
    -rwxr-xr--  1 test2 client2 1876 Jun 10 11:28 index.html
    -rwxr-xr--  1 test2 client2   24 Mar 14 10:48 robots.txt
    drwxr-xr-x  2 test2 client2 4096 Jun 11 00:30 stats
    
    is it attended feature or some kind of bug ?
    will i have to manually edit every new shell user ?
     
  3. till

    till Super Moderator

    Tested it here on ispconfig 3.0.5.2 on Debian squeeze and the jailkit user works out of the box. The path does not has to be set in the /etc/passwd file of the jail on my server.
     
  4. traaf

    traaf New Member

    i had some services installed before ispconfig, so i'd like not to reinstall the server from scratch, i'll try to reinstall ispconfig first...
    will be faster this way :/
     

Share This Page