A note on ssh connection from macOS Catalina to CentOS7.7. Obviously, it can be used not only on macOS but also on linux and * BSD environments.
mkdir -m 0700 ~/.ssh ssh-keygen
The passphrase is enter key only. Then, the private key (id_rsa) and public key (id_rsa.pub) are generated in the .ssh directory under the home directory.
~/.ssh ┣ id_rsa ┗ id_rsa.pub
Copy the public key to the server.
cd ~/.ssh scp id_rsa.pub (Username on the server)@Server IP:.
Log in to the server once with ssh.
ssh (Username on the server)@Server IP
Register the public key.
mkdir -m 0700 ~/.ssh cd ~/.ssh cat ~/id_rsa.pub >> authorized_keys chmod 0600 authorized_keys
Set up public key authentication on the server.
Modify as follows. #PubkeyAuthentication yes ▼ PubkeyAuthentication yes
service sshd restart
Now you can ssh login from the client side to the server without password authentication.