TortoiseGit asking for password on password-less login setup - putty

After months of uninterrupted password-less work, my TortoiseGit started to ask me for a password on some of my remotes, when pushing / pulling. I'm seeking a solution to fix this, as this can drive me crazy.
To underline: I want to remain on SSH-based password-less login, so any solutions that assume adding password to URL or permanently storing password in TortoiseGit configuration is not an option for me.
What I found out so far:
My problem is not related to GitHub; I don't use it in TortoiseGit and it happens on other remotes.
I do have SSH, not HTTPS, address as repo's URL and I don't have git clone-like stuff in it.
I can push/pull the same repository using Netbeans (and my Netbeans has Select Configured Git Repository Location option checked, so it uses the same remote configuration).
I can't push/pull remote using Git GUI, reason the same: asking for user password.
This is not related to a particular system or machine (SSH key), as it happens on both my work computer (32-bit Win 7) and home one (64-bit Win 7). Both of course uses different SSH key (see comment to this answer, which claims, that problem is related to 32-bit version of Windows; this is not true, it happens on 64-bit Windows as well).
Repository, this happens on, isn't empty -- I heard and even been personally affected, that sometimes TortoiseGit gets wako and asks for password on password-less login remote, until that remote is empty.
This is not related to a particular remote -- TortoiseGit works fine, without asking for password on some repositories (i.e. BitBucket) but "dies" asking for it on some other (i.e. in local dev network).
To make things even worse, there are certain remotes, on which TortoiseGit on my home computer fails, asking for password, while the very same remote accessed from home computer works just fine. And vice-versa. I set both machines for password-less login using the same steps; only SSH keys differs.
Things I did so far (and didn't solve the problem):
Changing SSH client (TortoiseGit -> Settings -> Network) to both Git\bin\ssh.exe (as suggested in here) and to C:\Program Files\PuTTy\plink.exe.
Using credential helper doesn't helped and I heard that it works for HTTPS only, not for SSL.
Downloading git-credential-wincred.exe and putting it to Git for Windows / msysgit folder didn't help as well; I've already had it there (different version / filesize; checked on both).
This issue is clearly bind to asking for user password, so git did not exit cleanly (exit code 128) error following it doesn't have any other source except missing password and most solutions given here, like crashed git, locked file, missing user e-mail are not solution for me.
OK, that's the farest point I've reached. And still nothing. Can anyone come up with something new, that I should try to solve this issue?

I confirm that "storing password" or _netrc file, or any credential helpers are for https url only, and have nothing to do with SSH.
The usual debugging ssh steps apply, starting by making sure that %HOME% is defined when TortoiseGit is launched, and %HOME%/.ssh exists, and contains the default keys id_rsa and id_rsa.pub.
In a git bash session, you can do a ssh -Tvvv yourRemoteServer to see what the debug error message sequence is, as explained here.
You also can check the result of a GIT_TRACE=2 git push test master, to see if the issue is limited to TortoiseGit and if the verbose output leaves any clue (see here).
Try switching ssh client between putty and openssh to see if TortoiseGit fairs better with one or the other.

The issue appeared yesterday and it took me 2-3 hours of trying all sorts of stuff to fix it. I also contacted server administrator, who claimed not to have done any changes in config in the past days. Hence I put bounty on this question. I also gave it a try today, but still negative. Finally, right now, I made another attempt just to copy the message to my friend, and, all of the sudden, all my repos started to work!
I am absolutely sure I didn't touch configs, it must have been some sort of timeout which took more than 16 hours. I have no idea what the problem was. All I can conclude is that waiting till the next day might help...

Related

GIT Client on Windows Complaining about Ownership

With great difficulty due to my limited knowledge of Linux, I set up a GIT server on my Raspberry Pi. It works great except for one thing that's been driving me nuts. I've used every Google fu move I can think of and I've gotten nowhere.
I'm using Git Extensions as the client on 3 Windows machines. One at work (no problems) and 2 at home. The local repository at home is on a shared NAS drive on my LAN. It works fine on my main computer, but when I try to access it on my secondary computer, I get the following error:
warning: '//NAS/REPOSITORY' is owned by:
'S-1-5-...'
but the current user is:
'S-1-5-...'
where 'S-1-5-...' is two different really long alphanumeric strings that mean nothing to me. It says warning, but then whenever I try to do anything I immediately I get errors I can't decipher after that like:
fatal: this operation must be run in a work tree
or
fatal: No names found, cannot describe anything.
I'm the only user, using the same windows account, username, email address, etc. configured in Git Extensions. As I understand it on the server end, the only user is git which I use for all machines.
As a workaround, I'm able to clone the repository to a different folder on my secondary computer and I have no problems with GIT, but I have problems with my code because it expects things to be in a certain directory. I can change that based on the user, but as far as my code knows, I am the same user on both machines (because I am!). So that is not a good solution. I want to be able to work in the same folder on my NAS no matter what computer I'm using.
-Is there a way to configure GIT or GIT Extensions (I'm not totally sure who is doing the complaining) to not care about ownership? I've tried cloning as a Public Repository, but I guess that doesn't mean what it seems to mean because I get the same errors.
-How do I know and/or configure what user GIT or GIT Extensions thinks I am?

How should I set up my repositories on Windows without SSH?

I have git running on Windows without a problem, but I'm ready to set up my live server, and I have the following issue. I don't have SSH or a work-around set up. Therefore, I can't simply create a bare repository on the server, push to it, and call it a day. Without SSH, there's no connecting to that directory (as far as I know).
Assuming that I will/cannot set up SSH, how would I go about configuring my repositories? I don't want to have to RDP onto my server to do a pull every time I have changes to commit.
Any suggestions or comments are welcome. Please note that I'm not looking to set up SSH. I'm looking for a way to configure my setup WITHOUT SSH. Thanks!
EDIT: my question is different from the other question because I am not looking for a way to set up SSH on windows.
The "easiest" option on Windows is to put your --bare repository on a file share of some sort. Permissions controlled by Windows, etc. You can also serve Git from IIS.
That said, for all but the most trivial use cases I would recommend a "real" Git server product.

XCode, Git and MediaTemple (gs)

I'm wondering if anyone's managed to connect to a self-hosted Git repository on a Mediatemple GridServer (gs) via XCode? I tried setting this up last night, and this is as far as I've got:
Installed Git on my Mac(s)
Created subdomain for git (git.blahblah.com) on my gs service via Terminal SSH
Created empty repository within subdomain (git.blahblah.com/repo/repo.git) via Terminal SSH
Clicked on 'Connect to repo' from XCode's launch menu
Entered repo address (ssh://git.blahblah.com:22/repo/repo.git) in XCode's address bar
Clicked 'clone' once XCode has found the repo and is telling me that "Authentication [is] required"
Chosen the appropriate local folder on my machine to clone the repo to
Tried to enter username and password specified in MT admin panel - the same ones that I used via Terminal SSH to set up the repo in the first place
Get booted with an error message: either 'incorrect username and password' (they're not) or 'specified address does not appear to be a repository, connection unexpectedly terminated by host' (or similar)
Cry. Repeatedly.
Getting to step 6 causes my IP to be blocked by MT, even if I'm logged into the web control panel from the same IP at the same time. Unblocking the IP via the MT control panel has no effect; the IP is blocked as soon as I try and connect via XCode again.
I suspect it's actually step 4 that's causing problems as XCode is trying to 'ping' the repo without credentials as you type in the address (to resolve connectivity).
Has anyone got this working, or do I need to look at hosting my Git repos elsewhere? I'd rather not spend more money on hosting when I have a service that should suit this purpose sitting unused.
After several online sessions with MediaTemple support I've come to the conclusion that it's not going to work.
While I can host a repository on my own gs service just fine, the way that XCode tries to connect to it causes my IP to be blocked every single time. As the blocking is automatic (and can't be turned off) then it seems XCode and MediaTemple have reached an impasse.
It's not a huge issue as I'm the only developer on this project, and I can always use DropBox instead (I was just trying to find a better way of keeping versioned backups across my laptop and desktop). If I really need Git I can use another tool or Terminal.
If I had to point fingers, I'd blame XCode: it seems its support for Git is rather sketchy beyond connecting to an open, gitHub-hosted repository.
Quick update: the solution I've managed to get working is to set up an account on BitBucket, create a project and add it to local Git, commit that to BitBucket and then connect to BitBucket using XCode. I downloaded SourceTree for extra Git activity as per Stefan's suggestion, as I'm still not 100% comfortable using Terminal (I just like GUIs, is that wrong?).
Everything seems to be running smoothly so far; it's just a little annoying that I had to use a third party for Git when I thought my server (which I'm already paying for) could do the job.

Git ssh.exe has stopped working

I am on Windows 7, 64 bit, and have installed msysgit to work with my github repositories. On my old laptop (32 bit, also windows 7), git ran with no problems, but now git bash runs slowly (I type a command and it takes a couple of seconds for it to actually show up, character by character). When I try to push changes it works intermittently, but more often than not a dialog box comes up saying that "ssh.exe has stopped working...". I click cancel on that, and retry the command. Eventually, it works, asking for my authentication code. Once it gets to that step, it pushes without issue. It's just getting to that step that is the issue.
So basically, my problems are:
git runs slowly on most commands, even typing them in is slow before I execute the command
git bas (ssh.exe) stops working when pushing, works intermittently.
I have reinstalled windows since this issue popped up and that did not fix it.
Regarding the slow typing in git bash and cmd.exe, these other questions might have your answers:
https://superuser.com/questions/157194/typing-in-command-line-cmd-exe-is-very-slow
Msysgit bash is horrendously slow in Windows 7
The first has a solution when you're running a Lenovo Laptop (are you running on one by any chance?).
Since you indicated that even after a Windows re-install you're having the same issue, I would think it's related to hardware or some service or piece of software installed for this specific hardware.
I would also try running git bash as Administrator and see if that makes a difference.
Your SSH issue could be dependent on the other one, so I would solve the slow typing issue first.
Intermittent push, fetch and other remote commands are an indication of not enough concurrent ssh connections allocated in whatever your central repo is hosted on. Bump up the configuration to allow more concurrent secure connections. This is especially true if you are using something like gitolite or gitosis which use one user to allow access to all git users and differentiate the user based upon the public key provided.
I have the same configuration: Win 7 64bit, Msysgit and github. I'we faced the "ssh.exe has stopped working" problem as you did, when pushing to github.
I solved it by using another ssh.exe: I installed Cygwin, and copied over all the binaries to the git's binary folder.
I think that if during the msysgit installation, you specify an external ssh client to use, you can avoid this hack, but at the moment this seemed like a good idea.
I also faced this issue. ssh.exe, the one which git was using, was also being used by OpenSSH which I was running to connect to my US office. I've also installed TortoiseSVN which has its own ssh.exe.
I uninstalled Git and while re-installing I configured Git to use the ssh.exe that's part of TortoiseSVN, and this problem went away.
I faced the same issue today. Disabled the antivirus and it worked perfectly.

How to avoid physical path in bzr+ssh://myserver/C:\mydir?

I am starting with Bazaar (switching from Subversion, sorry if terminology is a bit off sometimes). Using Bazaar locally no problems.
Got bzr+ssh:// working on my Windows server (finally! and even ssh agent is working wow!)
Now I want a shared repository on the server from which the developers can branch to their machines. I want the repository in a specific folder, for example in C:\bzr\MyProject.
When I do:
bzr init-repo --no-trees bzr+ssh://myserver.com/MyProject
it creates the repository in C:\cygwin\home\user\MyProject in the home directory of my user account - it is understandable, but worrying.
Then as an experiment I also tried and succeeded:
bzr init-repo --no-trees bzr+ssh://myserver.com/C:\bzr\MyProject
This created the repository where I wanted. But how do I "map" or "alias" the URL (or bzr) so my developers can logon under their accounts and use URL
bzr+ssh://myserver.com/MyProject
to access the shared repository in C:\bzr\MyProject?
Obviously I don't want developers to use bzr+ssh://myserver.com/C:\bzr\MyProject because of the physical path in the URL.
Ok my own answer is if you want to run Bazaar on a Windows server for a development team who will access it over the internet,
and you are not familiar with Linux, Cygwin, SSHD and related stuff then it might turn out more complicated than you can bear.
I actually abandoned the Bazaar idea and gone with Mercurial. I must say Mercurial install on the server is also steep, but at least it is just Windows, IIS and only a bit of Python. Got it running in half a day.
Some of the problems that I had with bzr+ssh:// on a Windows server are:
Needs SSHD installed on the server. SSHD (from stripped down Cygwin) supplied with Bazaar refused to work. Had to install Cygwin and learn a bit of Linux stuff, how to run as a service, how to configure, how to generate keys.
Hard to add a new user in a way that does not request passwords typing for each command. Will need to generate a keypair, mock with copying the keys to th server in two locations (Cygwin's home user folder and Window's too). Probably need to log on the user to Windows to create a profile. Don't want developers logging on to the server actually.
Hard to set up a shared repository in a specific location on the server. Does not seem possible with bzr+ssh. Possible with sftp. Might need to use symlinks as bialix suggested above.
As a newbie to linux stuff I don't understand all implications of running sshd on the server and giving shell access to the developer accounts. Have to use bzr shell limited... documentation is scarce.
Basically, bzr+ssh:// on a Windows server seems to be what installing Subversion on a Windows server was like several years ago - hard. Hopefully it will get better with Bazaar too because I chose it over Mercurial initially.

Resources