Information Technology Reference
In-Depth Information
SSH configuration
If you want to use git with SSH protocol you will need a basic knowledge of how to
configure your SSH client. The reason is very simple: the git command doesn't know
how to parse SSH options. Therefore you cannot pass SSH options to the git command,
as such as this:
$ git clone --ssh-option ssh://user@host
When you run a command such as:
$ git clone ssh://git@localhost/home/git/lorem.git
git uses your default SSH configuration. And if you want to use a specific SSH option,
such as --ssh-option , you have to apply it to your default configuration.
Hint Some options, such as a port number, can be handled by the $ git command.
You don't need an option for this because the port number can be embedded in the URL:
$ git clone ssh://user@host:2222
In general, there is no way to pass SSH options directly to the git command.
The most typical SSH option you will need is the name of the file with your private
key. You can pass it to the ssh client as in the following:
$ ssh -i /some/path/my-private-key.rsa_id user@host
But git command doesn't accept it. The following solution will not work:
$ git clone -i /some/path/my-private-key.rsa_id
ssh://user@host
The configuration of SSH is stored in the /.ssh/config file. If this file doesn't
exist, then all the options come from the system configuration file named /etc/ssh/
ssh_config . Your default keys are named /.ssh/id_rsa and /.ssh/
id_rsa.pub .
Search WWH ::




Custom Search