簡體   English   中英

在Mac OSx上設置SSH

[英]Setting up ssh on mac OSx

我正在嘗試在本地Mac機器上設置git服務器。 我按照鏈接中提到的步驟進行操作。

但是以某種方式,即使我能夠ping通計算機,當我嘗試使用ssh git@ip_address.com連接到計算機時,也會出現錯誤-“權限被拒絕(公共密鑰)”

找不到此錯誤的答案。 如果有人遇到問題並有解決方案,請告訴我。 提前致謝。

我的命令行數據:

Kaustubhs-Pro:~ kaustubh$ ssh git@192.168.43.115 -v
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to 192.168.43.115 [192.168.43.115] port 22.
debug1: Connection established.
debug1: identity file /Users/kaustubh/.ssh/id_rsa type 1
debug1: identity file /Users/kaustubh/.ssh/id_rsa-cert type -1
debug1: identity file /Users/kaustubh/.ssh/id_dsa type -1
debug1: identity file /Users/kaustubh/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com 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 
b2:59:8a:cc:f8:1a:76:8f:2a:6f:f5:a1:2b:f1:ff:10
debug1: Host '192.168.43.115' is known and matches the RSA host key.
debug1: Found key in /Users/kaustubh/.ssh/known_hosts:3
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: /Users/kaustubh/.ssh/my_git_key
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /Users/kaustubh/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/kaustubh/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).

您的實際用戶kaustubh中沒有可用於SSH身份驗證的有效密鑰。 因此,將您的公共密鑰添加到您的GIT用戶的authorized_keys中。

所以你可以使用

ssh-copy-id git@192.168.43.115

要將您的實際公鑰添加到git授權密鑰中。 您必須首次使用用戶名和密碼登錄。

暫無
暫無

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

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