Config sshd to Use Username and Password for One User
Allow one user SSH access with username/password
Create user if needed:
sudo adduser myuser
sudo passwd myuser
Manage sshd:
- Make sure
/etc/ssh/sshd_config
hasPasswordAuthentication no
- At the end of
/etc/ssh/sshd_config
add (to make the exception):
Match User myuser
PasswordAuthentication yes
- Check configuration:
sudo sshd -t
- If no errors, restart sshd. Example ubuntu:
sudo service sshd restart
Test with myuser
:
ssh myuser@host
-> a password input request should appear
Read other posts