Results 1 to 5 of 5

Thread: can ssh into root but not user, help!

  1. #1
    Join Date
    Apr 2011
    Beans
    4

    can ssh into root but not user, help!

    Having trouble adding a regular user with ssh access on Hardy 8.04. I can ssh into root, but not into the newly created regular user with the same ~/.ssh/authorized_keys

    Code:
    sshd_config has:
    AllowGroups sshlogin
    AllowUsers user root
    
    /etc/group has:
    sshlogin:x:199:user,root
    and ~user/.ssh and ~user/.ssh/authorized_keys are chmod 600 and chown user:user

    ssh user from client results in
    Permission denied (publickey).

    Could someone please enlighten me what could be preventing ssh login to ~user? And yes I would like to disable root ssh access, but it would be nice to be able to ssh into user first
    Last edited by CharlesA; April 22nd, 2011 at 03:40 PM. Reason: added code tags

  2. #2
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Work with groups

    Is user a member of the group "sshlogin" ?

    What is the output of groups?
    Code:
    groups user
    Take out the "AllowUsers user" and work with the groups only, it makes it tidier to manage.

  3. #3
    Join Date
    Nov 2007
    Location
    Newry, Northern Ireland
    Beans
    1,258

    Re: can ssh into root but not user, help!

    Have you added the key to authorized_keys in the .ssh folder of the user's home directory? And set the permission of the authorized_keys file to 600 and the .ssh folder to 700?
    Can't think of anything profound or witty.
    My Blog: http://gonzothegeek.blogspot.co.uk/

  4. #4
    Join Date
    Apr 2011
    Beans
    4

    Re: can ssh into root but not user, help!

    Quote Originally Posted by spynappels View Post
    Have you added the key to authorized_keys in the .ssh folder of the user's home directory? And set the permission of the authorized_keys file to 600 and the .ssh folder to 700?
    Oops, the chmod 700 ~user/.ssh got us a step further but now ssh -vv from the client shows:

    debug1: Offering public key: /Users/user/.ssh/key
    debug2: we sent a publickey packet, wait for reply
    debug1: Server accepts key: pkalg ssh-rsa blen 279
    debug2: input_userauth_pk_ok: fp eb:47:91:24:1a:3d:45:dd:a4:d5:b0:ca:ca:65:bd
    Connection closed by (hostip)

    groups user
    user sshlogin

    and /etc/ssh/sshd_config has:
    AllowGroups sshlogin


    So there's some other access restriction? Thoughts?
    Last edited by tribalvibes; April 23rd, 2011 at 09:00 AM.

  5. #5
    Join Date
    Apr 2011
    Beans
    4

    Re: can ssh into root but not user, help!

    Ah, user was missing from /etc/shadow

    Thanks!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •