Can you connect before or is-it your first attempt?
You can test with ssh directly : ssh --vvvT <your gitlab url>
While trying to connect to gitlab I get this error meesage:
ACER@DAVY MINGW64 /e/xampp76/htdocs/Fashionblinds/Fashionblinds (master) $ git push origin master The authenticity of host 'gitlab.com (172.65.251.78)' can't be established. ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xAAEEiXFzSnUw. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'gitlab.com,172.65.251.78' (ECDSA) to the list of known hosts. ssh_dispatch_run_fatal: Connection to 172.65.251.78 port 22: Broken pipe fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
What should I do ?
ref: https://forum.gitlab.com/t/the-authenticity-of-host-gitlab-com-54-93-71-23-cant-be-established/916/2
I thought my Windows Credential Password to Gitlab is already correct!
Can you connect before or is-it your first attempt?
You can test with ssh directly : ssh --vvvT <your gitlab url>
To this particular gitlab project is the first time. I have used gitlab before for other projects.
ACER@DAVY MINGW64 /e/xampp76/htdocs/Fashionblinds/Fashionblinds/public (master)
$ ssh -Tvvv [email protected]:davy_yg/fashionblind.git
OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolve_addr: could not resolve name gitlab.com:davy_yg/fashionblind.git as address: Name or service not known
debug1: resolve_canonicalize: hostname gitlab.com:davy_yg/fashionblind.git is an unrecognised address
debug2: resolving "gitlab.com:davy_yg/fashionblind.git" port 22
ssh: Could not resolve hostname gitlab.com:davy_yg/fashionblind.git: Name or service not known
This is what I got how to troubleshoot the error message ?
See I cannot find .gitconfig or .config/git/config file
I can only found .git folder in my laravel folder that I would like to push to the server.
It seems there is an error in the gtilab doc, you have to test with
ssh -T [email protected]
it returns for me : Welcome to GitLab, @sr57!
If works by finding key in your .ssh directory, key that you must have put in gitlab before.
If it does not work for you, share the returns of the command :
ssh -vvvT [email protected]
ACER@DAVY MINGW64 /e/xampp76/htdocs/Fashionblinds/Fashionblinds (master)
$ ssh -T [email protected]:davy_yg/fashionblind.git
ssh: Could not resolve hostname gitlab.com:davy_yg/fashionblind.git: Name or service not known
ACER@DAVY MINGW64 /e/xampp76/htdocs/Fashionblinds/Fashionblinds (master)
$ ssh -vvvT [email protected]:davy_yg/fashionblind.git
OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolve_addr: could not resolve name gitlab.com:davy_yg/fashionblind.git as address: Name or service not known
debug1: resolve_canonicalize: hostname gitlab.com:davy_yg/fashionblind.git is an unrecognised address
debug2: resolving "gitlab.com:davy_yg/fashionblind.git" port 22
ssh: Could not resolve hostname gitlab.com:davy_yg/fashionblind.git: Name or service not known
I get an error for both. I copy the link: Clone for SSH in gitlab.
Change the [remote "origin"] url value in .gitconfig or .config/git/config file
Where is the .gitconfig and .config/git/config file ?
HI @davy_yg
Communication is always a difficult art, just enter the commands
ssh -T [email protected]
ssh -vvvT [email protected]
remove the end :davy_yg/fashionblind.git it's not a valid address as the error tells you.
ACER@DAVY MINGW64 /e/xampp76/htdocs/Fashionblinds/Fashionblinds (master)
$ ssh -T [email protected]
[email protected]: Permission denied (publickey,keyboard-interactive).
ACER@DAVY MINGW64 /e/xampp76/htdocs/Fashionblinds/Fashionblinds (master)
$ ssh -vvvT [email protected]
OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "gitlab.com" port 22
debug2: ssh_connect_direct
debug1: Connecting to gitlab.com [172.65.251.78] port 22.
debug1: Connection established.
debug1: identity file /c/Users/ACER/.ssh/id_rsa type -1
debug1: identity file /c/Users/ACER/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/ACER/.ssh/id_dsa type -1
debug1: identity file /c/Users/ACER/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/ACER/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/ACER/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/ACER/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/ACER/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/ACER/.ssh/id_xmss type -1
debug1: identity file /c/Users/ACER/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.9p1 Debian-10+deb10u2
debug1: match: OpenSSH_7.9p1 Debian-10+deb10u2 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to gitlab.com:22 as 'git'
debug3: hostkeys_foreach: reading file "/c/Users/ACER/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /c/Users/ACER/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from gitlab.com
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2- nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: [email protected],ecdsa-sha2-nistp384- [email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],ssh- ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,3des-cbc,aes256-cbc,aes192-cbc
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,3des-cbc,aes256-cbc,aes192-cbc
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw
debug3: hostkeys_foreach: reading file "/c/Users/ACER/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /c/Users/ACER/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from gitlab.com
debug3: hostkeys_foreach: reading file "/c/Users/ACER/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /c/Users/ACER/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from 172.65.251.78
debug1: Host 'gitlab.com' is known and matches the ECDSA host key.
debug1: Found key in /c/Users/ACER/.ssh/known_hosts:1
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /c/Users/ACER/.ssh/id_rsa
debug1: Will attempt key: /c/Users/ACER/.ssh/id_dsa
debug1: Will attempt key: /c/Users/ACER/.ssh/id_ecdsa
debug1: Will attempt key: /c/Users/ACER/.ssh/id_ed25519
debug1: Will attempt key: /c/Users/ACER/.ssh/id_xmss
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,keyboard-interactive
debug3: start over, passed a different list publickey,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/ACER/.ssh/id_rsa
debug3: no such identity: /c/Users/ACER/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /c/Users/ACER/.ssh/id_dsa
debug3: no such identity: /c/Users/ACER/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /c/Users/ACER/.ssh/id_ecdsa
debug3: no such identity: /c/Users/ACER/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /c/Users/ACER/.ssh/id_ed25519
debug3: no such identity: /c/Users/ACER/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: /c/Users/ACER/.ssh/id_xmss
debug3: no such identity: /c/Users/ACER/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug3: send packet: type 50
debug2: we sent a keyboard-interactive packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,keyboard-interactive
debug3: userauth_kbdint: disable: no info_req_seen
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey,keyboard-interactive).
This is what I got. What does it means ?
Have a look to these messages : Trying private key
ssh does not find your key (not created, deleted, in another directory).
If you don't know* where your key is, the easiest way is to rereate one ( for instance : ssh-keygen -t rsa -b 2048 ) and then copy the pubic key in Gitlab. Follow the doc https://docs.gitlab.com/ee/ssh/
*No pb if you had not use these key for another usage,, if not, you lost other connection(s) and worse if for any reason you publish somewhere your private key.
This is what I typed:
ACER@DAVY MINGW64 /e/xampp76/htdocs/Fashionblinds/Fashionblinds (master)
$ ssh-keygen -o -f ~/.ssh/id_rsa
Generating public/private rsa key pair.
/c/Users/ACER/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/ACER/.ssh/id_rsa.
Your public key has been saved in /c/Users/ACER/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:/EkUMXHSIhBe8QB9poGc9tPog896FuknI/BOBMAizLo ACER@DAVY
The key's randomart image is:
+---[RSA 3072]----+
|o.. .+B+.*+. |
|oo.. .=.+o+=. |
|o. .... Oo. |
|. . .=.. |
| . .oSo. |
|E ... =o . |
| o.+ oo |
| .o O . |
| .o= + |
+----[SHA256]-----+
When I try to add the key there is this questions:
Oops, are you sure?
Publicly visible private SSH keys can compromise your system.
[Yes, add it ]
Also there is this old key:
rsa-key-20191124
cb:09:62:66:76:58:35:b6:75:64:53:q7:8f:9f:fa:c6
Created2 years ago
Last used: Never Expires: Never
(I already changed the key for security purposes)
The form contains the following errors:
Key is invalid
Fingerprint has already been taken
Fingerprint cannot be generated
Key type is forbidden. Must be RSA, ECDSA, or ED25519
This error appears when I tried to save it.
I am able to add rsa key to gitlab:
What don't you understand in my answer, following the doc, to put a key in gitlab is just a copy/paste of your key!
Do you really think your answer is the best?
I have copy and paste the key repeatedly but copy and paste the wrong key. Until I found the video then I found the solution.
Please or to participate in this conversation.