How to append authorized_keys on the remote server with id_rsa.pub key

cat ~/.ssh/id_rsa.pub | ssh user@server 'umask 077; cat >>.ssh/authorized_keys'

OR

ssh user@server "echo \"`cat .ssh/id_rsa.pub`\" >> .ssh/authorized_keys"
ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist

ssh-keygen -t rsa -C "your_email@example.com"
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
# Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press enter]

# start the ssh-agent in the background
eval "$(ssh-agent -s)"
# Agent pid 59566
ssh-add ~/.ssh/id_rsa

clip < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard

ssh -T git@github.com
# Attempts to ssh to github
Запись опубликована автором в рубрике ssh с метками .