ssh git comandos autenticando com authorized_keys

1

Eu tenho um servidor de nuvem amazon ec2 executando o Ubuntu 12.04.3 LTS (GNU / Linux 3.2.0-52-virtual x86_64). Eu tenho o gitlab instalado usando a imagem bitnami. A clonagem de repos SSH não funciona.

Eu não consigo logar como git over ssh com a tecla ssh

    ➜  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: 

Eu posso fazer login usando o ssh como um usuário diferente que criei.

    ➜  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/ ***

O que posso tentar corrigir este problema?

    
por Billy Moon 14.11.2013 / 12:07

1 resposta

1

As instalações de SSH podem ser suprimidas adicionando opções ao início de uma chave em authorization_keys . O que está acontecendo aqui é que o servidor está impedindo que o usuário git tenha acesso completo / aberto ao servidor com essa chave específica, mas apenas permite uma conexão muito segmentada ... que é o que você normalmente deseja.

Se você quiser se conectar como usuário, remova o preâmbulo antes de ssh-rsa , embora esteja tudo lá por um bom motivo. Você ainda pode se conectar como outro usuário e su git quando estiver no servidor ... se for importante ser esse usuário por algum motivo.

As opções significam:

command="/opt/bitnami/apps/gitlab/gitlab-shell/bin/gitlab-shell key-3"

Significa que este comando é executado sempre que a conexão é feita. O comando No pode ser fornecido pelo usuário.

no-port-forwarding

Impede o encaminhamento de TCP

no-X11-forwarding

Impede o encaminhamento do X11

no-agent-forwarding

Impede o encaminhamento de agentes

no-pty

Impede a alocação de TTY - o que você provavelmente usa principalmente em ssh para executar comandos no servidor remoto.

Que podem ser encontrados na página do manual ssh (8)

    
por 14.11.2013 / 16:47