git ssh ask for a password with gitlab
I have recently installed on my Ubuntu dedicated a Gitlab server.
Webapp is working fine, I had no trouble during the installation (tested on VM before production environment)
- TeamCity Git VCS SSH connection with Custom Private Key throws JschException: Auth fail
- Git can pull fine but not push “could not read username”
- Key is already in use when trying to add SSH Key to Github
- Netbeans, git, cant clone repository
- Could not create directory '/home/username/.ssh'
- Git SSH keeps asking for password when cloning
I have uploded my ssh rsa private key from the web app on my account, and created a project, clone from another repository.
From my desktop environment, I have tried to git pull using ssh.
First login, I had to accept the ssh fingerprint, then, until now server keep asking me to log in as git user, which has no password.
D:/drive/project> git pull firstname.lastname@example.org:me/project.git email@example.com's password: Connection closed by 0.0.0.0 fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. D:\skydrive\artmoser>git pull firstname.lastname@example.org's password: [tried to type something] Permission denied, please try again. email@example.com's password: Permission denied, please try again. firstname.lastname@example.org's password: ^C
My ssh public and private key under windows is in C:\Users\Jack Bauer.ssh
On the dedicated server I can see my key in /home/git/.ssh/authorized_keys
I have checked my chmod for user git :
drwx--x--x 7 git git 4096 mai 31 05:06 git/ drwx------ 2 git git 4096 juin 1 03:27 git/.ssh/ -rw------- 1 git git 508 juin 1 02:53 git/.ssh/authorized_keys
What am i doing wrong ?
After more research :
If I log in with git user with putty, I receive this error message
server refused to allocate pty
If I try to do
ssh email@example.com, they ask for my passphrase, 3 times before git user password (which has none)
If I do a ssh tunnel with
ssh firstname.lastname@example.org -Tvvv , i get this errror at the end of the log
debug1: Next authentication method: publickey debug1: Trying private key: /home/me/.ssh/id_rsa debug1: key_parse_private2: missing begin marker debug1: key_parse_private_pem: PEM_read_PrivateKey failed debug1: read PEM private key done: type <unknown> Enter passphrase for key '/home/me/.ssh/id_rsa':
One Solution collect form web for “git ssh ask for a password with gitlab”
the public key is on my computer, the private is on the server,
If you want to access a server with ssh, your client (here your Windows workstation) must have at least the private keys (and it is a good practice to keep the public keys together with their private keys counterparts).
C:\Users\Jack Bauer\.ssh\id_rsa.pub C:\Users\Jack Bauer\.ssh\id_rsa
If your keys don’t follow this default naming convention, you will need a
C:\Users\Jack Bauer\.ssh\config file (as illustrated there)
Make sure you have the
HOME environment variable set to
C:\Users\Jack Bauer in your Windows shell when you are typing those command: that is the case if you launch the
git-cmd.exe (which comes with any Git For Windows distribution)