-
Notifications
You must be signed in to change notification settings - Fork 0
SSH without password in Ubuntu 16.04
Prepare
login Ubuntu by account of root.
Using RSA:
-
Change "PermitRootLogin prohibit-password" to "PermitRootLogin yes" in /etc/ssh/sshd_config.
Then restart the service of sshd(service sshd restart) -
Create RSA:
ssh-keygen -trsa -P'' -f/root/.ssh/id_rsa -
Append Pub Key to authorized file:
ssh-copy-id -iid_rsa root@localhost
Need input password for root once in processing. -
Verify SSH without password:
ssh localhost
Success by showing SSH into without password.
Using DSA:
-
Change "PermitRootLogin prohibit-password" to "PermitRootLogin yes" in /etc/ssh/sshd_config, and add the line of "PubkeyAcceptedKeyTypes=+ssh-dss" into it.
Then restart the service of sshd(service sshd restart) -
Create DSA:
ssh-keygen -tdsa -P'' -f/root/.ssh/id_dsa -
Create the file named config at /root/.ssh.
Then add the line of "PubkeyAcceptedKeyTypes=+ssh-dss" into it. -
Append Pub Key to authorized file:
ssh-copy-id -iid_dsa root@localhost
Need input password for root once in processing. -
Verify SSH without password:
ssh localhost
Success by showing SSH into without password.