Results 1 to 2 of 2

Thread: SSH login with key doesn't work.

  1. #1
    Join Date
    Dec 2011
    Beans
    35

    SSH login with key doesn't work.

    I have a VPS partially pre-configured with Ubuntu Server 22.04, updated.
    I would like via SSH to be accessible only with one key.
    I configured the /root/.ssh/authorized_keys file with my key.
    I copied this file to the /home/user/.ssh folder
    I assigned rights 600 on the files and 700 on the .ssh folders.
    I configured Putty with my private key.

    Yet when I call the server, instead of requesting the password on the private key, the login request appears.
    Then if I use root obviously it won't accept the password, but if I use the user I log in without using the key.

    I don't understand why, I always use the same configuration.
    The only difference is that I didn't use "ChallengeResponseAuthentication no" because it wasn't included in the default file and I read online that it's no longer used.

    Furthermore, the writing appears before and after the banner
    Pre-authentication banner message from server:
    MY BANNER
    End of banner message from server
    which I don't like and would like to avoid.

    This is my sshd_config.

    Where am I wrong?

    Code:
    Port 22
    LoginGraceTime 2m
    PermitRootLogin no
    PubkeyAuthentication no
    AuthorizedKeysFile    .ssh/authorized_keys .ssh/authorized_keys2
    PasswordAuthentication no
    PermitEmptyPasswords no
    # ChallengeResponseAuthentication no
    KbdInteractiveAuthentication no
    UsePAM yes
    X11Forwarding yes
    PrintMotd no
    Banner /etc/ssh/banner-pre-login.txt

    === Solved ===
    The error is PubkeyAuthentication no
    Last edited by WhiteTigerIT; February 14th, 2024 at 10:46 AM.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: SSH login with key doesn't work.

    Create a ~/.hushlogin file. Existing is enough.

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
  •