I am following the well-accpetedaccepted answer of to terminal - How to ssh to remote web server without using a password - Ask Different to ssh to remote sever without password
1, Generate a fresh key pair on local mac:
- Generate a fresh key pair on local mac:
2, copy the new key to remote server,(Centos)
- copy the new key to remote server (CentOS)
3, change permissions of .ssh
- change permissions of .ssh
4, config
- config
Unfortunately:
Unfortunately:$ ssh [email protected] [email protected]'s password:
6, I followed the thumbs youtube instrucitons Linux/Mac Tutorial: SSH Key-Based Authentication - How to SSH Without a Password - YouTube
``` $ ssh [email protected] [email protected]'s password: ``` - I followed the thumbs YouTube instructions Linux/Mac Tutorial: SSH Key-Based Authentication - How to SSH Without a Password - YouTube
7, Try again from the local
- Try again from the local
8, I search solutions to use scp
- I search solutions to use scp
9, I check another vedio SSH without password | Tutorial - YouTube
- I check another video SSH without password | Tutorial - YouTube
``` changmod to 600 $ sudo ls -al .ssh total 32 drw------- 10 me staff 320 Dec 1 00:13 . drwxr-xr-x+ 67 me staff 2144 Dec 1 00:01 .. -rw------- 1 me staff 1696 Sep 1 10:15 MyKeyPair.pem -rw------- 1 me staff 1692 Sep 1 23:21 SecondKeyPair.pem -rw------- 1 me staff 137 Dec 1 00:01 config -rw------- 1 me staff 3243 Feb 27 2018 id_rsa -rw------- 1 me staff 749 Feb 27 2018 id_rsa.pub -rw------- 1 me staff 3760 Nov 5 19:33 known_hosts -rw------- 1 me staff 3389 Nov 30 23:22 webserver -rw------- 1 me staff 745 Nov 30 23:22 webserver.pub $ sudo ssh [email protected] [email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic). ``` the sshd_configThe sshd_config on the server:
alternativeAlternative test:
$ /usr/sbin/sshd -d -p 2222 debug1: sshd version OpenSSH_7.8, LibreSSL 2.7.3 Could not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ssh/ssh_host_ecdsa_key Could not load host key: /etc/ssh/ssh_host_ed25519_key sshd: no hostkeys available -- exiting. $ sudo /usr/sbin/sshd -d -p 2222 Password: debug1: sshd version OpenSSH_7.8, LibreSSL 2.7.3 Could not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ssh/ssh_host_ecdsa_key Could not load host key: /etc/ssh/ssh_host_ed25519_key sshd: no hostkeys available -- exiting.