Answers for "ssh - use public key to login"


ssh - use public key to login

# generate ssh key first on your source host:
ssh-keygen -t rsa

# copy it to the remote/target host:
ssh-copy-id [email protected]_ip_addressCopy

# if for some reason the above method unavailable, use:
cat ~/.ssh/ | ssh [email protected]_ip_address "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
Posted by: Guest on May-10-2021

Browse Popular Code Answers by Language