Answer the question
In order to leave comments, you need to log in
I can't connect via ssh from the second PC. Cause?
Set up ssh key authorization on the remote server. Everything worked out great at work. Came home, repeated, but the remote server does not start up with the error "Permission denied (publickey)". Checked - my second client key was added on the server to .ssh/authorized_keys. At the same time, the computer at work continues to connect successfully.
I generated the keys with the command:
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_remote_$(date +%Y-%m-%d) -C "Key for Remote"
ssh-copy-id -i .ssh/id_ed25519_remote_2018-05-24.pub <remote_server>
May 24 22:09:55 <remote_server> sshd[4707]: Connection closed by authenticating user oleg MY_EXTERNAL_IP port 49406 [preauth]
Answer the question
In order to leave comments, you need to log in
Apparently it was the config instructions .
# Ensure KnownHosts are unreadable if leaked - it is otherwise easier to know which hosts your keys have access to.
HashKnownHosts yes
# Host keys the client accepts - order here is honored by OpenSSH
HostKeyAlgorithms [email protected],[email protected],ssh-ed25519,ssh-rsa,[email protected],[email protected],[email protected],ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256
KexAlgorithms [email protected],ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
MACs [email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,[email protected]
Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr
ssh-copy-id -i ~/.ssh/id_ed25519.pub [email protected]
It is very likely that from the external network (from home) you are connecting to the wrong node that you think.
When everything is configured correctly, it just works, nothing else needs to be done on the client (of course, except for the presence of a private key).
I have personal experience of working both locally (home network, server and client on different PCs) and remotely (client on 3G Internet, and server on a router with forwarded port 22).
Are you port forwarded? Whatever, the main thing is that you know its number and ssh definitely responds to it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question