简体   繁体   English

ssh -T git@gtihub.com 命令在我的 Ubuntu20.04 上不显示密码

[英]ssh -T git@gtihub.com command does not show passphrase on my Ubuntu20.04

On Ubuntu 20.04, I tried cloning GitHub repository.(git clone (ssh url))在 Ubuntu 20.04 上,我尝试克隆 GitHub 存储库。(git clone(ssh url))

git clone git@github.com:scikit-learn/scikit-learn.git git 克隆 git@github.com:scikit-learn/scikit-learn.git

But "git clone" command does not work.但是“git clone”命令不起作用。 When I git clone repository (ssh), terminal does not ask passphrase of ssh.当我 git 克隆存储库 (ssh) 时,终端不会询问 ssh 的密码。

I thought that ssh does not work on my PC, so I tried ssh -T git@github.com.我以为 ssh 在我的 PC 上不起作用,所以我尝试了 ssh -T git@github.com。 It did not work.那没起效。

When I tried ssh git@github.com, terminal did not ask passphrase, but it did work.当我尝试 ssh git@github.com 时,终端没有询问密码,但它确实有效。

What is the problem with my git and ssh?我的 git 和 ssh 有什么问题?

If you are using a private key protected by a passphrase, then, as described here , make sure it is added to the agent first:如果您使用受密码保护的私钥,那么, 如此处所述,请确保首先将其添加到代理中:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

Then you can test it with ssh -T git@github.com, provided you have registered the public key forst to your GitHub account SSH section . Then you can test it with ssh -T git@github.com, provided you have registered the public key forst to your GitHub account SSH section .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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