简体   繁体   中英

SSH using git - private and public key

I'm new to ssh and having some trouble with using private and public keys to connect to host. Currently, I use simple syntax:

Plain SSH in git

ssh username@host

and it works like a charm, but now at my office, I don't have direct access to shell. I have to use private and public keys, I used putty/putty-Gen as well, but that didn't work out, is there any way that I could use git to connect to a server using private and public keys?

You need to authorize the public key contained on your office machine with your host.

Append the contents of your (office machine) ~/.ssh/<id>.pub to your (remote host) ~/.ssh/authorized_keys file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM