I set up a git server and want now to push initially my repo from the client.
I used git push origin master
and get this error message:
fatal: protocol error: bad line length character: Unab
I don't know what's wrong. I don't know what "Unab" is. I tried to resize the shell but it is still "Unab". I cannot find a solution for this error message.
I setup the server with "authorized_keys" and SSH. (I can connect to it, using SSH.)
It seems to be a git problem?
BTW: The server is set up in a Windows 7 VM
I had the same kind of problem after installing GIT on Windows. At first it worked; then, a day later (after a PC reboot), it didn't anymore, and I got this:
The problem was that after the reboot, the automatically started Putty "pageant.exe" didn't have the private key active anymore. When you add a key in pageant, it's not a persistent setting by default. I just had to add the key again, and it worked fine. So, for that case, it's necessary to make pagenant load the key automatically, as discussed here:
https://www.digitalocean.com/community/tutorials/how-to-use-pageant-to-streamline-ssh-key-authentication-with-putty
For me it was becuase I recently added
into .ssh/config
commenting this out allowed it to work
This might help someone. When I was trying to clone a project from an EC2 instance, I was getting the below error:
The resolution for me includes the below steps:
Use the EC2 SSH key ID for the public key for git clone. Example:
git clone ssh://{SSH Key ID}@someaccount.amazonaws.com/v1/repos/repo1
I faced the same issue after upgrading git to 2.19.0
Tools > Settings > Git Extensions > SSH
Select [OpenSSH] instead of [PuTTY]
You can redirect any output from
.bashrc
tostderr
:git will ignore this symbols
Git doesn't prompt for password and fails with similar cryptic message "fatal: protocol error: bad line length character: user" if you don't have your private key authentication setup as well.
https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server tells how to specify public key on the server. Basically add the public key to ~/.ssh/authorized_keys or ~/.ssh/authorized_keys2
I had to struggle a bit on how to provide private key to the Git Bash on the windows machine. Dan McClain's answer in https://serverfault.com/questions/194567/how-do-i-tell-git-for-windows-where-to-find-my-private-rsa-key/382801#382801 describes that. One addition to his answer, in my case the private key file was expected to be named id_rsa.pub