- 新しい順
- 投票が多い順
- コメントが多い順
To use SSH with password authentication, enable PasswordAuthentication yes
in the sshd configuration.
Note that password-based authentication is not recommended.
If you do not want to carry around your SSH private key, how about using AWS Systems Manager Session Manager? You can log in to an EC2 instance using an IAM User.
https://docs.aws.amazon.com/ja_jp/systems-manager/latest/userguide/session-manager.html
There's a couple of parts to this, firstly you need to be able to connect into the RHEL EC2 instance using your key in order to change the config to allow password access. Your error sounds very much like this problem here, for which the accepted answer is to update the SSH client https://repost.aws/questions/QUyu0PYkF3SgqGYT1fn5UqQQ/the-official-almalinux-os-9-x86-64-ami-server-refused-our-key
Once you can get onto the host using a key, you can configure it to use passwords. For RHEL there is two steps. First one is as @shibata says, changing PasswordAuthentication
from no
to yes
in /etc/ssh/sshd_config. The second part involves making the same change to /etc/ssh/sshd_config.d/50-cloud-init.conf (or just comment out the PasswordAuthentication
entry from that file.
See the accepted answer for this https://repost.aws/questions/QUE9_NBn5MQ5KgpjVyyy3ISA/unable-to-login-with-username-and-password-in-redhat-machine-created-in-aws
It's worth cautioning here that passwords are disabled by default for a good reason. The AWS public IP address ranges are not a secret, and are widely known. Within minutes of an instance appearing on a public, bots will start to attack it on port 22, trying to brute force their way in using a dictionary of passwords on well-known accounts such as root, ec2-user, ubuntu, centos, oracle, postgres, and so on. By enabling password authentication the EC2 instance becomes vulnerable to this. The risk can be mitigated (but not eliminated) by mandating complex, strong passwords, and also by using security groups to lock down SSH access from only trusted IPs.
関連するコンテンツ
- AWS公式更新しました 3年前