Skip to main content
Fixed numbered list formatting, harmonized code formatting (backticks were shown in code snippets instead of being parsed as markdown)
Source Link
fra-san
  • 10.9k
  • 2
  • 27
  • 45

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:

  1. Generate a fresh key pair on local mac:

2, copy the new key to remote server,(Centos)

  1. copy the new key to remote server (CentOS)

3, change permissions of .ssh

  1. change permissions of .ssh

4, config

  1. config
  1. Unfortunately:

    $ ssh [email protected] [email protected]'s password: 
    Unfortunately:

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: ``` 
  1. 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

  1. Try again from the local

8, I search solutions to use scp

  1. I search solutions to use scp

9, I check another vedio SSH without password | Tutorial - YouTube

  1. 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. 

I am following the well-accpeted answer of 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:

2, copy the new key to remote server,(Centos)

3, change permissions of .ssh

4, config

  1. 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

7, Try again from the local

8, I search solutions to use scp

9, I check another vedio 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_config on the server

alternative 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. 

I am following the well-accepted answer 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:
  1. copy the new key to remote server (CentOS)
  1. change permissions of .ssh
  1. config
  1. Unfortunately:
``` $ ssh [email protected] [email protected]'s password: ``` 
  1. I followed the thumbs YouTube instructions Linux/Mac Tutorial: SSH Key-Based Authentication - How to SSH Without a Password - YouTube
  1. Try again from the local
  1. I search solutions to use scp
  1. 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_config on the server:

Alternative 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. 
added 332 characters in body
Source Link
$ /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. 
$ /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. 
$ /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. 
added 328 characters in body
Source Link

alternative 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. 

alternative 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. 
added 8263 characters in body
Source Link
Loading
added 784 characters in body
Source Link
Loading
Source Link
Loading