N
N
not-deanon2017-07-10 13:12:44
git
not-deanon, 2017-07-10 13:12:44

How to connect to remote server by ssh key in git?

Hello! I am using sherlockhost hosting. The generated SSH keys have been transferred to the computer in the .ssh folder. What now to do in the git to connect to the hosting?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2017-07-10
@2ord

The keys created on the hosting do not need to be copied to a working machine.
Each party must have a pair of keys: private and public. The keys have already been created on the server, now the queue is on the working machine.
After the keys have been generated locally, the contents of the local ~/.ssh/id_rsa .pub file must be added to ~ / .ssh/authorized_keys on the server .

cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question