How to configure SSH for a passwordless login into your remote machine

Published: Jan 26, 2024

ssh-keygen
ssh-copy-id remoteusername@remoteserver

if ssh-copy-id fails

Sometimes, ssh-copy-id gives an error and doesn’t copy the files. In that case, use this one liner but replace the remoteuser and servername:

cat ~/.ssh/id_rsa.pub | ssh remoteusername@remoteserver "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

Ensure

[web] · [in] · [fb] · [ig] · [x] · [tt] · [yt]


Previous Post
Next Post