Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: ssh public key authentication only works when already logged in

  1. #11
    Join Date
    May 2006
    Location
    China
    Beans
    104
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: ssh public key authentication only works when already logged in

    I realise that this message is more than a year old, and you probably have already worked out what is going wrong, but that line in the config file should be:

    /var/openssh/%u/.ssh/authorized_keys

    (%u, not %h)

  2. #12
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: ssh public key authentication only works when already logged in

    Quote Originally Posted by cesera View Post
    I realise that this message is more than a year old, and you probably have already worked out what is going wrong, but that line in the config file should be:

    /var/openssh/%u/.ssh/authorized_keys

    (%u, not %h)
    It shouldn't matter cuz it is commented out.

    I didn't think Ubuntu used /var/openssh ?
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #13
    Join Date
    May 2006
    Location
    China
    Beans
    104
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: ssh public key authentication only works when already logged in

    Quote Originally Posted by CharlesA View Post
    It shouldn't matter cuz it is commented out.

    I didn't think Ubuntu used /var/openssh ?
    The line:
    Code:
     AuthorizedKeysFile      /var/openssh/%h/.ssh/authorized_keys
    is not commented out, and should contain a %u for user, not a %h for user's home directory.

    And yes Ubuntu does not use /var/openssh, but if you work with an encrypted home directory you need to put your AuthorizedKeysFile somewhere else.
    (On top of that you need to add a little script to your unencrypted home directory to decrypt the encrypted one.)

  4. #14
    Join Date
    Apr 2008
    Beans
    12

    Re: ssh public key authentication only works when already logged in

    Also, if anyone is still having issues, try changing authorized_keys to authorized_keys2.

    Good luck
    Simon
    http://www.L3n.co.uk

Page 2 of 2 FirstFirst 12

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
  •