How To Specify Ssh Keys When Running Shell Command Like Git,Rsync

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/specify-ssh-keys-running-shell-command-like-gitrsync/
PINTEREST
PINTEREST
INSTAGRAM

I have a remote repository which is Git. I want to connect to Git over ssh because there are problems with the firewall rules in our work environment. How can use ssh to connect remotely to Git with specifying ssh keys for this Git operations.

With ssh-agent

ssh-agent will create and temprorary environment where tkey is added with ssh-add command into the shell. After environment is completed git operations can be done where git will use current ssh keys to connect remotely with ssh tunnel. Keep in mind the keys will be lost after commands are completed

With Host Configuration

Another way to connect remote Git Repository over ssh is using ssh configuration files to specify IdentityFile like below

This will work too. When connecting to github.com specified IdentityFile will be used by ssh.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/specify-ssh-keys-running-shell-command-like-gitrsync/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  How To Convert DER To PEM and PEM to DER Certificate Format with OpenSSL?

Leave a Reply

Your email address will not be published.