Allowing users to ssh to an EC2 Ubuntu instance?
Solution 1
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
Solution 2
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
Solution 3
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
Taichman
Parsers for non-standard layer2-4 protocols Speech Recognition System Mobile Equipment and Network security Contextual Mobile Search (before it was cool) Mobile Device Location Bluetooth-Low-Energy
Updated on December 19, 2020Comments
-
Taichman over 3 years
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)