6

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?

4 Answers 4

5

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.

3
  • Actually I'm very concerned about security, but I don't like to carry the pem files arround. Commented Aug 4, 2010 at 17:40
  • ssh 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 or google-authenticator. Commented Jun 26, 2016 at 4:51
  • i 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.
    – Skaperen
    Commented Sep 28, 2016 at 8:04
5
vi /etc/ssh/sshd_config


- PasswordAuthentication no
+ PasswordAuthentication yes

service sshd restart
0
0

You can configure whatever login system you like including turning off keys and using pure password authentication, however this is NOT recommended if you have any interest in keeping your box secure.

Your keys should also be pass phrase protected so that the part you are carrying around isn't a free ride if into your server in case you ever use a compromised local machine. I suggest generating your own keys to do this.

You can keep your private key file in a service like dropbox or saved as an attachment to your email if you need access to it on the road and are worried about forgetting it. The combination of password on your email or dropbox account plus the pass phrase on the key itself should be a reasonable degree of security.

0
# sudo adduser USERNAME
# sudo passwd USERNAME

Edit /etc/ssh/sshd_config :

PasswordAuthentication yes

Then do

# sudo service ssh restart
1
  • you should work on your formatting
    – Marki
    Commented Jun 25, 2016 at 21:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .