0

I have build an AMI in aws using

Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-0d77397e

Now I might be mis-understanding this, but I don't want to use a keypair as we are sharing this ami around a team. It is in a security group that is locked down to our IP's, so i just want to be able to log in using user/pass

When I try to connect I get the username prompt which I enter the user name Ubuntu in on pressing enter I get this prompt:

Disconnected: No supported authentication methods available (server sent: publickey)

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
JaChNo
  • 1,493
  • 9
  • 28
  • 56

2 Answers2

0

You should use key pairs (multiple, no need to share them), but if you really are resistant then you can enable password logins.

Community
  • 1
  • 1
jarmod
  • 71,565
  • 16
  • 115
  • 122
  • thanks for the reply. If I want to add multiple keys, how do I add them to the machines? is this something I can do at build time? – JaChNo Dec 09 '16 at 15:00
  • Yes, you could create an EC2 instance with the user accounts you need and the corresponding public keys, then create an AMI from that image. Or you can just bootstrap the machines dynamically through cloud-init or a CM tool such as Chef. Here are some ideas: https://cloudonaut.io/avoid-sharing-key-pairs-for-ec2/ – jarmod Dec 09 '16 at 15:09
  • `cloud-init` or `Chef` is a way better solution. Rebuilding AMI every time team changes is not a viable solution. – Sergey Kovalev Dec 09 '16 at 20:24
  • Agreed, much better to do it dynamically. – jarmod Dec 09 '16 at 20:30
0

Instead of sharing keys you can create unix users like 1) sudo adduser username -- It will ask you enter password and other details 2) Edit /etc/ssh/sshd_config setting PasswordAuthentication yes 3) Restart the ssh daemon with sudo service ssh restart

Now log back in by saying ssh username@ec2_ip and enter the password you just created in 1.

Kunal
  • 294
  • 4
  • 15