我有一个运行Ubuntu 12.04.3 LTS的亚马逊ec2云服务器(GNU / Linux 3.2.0-52-virtual x86_64)。 我有安装使用bitnami图像的gitlab。 回购的SSH克隆不起作用。
我无法通过SSH密码sshlogin
➜ front-end git:(develop) ssh -vT [email protected] 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 cloud.redrockrim.org [54.229.74.10] port 22. debug1: Connection established. debug1: identity file /Users/redrockrim/.ssh/id_rsa type 1 debug1: identity file /Users/redrockrim/.ssh/id_rsa-cert type -1 debug1: identity file /Users/redrockrim/.ssh/id_dsa type -1 debug1: identity file /Users/redrockrim/.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_5.9p1 Debian-5ubuntu1.1 debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH_5* 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 54:52:a4:7c:bf:45:bc:89:b5:7f:ae:59:2d:d6:e2:11 debug1: Host 'cloud.redrockrim.org' is known and matches the RSA host key. debug1: Found key in /Users/redrockrim/.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,password debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/redrockrim/.ssh/id_rsa debug1: Authentications that can continue: publickey,password debug1: Trying private key: /Users/redrockrim/.ssh/id_dsa debug1: Next authentication method: password [email protected]'s password:
我可以使用ssh作为我创build的不同用户login。
➜ front-end git:(develop) ssh -vT [email protected] 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 cloud.redrockrim.org [54.229.74.10] port 22. debug1: Connection established. debug1: identity file /Users/redrockrim/.ssh/id_rsa type 1 debug1: identity file /Users/redrockrim/.ssh/id_rsa-cert type -1 debug1: identity file /Users/redrockrim/.ssh/id_dsa type -1 debug1: identity file /Users/redrockrim/.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_5.9p1 Debian-5ubuntu1.1 debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH_5* 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 54:52:a4:7c:bf:45:bc:89:b5:7f:ae:59:2d:d6:e2:11 debug1: Host 'cloud.redrockrim.org' is known and matches the RSA host key. debug1: Found key in /Users/redrockrim/.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,password debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/redrockrim/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 277 debug1: read PEM private key done: type RSA debug1: Authentication succeeded (publickey). Authenticated to cloud.redrockrim.org ([54.229.74.10]:22). debug1: channel 0: new [client-session] debug1: Requesting [email protected] debug1: Entering interactive session. debug1: Sending environment. debug1: Sending env LANG = en_IE.UTF-8 debug1: Sending env LC_CTYPE = en_IE.UTF-8 Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.2.0-52-virtual x86_64) ___ _ _ _ _ _ | _ |_) |_| \| |__ _ _ __ (_) | _ \ | _| .` / _` | ' \| | |___/_|\__|_|\_\__,_|_|_|_|_| *** Welcome to the BitNami GitLab 6.0.0-0 *** *** BitNami Wiki: http://wiki.bitnami.com/ *** *** BitNami Forums: http://community.bitnami.com/ ***
我可以尝试解决这个问题?
可以通过将选项添加到authorization_keys中的密钥的开头来禁止SSH设施。 这里发生的事情是服务器阻止你的git用户使用该特定的密钥完成/打开服务器的访问,而只允许一个非常有针对性的连接…这是你通常想要的。
如果你想以该用户的身份连接,你可以在ssh-rsa之前删除前导码,尽pipe这是所有的原因。 你仍然可以作为另一个用户连接,并且一旦你在服务器上就结束了,如果出于某种原因成为那个用户是非常重要的。
选项意味着:
command="/opt/bitnami/apps/gitlab/gitlab-shell/bin/gitlab-shell key-3"
意味着这个命令在连接build立的时候被执行。 没有命令可以由用户提供。
no-port-forwarding
阻止TCP转发
no-X11-forwarding
阻止X11转发
no-agent-forwarding
防止代理转发
no-pty
阻止TTY分配 – 您可能主要在ssh中使用远程服务器上的命令。
这些都可以在ssh(8)手册页find