Skip to content

Instantly share code, notes, and snippets.

@kentarosasaki
Last active October 17, 2017 02:30
Show Gist options
  • Save kentarosasaki/59e378f7dfcbed9f0324 to your computer and use it in GitHub Desktop.
Save kentarosasaki/59e378f7dfcbed9f0324 to your computer and use it in GitHub Desktop.
ssh-copy-idで公開鍵を渡す ref: http://qiita.com/kentarosasaki/items/aa319e735a0b9660f1f0
cat ~/.ssh/id_rsa.pub | ssh ${USER}@${target_host} "cat >> ~/.ssh/authorized_keys"
ssh-copy-id ${USER}@${target_host}
ssh-copy-id -i ${identity_file} ${USER}@${target_host}
cat ~/.ssh/id_rsa.pub | ssh ${USER}@${target_host} "mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys"
ssh-copy-id ${USER}@${target_host}
cat ~/.ssh/id_rsa.pub | ssh ${USER}@${target_host} "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment