SSH issue while connecting to my instance by using Git Bash


Dell@DESKTOP-NMLG1 MINGW64 ~/Downloads (main) $ ssh -i "site.pem" -p 9229's password: Permission denied, please try again.

1 Answer
Accepted Answer


Is "root" the correct login user for SSH?
Basically, I think the root user is denied connection via SSH.
If "PermitRootLogin" in "sshd_config" is set to "yes", it will be allowed, but if it is set to "no", it will be denied.

Isn't the private key being used the default user private key of the EC2 OS?
The default user varies depending on the OS, but I think it should be the user listed in the document below.

profile picture
answered 7 months ago
profile picture
reviewed 7 months ago
profile pictureAWS
reviewed 7 months ago
  • Yes, root is the correct login, we are facing this issue from recent times

  • Is "PermitRootLogin" set to "yes" in the SSH configuration file? Also, do the fingerprints of the public key and private key you are setting match? There may also be other issues such as public key or private key permissions issues. We recommend that you check the SSH log in the following file.

  • To configure ssh configration file, via aws console also its not allowing and cli is also due permission denied message. So looking if there is an option

  • Can't you temporarily connect using Systems Manager Session Manager or something like that?
    Although the OS that can be used is limited, I think SSH with EC2 Instance Connect is also possible.

  • I connected to the server using Session Manager. However, when attempting to log in via the command line interface (CLI), I encountered a "permission denied" error. I had already configured the sshd_config file by enabling root authentication login (PermitRootLogin: yes).

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