Gitlab clone ssh not working (PTY ?)

Hey all!
I’m a little newbie using ssh connections and i’m having a little problem.

I 'm just trying to clone my gitlab repository by ssh and it’s not working.

My steps

Generate keys
ssh-keygen -t ed25519 -C "my@mail.com"

Add it to system
ssh-add /home/centos/.ssh/id_ed25519

Identity added!
So i take the public key and i added it into Gitlab under “Top Right Menu -> Settings -> SSH Keys”

Then i try to clone my repo from my server (develop branch):
sudo git clone ssh://git@gitlab.com/mygroup/com.myrepo.dot.git . -b develop

And i get this:`

    Cloning into '.'...
    Permission denied (publickey).
    fatal: Could not read from remote repository.

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

So i tried:

ssh git@gitlab.com

and i get :

PTY allocation request failed on channel 0
Welcome to GitLab, @Username!
Connection to gitlab.com closed.

I think my error is this: “PTY allocation request failed on channel 0” but no idea how to resolve it. I googled it but i cant understant :laughing:

And i tried the same command too with -vT params:

ssh -vT git@gitlab.com

And i get:

OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to gitlab.com [35.231.145.151] port 22.
debug1: Connection established.
debug1: identity file /home/centos/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/centos/.ssh/id_ed25519 type 4
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.8
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.8 pat OpenSSH* compat 0x04000000
debug1: Authenticating to gitlab.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw
debug1: Host 'gitlab.com' is known and matches the ECDSA host key.
debug1: Found key in /home/centos/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/centos/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/centos/.ssh/id_dsa
debug1: Trying private key: /home/centos/.ssh/id_ecdsa
debug1: Offering ED25519 public key: /home/centos/.ssh/id_ed25519
debug1: Server accepts key: pkalg ssh-ed25519 blen 51

OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to gitlab.com [35.231.145.151] port 22.
debug1: Connection established.
debug1: identity file /home/centos/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/centos/.ssh/id_ed25519 type 4
debug1: key_load_public: No such file or directory
debug1: identity file /home/centos/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.8
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.8 pat OpenSSH* compat 0x04000000
debug1: Authenticating to gitlab.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw
debug1: Host 'gitlab.com' is known and matches the ECDSA host key.
debug1: Found key in /home/centos/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/centos/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/centos/.ssh/id_dsa
debug1: Trying private key: /home/centos/.ssh/id_ecdsa
debug1: Offering ED25519 public key: /home/centos/.ssh/id_ed25519
debug1: Server accepts key: pkalg ssh-ed25519 blen 51
Enter passphrase for key '/home/centos/.ssh/id_ed25519':
debug1: Authentication succeeded (publickey).
Authenticated to gitlab.com ([35.231.145.151]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: PTY allocation disabled.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: PTY allocation disabled.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Welcome to GitLab, @Username!
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2540, received 3100 bytes, in 0.4 seconds
Bytes per second: sent 6104.3, received 7450.1
debug1: Exit status 0

If someone have an idea how to resolve it… Thank you very much! :blush:

Could someone solve the problem? I have exactly the same problem.