How to Access Git Repository via SSH,gitssh
How to Access Git Repository via SSH,gitssh
Example
Condition
There is a connection between ssh client and ssh server;
ssh testuser@testsshd.example.net
Config
Create a config in ~/.ssh/
cd ~
cd .ssh
vim config
... ...
cat config
Contents of ~/.ssh/config
Host testsshd
HostName testsshd.exmple.net
User testuser
IdentityFile ~/.ssh/keys/testuser.private.rsakey
Host OtherAlias
HostName other.example.net
User otheruser
IdentityFile ~/.ssh/keys/otheruser.private.rsakey
remeber to chmod rsakey less access:
chomd 600 ~/.ssh/keys/testuser.private.rsakey
Test Connection via config
ssh -v testsshd
... balabala ...
<Connection OK>
Git Clone via SSH
git clone ssh://testsshd/~/website.git
Syntax
- git clone [protocol]://[alias]/[path]
评论暂时关闭