Taichman
Taichman

Reputation: 1118

Allowing users to ssh to an EC2 Ubuntu instance?

The default way to access an new EC2 instance is by using your key-pair.

How can I allow other users to connect to my instance, without giving them my keys? (Ideally, I'd like them to be prompted for user/password on login)

Upvotes: 28

Views: 25557

Answers (3)

JR Smith
JR Smith

Reputation: 1216

To save some Ubuntu neophytes like myself some time, newer Ubuntu instances no longer use sshd reload. Instead it is asking for:

sudo restart ssh

Please see this SO link for more details: https://superuser.com/questions/214799/no-etc-init-d-sshd-file-ubuntu-ec2

Upvotes: 11

MsjComprendo
MsjComprendo

Reputation: 620

Edit /etc/ssh/sshd_config and set PasswordAuthentication to yes.

Enter the command sudo /etc/init.d/sshd reload.

Then you could Create a User with:

useradd USERNAME

(check the man for options on how to set home directory etc...)

Then

passwd USERNAME 

You will be prompted for a New password

Upvotes: 42

jmontross
jmontross

Reputation: 3583

sudo vi /etc/ssh/sshd_config 
:s/PasswordAuthentication no/PasswordAuthentication yes/   
:wq

sudo /etc/init.d/sshd reload

sudo useradd newuser

it prompts you and you enter password.

you wish to change a passwd?

sudo passwd newuser

Now your users can login with

ssh [email protected]_public_ip 

Upvotes: 4

Related Questions