sudo apt-get install openssh-server
- Edit
sshdconfigfile:nano /etc/ssh/sshd_config - Not Allow root SSH login Set
PermitRootLogintoNo - Allow specify user: add
AllowUsers <username>, you can skip this step if allow all users with keys - Login to new user
su - <username>. - Add
.sshdirectory and set permission:
mkdir .ssh
chmod 700 .ssh
nano .ssh/authorized_keys
Add Public key
chmod 600 .ssh/authorized_keys
exit - Restart SSH
service ssh restart