Answer the question
In order to leave comments, you need to log in
Why can't I connect to the SSH server?
I generate a key: sudo ssh-keygen
And the key is stored in ~/key.pub
Then I try to copy this key to the server and I get an error:
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Permission denied (publickey).
Answer the question
In order to leave comments, you need to log in
try manually copy cat ~/.ssh/id_rsa.pub
create folder
mkdir .ssh
chmod 700 .ssh
nano .ssh/authorized_keys
password access is disabled, how are you going to upload the key via ssh if there is no access?
you need to create a .ssh directory in the home directory of the user you plan to login as, and copy the contents of the id_rsa.pub file generated by ssh-keygen into the authorized_keys file. make sure that the ssh server config contains the following line:
AuthorizedKeysFile %h/.ssh/authorized_keys
if not, add and restart the daemon
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question