簡體   English   中英

使用git和tortoisegit在Windows XP上驗證失敗

[英]Auth fails on Windows XP with git and tortoisegit

我的身份驗證失敗了。 我已經創建了我的SSH密鑰,並且公鑰已由本地git管理員導入,但仍然會提示我輸入密碼:

git.exe clone  --progress -v  "git@repo:project.git" "C:\web\project"  
Cloning into C:\web\project...  
git@repo's password:  
fatal: The remote end hung up unexpectedly
  • 我的SSH密鑰是無密碼的,住在“ C:\\Documents and Settings\\username\\.ssh ”下,我還將它們復制到“ C:\\Documents and Settings\\username\\ssh ”(沒有前面的點),只是為了好的措施。
  • 在Windows環境變量屏幕中, HOME系統var設置為我的用戶的正確目錄。

什么ssh -vvv git@repo返回?

只要這個ssh請求不起作用, git@repo服務器就不會使用git操作。
如果ssh報告它確實嘗試提供publickey,那么你必須仔細檢查它是否已正確添加到repo服務器上的~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

我在%HOME%\\.ssh目錄中添加了一個config文件,以便明確命名公鑰文件:

host gitrepo
     user git
     hostname repo
     identityfile ~/.ssh/mypubkey

這樣,我可以簡單地輸入: ssh gitrepo ,ssh將知道要使用的公鑰的用戶,主機名和確切完整路徑。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM