SSH login into EC2 using root user

0

I'm trying to login into my EC2 instance using root as user (no problem using ec2-user) !
I already updated my sshd_config file and enabled ability to login as root
I also removed the lines needed from .ssh/authorized_keys

When try to login I get the following error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Verbose log:
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to xx.xx.xx.xx [] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/my.pem type -1
debug1: identity file /home/user/.ssh/my.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH_7.0**,OpenSSH_7.1**,OpenSSH_7.2**,OpenSSH_7.3**,OpenSSH_7.4**,OpenSSH_7.5**,OpenSSH_7.6**,OpenSSH_7.7** compat 0x04000002
debug1: Authenticating to xx.xx.xx.xx as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key:
debug1: Host '10.35.0.62' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:2
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/user/.ssh/my.pem explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)

debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)

debug1: Next authentication method: publickey
debug1: Trying private key: /home/user/.ssh/my.pem
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: No more authentication methods to try.
root@xx.xx.xx.xx: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Edited by: mabaya-y on Nov 3, 2020 4:20 AM

Edited by: mabaya-y on Nov 3, 2020 4:21 AM

Edited by: mabaya-y on Nov 3, 2020 4:22 AM

Edited by: mabaya-y on Nov 3, 2020 4:23 AM

asked 3 years ago511 views
1 Answer
0

Found a typo in authorized_keys

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions