Is it possible to connect a EC2 Linux instance via ssh without the key pair?
13,412
Solution 1
You can create a regular user account with a password and use that to log in, but it's not as secure as using SSH keys; you'll be open to script kiddies trying to crack your passwords. You could also enable password access for root if you're really not too worried about security.
Solution 2
vi /etc/ssh/sshd_config
- PasswordAuthentication no
+ PasswordAuthentication yes
service sshd restart
Related videos on Youtube
Author by
Jan Deinhard
Updated on September 17, 2022Comments
-
Jan Deinhard over 1 year
I can connect to my EC2 Linux instance via ssh using the key pair (*.pem). Is it somehow possible to connect it with ssh with out the pem file?
-
Jan Deinhard almost 14 yearsActually I'm very concerned about security, but I don't like to carry the pem files arround.
-
Kishan K almost 8 yearsyou should work on your formatting
-
Brennen Smith almost 8 yearsssh with password auth is asking for trouble - especially if you stick with the default ec2 username. But if it's really too much of an inconvenience to carry around an encrypted pem, you can always to 2factor ssh auth with
authy
orgoogle-authenticator
. -
Skaperen over 7 yearsi have and use just one ssh id for all the instances i launch and just one key-pair for it. if you want to use many different ones, look at ssh-agent to secure them for you. keys are better than passwords.