1. You need to use the certificate to log in to the host for the first time and then set up to allow password login.
ssh -i ./yorpem.pem [email protected]:port
For the default user name, please refer to the official document https://docs.amazonaws.cn/AWSEC2/latest/UserGuide/connection-prereqs.htm
获取用于启动实例的 AMI 的默认用户名称:
对于 Amazon Linux 2 或 Amazon Linux AMI,用户名称是 ec2-user。
对于 CentOS AMI,用户名称是 centos。
对于 Debian AMI,用户名称是 admin。
对于 Fedora AMI,用户名为 ec2-user 或 fedora。
对于 RHEL AMI,用户名称是 ec2-user 或 root。
对于 SUSE AMI,用户名称是 ec2-user 或 root。
对于 Ubuntu AMI,用户名称是 ubuntu。
另外,如果 ec2-user 和 root 无法使用,请与 AMI 供应商核实。
2 Modify to allow password login
vi /etc/ssh/sshd_config
PasswordAuthentication yes
3Restart the ssh service
/sbin/service sshd restart