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將知道使用哪個用戶,主機名和確切的完整路徑。