2015-09-05 55 views
-1

最近,我改變了我的託管公司,因爲它我有一個新的用戶名如何在服務器上使用git - 修復conq用戶名

nickwebd

我有這個用戶名一到位桶帳戶

nickimola

白衣新浩蜇公司,我已經設置了:

  • SSH
  • 公鑰
  • 作出的git隨處可使用以下命令:alias git="/usr/local/cpanel/3rdparty/bin/git"

現在,當我嘗試克隆一個存儲庫,它說

訪問被拒絕(公鑰)

,如果我跑ssh -v [email protected]這是完整的日誌:

OpenSSH_6.1p1, OpenSSL 1.0.0-fips 29 Mar 2010 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 50: Applying options for * 
debug1: Connecting to bitbucket.org [131.103.20.167] port 22. 
debug1: Connection established. 
debug1: identity file /home/nickwebd/.ssh/id_rsa type 1 
debug1: identity file /home/nickwebd/.ssh/id_rsa-cert type -1 
debug1: identity file /home/nickwebd/.ssh/id_dsa type -1 
debug1: identity file /home/nickwebd/.ssh/id_dsa-cert type -1 
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3 
debug1: match: OpenSSH_5.3 pat OpenSSH_5* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_6.1 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug1: kex: server->client aes128-ctr hmac-md5 none 
debug1: kex: client->server aes128-ctr hmac-md5 none 
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP 
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY 
debug1: Server host key: RSA 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40 
debug1: Host 'bitbucket.org' is known and matches the RSA host key. 
debug1: Found key in /home/nickwebd/.ssh/known_hosts:1 
debug1: ssh_rsa_verify: signature correct 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug1: SSH2_MSG_NEWKEYS received 
debug1: Roaming not allowed by server 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug1: Authentications that can continue: publickey 
debug1: Next authentication method: publickey 
debug1: Offering RSA public key: /home/nickwebd/.ssh/id_rsa 
debug1: Remote: Forced command: conq username:nickimola 
debug1: Remote: Port forwarding disabled. 
debug1: Remote: X11 forwarding disabled. 
debug1: Remote: Agent forwarding disabled. 
debug1: Remote: Pty allocation disabled. 
debug1: Server accepts key: pkalg ssh-rsa blen 279 
debug1: Trying private key: /home/nickwebd/.ssh/id_dsa 
debug1: No more authentication methods to try. 
Permission denied (publickey). 
[email protected] [~]# debug2: client_check_window_change: changed 
debug2: channel 0: request window-change confirm 0 
debug2: client_check_window_change: changed 
debug2: channel 0: request window-change confirm 0 

現在,託管公司支持這樣說:

該日誌顯示你正在整修用nickimola

如果你可以使用你的cPanel密碼重新測試nickwebd,這將 然後工作正常。

問題是:我對這種設置是全新的,因爲這是我第一次。 我應該在哪裏以及如何更改用戶名?是否有可能讓我的bitbucket帳戶保持原樣(這樣我就不必更改源代碼樹和我的本地回購了),但是將它用於新的帳戶?

只是爲了說明,我使用的是Mac和服務器運行的cPanel(如果它在某些方面幫助) 而此外,當我試圖從我的本地機器上運行ssh -v [email protected],響應

以nickimola身份登錄。

您可以使用git或hg連接到Bitbucket。殼牌訪問是 已禁用。

請幫助我在這工作了幾天! 感謝

快速更新

我發現關鍵代理未運行,所以我就開始了,檢查了身份,沒有發現身份,所以嘗試添加它。努力因爲當我鍵入:

ssh-add ~/.ssh/id_rsa.pub 

它問我的密碼,但是當我嘗試將其粘貼(或甚至寫)它返回:

debug3:收到SSH2_MSG_IGNORE

我不能正確添加密碼。

+0

我不知道到位桶,但在GitHub上是要求你在連接之前'git配置user.name'和'git configure user.email'。 – CollinD

+0

你能告訴我怎麼樣?來自哪裏? – Nick

+0

對不起,我可以只是谷歌它是公平:) – Nick

回答

1

此處列出的「conq用戶名」是與您正在使用的SSH密鑰關聯的Bitbucket帳戶。 Bitbucket已經將您的SSH密鑰識別爲您的Bitbucket帳戶(nickimola)上的一個,因此您的連接大部分都是成功的。您的託管服務提供商的支持團隊在這裏的幫助不大,因爲託管服務提供商帳戶名稱與您的Bitbucket帳戶名稱沒有任何連接。

此外,ssh代理需要添加私鑰,而不是公鑰。您需要的命令是

ssh-add ~/.ssh/id_rsa 

一旦您添加了私鑰,請再次嘗試「ssh -v [email protected]」。 (該命令僅適用於調試,順便說一句,與使用「git」而不是「hg」相同的結果)。如果您已將「nickwebd」帳戶的公鑰與您的Bitbucket用戶名相關聯,那麼您應該在您的託管服務提供商的系統上獲得與您自己系統上的測試相同的結果。

順便說一句,如果託管服務提供商的系統將只從到位桶拔提交,那麼你應該考慮設置該密鑰作爲部署的關鍵:https://confluence.atlassian.com/display/BITBUCKET/Use+deployment+keys

+0

謝謝吉姆,我會嘗試你今晚的想法,我會讓你知道。 – Nick

+0

非常感謝你!我終於設法克隆我需要的回購。再次感謝您的回答。 – Nick

+0

很高興能幫到你! –

相關問題