菜鸟教程小白 发表于 2022-12-12 17:28:43

ios - OS X Server + GIT 与 SSH 集成失败并出现权限被拒绝错误


                                            <p><p>我将 GIT 服务器托管在单独的 Linux 服务器上。我有 SSH RSAkey <strong>没有密码</strong>。</p>

<p>我能够使用 Xcode 连接到 GIT 服务器,并且通过 Xcode 5.0.2 在源代码管理中的所有操作都正常工作。</p>

<p>我在本地机器上安装了 OS X Server。
以下是我的 OS X Server 设置配置:</p>

<ol>
<li>将远程存储库添加为:ssh://[email protected]:22/iphone_project</li>
<li>我已确保我的公共(public)在 OS X Server for SSH 中是正确的。我已将 SSH pubkey 从/.ssh/id_rsa.pub 复制粘贴到 OS X Server。</li>
</ol>

<p>.</p>

<pre><code>Cloning into &#39;ssh_XXXX_XXXX_XXX_com_22_mtp_iphone&#39;...
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 XXXXXX.XXXXXX.com port 22.
debug1: Connection established.
Could not create directory &#39;/var/teamsserver/.ssh&#39;.
debug1: identity file /Library/Server/Xcode/Data/BotRuns/BotRun-92b17427-aac4-40fa-92fa-5c73384b7d0f.bundle/credentials/b5964671-8db0-482c-93ee-870a0243295d/id_rsa type 1
debug1: identity file /Library/Server/Xcode/Data/BotRuns/BotRun-92b17427-aac4-40fa-92fa-5c73384b7d0f.bundle/credentials/b5964671-8db0-482c-93ee-870a0243295d/id_rsa-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_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server-&gt;client aes128-ctr hmac-md5 none
debug1: kex: client-&gt;server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024&lt;1024&lt;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 26:70:37:3a:56:bd:17:bd:9d:6a:14:c0:21:23:65:1c
debug1: Host &#39;XXXXXX.XXXX.com&#39; is known and matches the RSA host key.
debug1: Found key in /Library/Server/Xcode/Config/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,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1:Miscellaneous failure (see text)
No credentials cache file found

debug1:An invalid name was supplied
unknown mech-code 0 for mech 1 2 752 43 14 2

debug1:Miscellaneous failure (see text)
unknown mech-code 0 for mech 1 3 6 1 5 5 14

debug1:Miscellaneous failure (see text)
unknown mech-code 2 for mech 1 3 6 1 4 1 311 2 2 10

debug1:An unsupported mechanism was requested
unknown mech-code 0 for mech 1 3 5 1 5 2 7

debug1:Miscellaneous failure (see text)
unknown mech-code 0 for mech 1 3 6 1 5 2 5

debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Library/Server/Xcode/Data/BotRuns/BotRun-92b17427-aac4-40fa-92fa-5c73384b7d0f.bundle/credentials/b5964671-8db0-482c-93ee-870a0243295d/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: password
debug1: read_passphrase: can&#39;t open /dev/tty: Device not configured
debug1: permanently_drop_suid: 94
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can&#39;t open /dev/tty: Device not configured
debug1: permanently_drop_suid: 94
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can&#39;t open /dev/tty: Device not configured
debug1: permanently_drop_suid: 94
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.



SSH Known Hosts file path is located at /Library/Server/Xcode/Config/ssh_known_hosts
SSH strict host checking is disabled (you can enable this by editing the SSHStrictHostKeyChecking key in /Library/Server/Xcode/Config/xcsbuildd.plist
Untrusted HTTPS certificates is disabled (you can enable this by editing the TrustSelfSignedSSLCertificates key in /Library/Server/Xcode/Config/xcsbuildd.plist
</code></pre>

<p>我的问题是:为什么在所有配置设置后我的身份验证仍然失败?</p>

<p>在设置 GIT 或 OS X SERVER 时有什么遗漏吗?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>确保执行 ssh 命令的确切帐户:</p>

<p>它的<code>$HOME/.ssh</code>必须有<code>id_rsa.pub</code>、<em>和</em><code>id_rsa</code>(public<em>和</em>私钥)。</p>

<p>确保<code>.ssh</code>文件夹及其文件的权限正确,如“<a href="https://stackoverflow.com/a/13428529/6309" rel="noreferrer noopener nofollow">Git SSH authentication</a>”中所述。<br/>
使用 EGit,这些文件夹在“<a href="http://wiki.eclipse.org/EGit/User_Guide#Eclipse_SSH_Configuration" rel="noreferrer noopener nofollow">Eclipse SSH Configuration</a> ”中被引用和声明:</p>

<p> <img src="/image/kgbu1.png" alt="enter image description here"/> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - OS X Server &#43; GIT 与 SSH 集成失败并出现权限被拒绝错误,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/20674602/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/20674602/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - OS X Server &#43; GIT 与 SSH 集成失败并出现权限被拒绝错误