Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Tutorials»(Resolved) userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms

    (Resolved) userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms

    By RahulMay 10, 20221 Min Read

    The Problem:

    Today, I launched a new AWS instance with Ubuntu 22.04. The default key provided by AWS is working fine with SSH. But when I attached my personal ssh key to the server and tried to access with FileZilla over SFTP, I got the following error in auth.log.

    Advertisement
    May 10 11:52:58 localhost sshd[57650]: Disconnected from authenticating user ubuntu 203.190.146.202 port 46565 [preauth]
    May 10 11:52:59 localhost sshd[57652]: userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
    May 10 11:53:00 localhost sshd[57652]: message repeated 3 times: [ userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]]
    May 10 11:53:00 localhost sshd[57652]: error: Received disconnect from 203.190.146.202 port 50045:14: No supported authentication methods available [preauth]

    The Solution:

    First, I make confirm that key-based authentication is working as I was able to log in with the ssh key provided by the AWS console. After that, I created a new key with type ecdsa.

    Open a terminal and generate a new key-pair:

    ssh-keygen -t ecdsa 
    

    Once the key is generated, add the public key to remote servers ~/.ssh/authorized_key file.

    Now, I can successfully connect to the remote server with FileZilla over SFTP.

    SFTP SSH
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How To Display Warning Message to Unauthorized SSH Access

    How to Set a Custom SSH Login Banner and MOTD

    An Introduction to the “./configure” Command: Compiling Source Code in Linux

    View 2 Comments

    2 Comments

    1. LidagaDL on July 29, 2022 12:19 pm

      This worked for me. I uncommented/added the following lines on /etc/ssh/sshd_config

      PubkeyAuthentication yes
      PubkeyAcceptedKeyTypes=+ssh-rsa

      Reply
      • Lidaga on July 29, 2022 12:22 pm

        I had to work with the existing PEM keys.

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • tail Command in Linux with Examples
    • What is a Orphan Process in Unix/Linux
    • How To Display Warning Message to Unauthorized SSH Access
    • How to Set a Custom SSH Login Banner and MOTD
    • Understanding Reverse DNS: What it is and Why it Matters?
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.