sas12

opy your ssh public key to a server from a machine that doesn't have ssh-copy-id

Jan 20th, 2021
623
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Copy your ssh public key to a server from a machine that doesn't have ssh-copy-id
  2. If you use Mac OS X or some other *nix variant that doesn't come with ssh-copy-id, this one-liner will allow you to add your public key to a remote machine so you can subsequently ssh to that machine without a password.
  3.  
  4.  
  5.  
  6. cat ~/.ssh/id_rsa.pub | ssh user@machine "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
RAW Paste Data