ssh -vvv [email protected]
返回什么?
只要这个SSH请求不起作用,没有git的操作将与[email protected]
服务器工作。
如果ssh的报告,它是确实试图提供公钥,则必须仔细检查它已正确添加到回购服务器上的~git/.ssh/authorized_keys
文件。
这里是例子SSH会话中的提取物的工作原理:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /p/.ssh/mypubkey
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug2: input_userauth_pk_ok: fp f8:d9:7...:cf
debug3: sign_and_send_pubkey
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Entering interactive session.
两点意见:
- 我
%HOME%
引用不%HOMEDIR%
而是一个自定义驱动器(p:\
),这是一个本地公约在工作中,可能不适用于你。
- 我的公/私钥的名称不遵循默认的标准(
id_rsa.pub
/id_rsa
)
我加了config
文件中%HOME%\.ssh
目录,以名称,明确了公共密钥文件:
host gitrepo
user git
hostname repo
identityfile ~/.ssh/mypubkey
这样,我可以简单地键入:ssh gitrepo
,而ssh将知道使用哪个用户,主机名和确切的完整路径。