Connecting to a CentOs instance using SSH client

0

I have tried connecting to my CentOs-8 instance using SSH (Gitbash, Superputty), it's asking me for password that I am unaware of. While I do the same with Linux instance, I was able to connect it directly. Help me with this.

Rohan
질문됨 3달 전328회 조회
2개 답변
1

Hello.

Does the ssh command specify the key pair as below?

ssh -i ./key.pem centos@ec2-IP-Address

Also, if the public key permissions are not appropriate, SSH may not be possible with the key pair.
https://man.openbsd.org/sshd#FILES

~/.ssh/authorized_keys
Lists the public keys (DSA, ECDSA, Ed25519, RSA) that can be used for logging in as this user. The format of this file is described above. The content of the file is not highly sensitive, but the recommended permissions are read/write for the user, and not accessible by others.
If this file, the ~/.ssh directory, or the user's home directory are writable by other users, then the file could be modified or replaced by unauthorized users. In this case, sshd will not allow it to be used unless the StrictModes option has been set to “no”.

profile picture
전문가
답변함 3달 전
profile pictureAWS
전문가
검토됨 3달 전
  • No, its not, the centos is replaced with ec2-user

  • I think SSH is possible if the key pair is configured correctly. What command are you running to connect?

1

Key-based authentication is tried initially, and if that fails then it goes on to ask for a password.

In addition to @Riku_Kobayashi's advice to ensure the private key is readable by you and nobody else, also make sure you are on the latest version of your SSH client, as some older versions use (what are now considered to be) insecure key-exchange algorithms which a newer OS like CentOS 8 may not trust.

And according to the CentOS website the correct username on CentOS 8 is centos https://www.centos.org/download/aws-images/

profile picture
전문가
Steve_M
답변함 3달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠