我在我的窗户上安装了Cygwin终端。我尝试使用命令:
克隆我们在linux服务器上的git存储库$ git clone ssh://some.server.com/somename
Cloning into 'somename'...
ituser3@some.server.com's password:
我知道服务器中有SSL证书。
如何在没有密码的情况下连接?如何考虑服务器上的证书?
答案 0 :(得分:1)
首先以用户a身份登录A并生成一对身份验证密钥。不要输入密码:
a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A
现在使用ssh在B上创建一个目录〜/ .ssh作为用户b。(该目录可能已经存在,这很好):
a@A:~> ssh b@B mkdir -p .ssh
b@B's password:
最后将一个新的公钥附加到b @ B:.ssh / authorized_keys并最后一次输入b的密码:
a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password:
从现在开始,您可以从A登录B作为b,无密码:
a@A:~> ssh b@B hostname
B