Jailkit Shell User login without password?

Discussion in 'General' started by bendiy, Jan 5, 2012.

  1. bendiy

    bendiy New Member

    I'm trying to add a public key to a jailkit shell user so they can login without entering a password. Adding the key to a /home/username/.ssh directory doesn't seem to work.

    Is this possible?

    If so, how can I set it up?

    Thanks!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Add the key in iSPConfig to the ssh key field in the shell user settings.
     
  3. bendiy

    bendiy New Member

    I've upgraded to 3.0.4.1, so I now have the "SSH-RSA Public Key" field for the shell user. I add the pub key like so:
    Code:
    ssh-rsa AAAABBBB....ZZZZ=
    After saving, it still doesn't work. I get prompted for the password after connecting.
    Code:
    ssh [email protected]
    [email protected]'s password:
    
    I've verified that both of these were created, but as root user and group:
    Code:
    /var/www/clients/client123/web123/home/shellusername/authorized_keys
    /var/www/clients/client123/web123/.ssh/authorized_keys
    The above key is in the authorized_keys files as one line.

    Should the user and group be root?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

  5. bendiy

    bendiy New Member

    I just upgraded to the RC1 you linked to. Still no luck.

    It did create the directory and files with the correct user and group this time, but it's still prompting for the password.

    Do I need to set the user to "--disabled-password" or enable "RSAAuthentication yes" in ssh_config? I'm coming from a pretty much stock http://www.howtoforge.com/perfect-server-ubuntu-10.04-lucid-lynx-ispconfig-3

    Thanks for the help.
     
  6. bendiy

    bendiy New Member

    I've got it working now.

    I had set the folder to:
    Code:
    chmod -R g+w shelluserdir
    I want to allow another user to have access to that folder, but I guess this breaks the ssh login via key. Is there a Jailkit setting to allow this? I had to turn on to be able to even log in via ssh with a password after making the above change:
    /etc/jailkit/jk_chrootsh.ini
    Code:
    [shelluser]
    relax_home_group_permissions=1
     
  7. bendiy

    bendiy New Member

    This looks like it works.

    Change it back to no group write:
    Code:
    chmod -R g-w shelluserdir
    Then set a sub-directory to group write:
    Code:
    chmod -R g+w shelluserdir/sub-dir
    That allows my other use to access and write files. They just cannot save in the root of the home directory which is fine.
     

Share This Page