Created
May 6, 2024 15:01
-
-
Save mjones129/d6383b4cbf8f45884d0e9f2fffb6618d to your computer and use it in GitHub Desktop.
Add SSH public key to server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Magically copy your public key to a remote server and add it to authorized_keys with this handy one-liner. | |
# -i flag accepts the path to the file that will be uploaded. | |
# final argument is the username@host-destination root directory. | |
ssh-copy-id -i ~/.ssh/some-key.pub user@host.com | |
# To confirm the copy was successful (supposing you can recognize your public key when you see it) | |
ssh user@host.com && cat /.ssh/authorized_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment