sublime_merge icon indicating copy to clipboard operation
sublime_merge copied to clipboard

Prompts for password with every push to origin

Open Fotiman opened this issue 6 years ago • 41 comments

Version info

OS: Windows 10 Build: 1075

Description

Starting with Build 1075, every time I push to origin, it prompts me for a password. git config credential.helper manager Remote repository is accessed using HTTPS. This thread suggests that the problem is fixed by not using the bundled version of Git: https://forum.sublimetext.com/t/build-1075-keeps-prompting-for-credentials/39884/11

Steps to reproduce

Open repository ... Click on Push (Ctrl+Alt+Up)

Expected behavior

After I've been authenticated, it should not prompt me again for a password.

Fotiman avatar Nov 02 '18 19:11 Fotiman

I think this is not limited to Build 1075 I am on 1085 and in this few days, it keeps asking me to login to git every few minutes. When it fetches in the background, 5 GitHub Login prompts will pop up and ask me to login again image

FYI, I have GitHub MFA turned on and using SM's bundled git

edit: Happen on both bundled and system git, 7 times today already

jasonycw avatar Nov 05 '18 05:11 jasonycw

Same credentials problem with SM 1097 when using a personal Gitblit server in my intranet (over SSH), regardless of the Git binary bundled/system settings. On my Git CLI credentials are working fine and I don't get asked every time.

I don't get asked for credentials with GitHub via HHTP though, only on Gitblit via SSH.

tajmone avatar Dec 12 '18 01:12 tajmone

I'm on build 1103 now, and I'm no longer seeing the issue. Are any others still seeing this issue in build 1103? @tajmone @jasonycw ?

Fotiman avatar Feb 14 '19 14:02 Fotiman

I had to manually install Build 1103 because Build 1102 wouldn't see the update as available.

And, yes, Build 1103 still naggers me with password request whenever it accesses the remote server on intranet (Git Blit stack).

tajmone avatar Feb 14 '19 16:02 tajmone

Build 1102 wouldn't see the update 1103 as available too.

But 1102 seems to have no password prompt for quite a while (using GitHub directly)

jasonycw avatar Feb 15 '19 02:02 jasonycw

But 1102 seems to have no password prompt for quite a while (using GitHub directly)

I wonder if the fact that it keeps asking me for the password on my GitBlit intranet server is due to configuration issues. When I use command line Git everything works fine, for some reason SM doesn't seem to be picking those user settings for credentials.

Having to re-enter the password for every push/pull and fetch operation really makes SM rather unfriendly to use with my intranet repositories.

I hope that on the SM online documentation there will be added a page regarding settings for credentials, etc.

tajmone avatar Feb 15 '19 14:02 tajmone

I have the same password prompt issue when I connect to my BitBucket repository over SSH. I've tried using system and bundled version of Git but no luck. I'm using Build 1107

burki169 avatar Apr 08 '19 08:04 burki169

I have the issue with BitBucket. System git does not bother me for authentication, but bundled git does.

ian-nisbet avatar Jul 06 '19 11:07 ian-nisbet

I am on build 1116 and am having this issue.

Toddses avatar Jul 31 '19 18:07 Toddses

As a follow up, yesterday it suddenly started working and I no longer had to enter my password.

Now, today, its asking for my password on every remote action again.

I have Password Caching set to 1 week. And I'm using the system git.

Toddses avatar Aug 02 '19 14:08 Toddses

From this morning (2019/08/04) SM started to prompt me for users & pass also on GitHub (no SM updates, so I guess something might have changed on GitHub settings that introduced the same problem I was experiencing with Bitbucket).

This is becoming a serious problem, if SM starts nagging for user and password on every push operation also on GitHub then it becomes unusable for Git related work.

Right now, I'm asked for account credentials on every push operation on:

  • GitHub
  • Bitbucket
  • my local Git server (NAS drive)

This problem has been pending a solution for quite a long time now (10 months since the issue was opened), and has only got worse. If it doesn't get fixed, I'll have to consider moving to another Git GUI tool (or to VSCode, which offers Git integration directly in the editor).

tajmone avatar Aug 04 '19 07:08 tajmone

Issue still persist and asking for password in each push.

hkchakladar avatar Feb 17 '20 09:02 hkchakladar

May 2020, SM build 2011, and the problem persists (the Issue was opened 2 years ago).

I can't understand why SM fails to see the Git credential files stored on my system (Win 10), while all other Git instances and front-ends pick them up correctly.

SM should ask for the password only once, and then store it somewhere.

I've found a Forum post that mentioned the menu option Tools > Passowrd Caching, but I can't see that menu in the current edition:

https://forum.sublimetext.com/t/sublime-merge-remember-git-account/39451/3

The inability to cache credentials is a serious issue which jeopardizes the benefits of using SM for everyday work. In my case, I'm facing the issue with a local GitBlit server installed in my Intranet, and connecting via SSH. Having to enter the password for each push operation is really annoying.

Is there an ETA for when this problem can be fixed? Two years is quite a long time for a bug that affects a core feature like credentials storage in an app that's dedicate to Git usage — and, to be honest, long enough to discourage license renewal when the time arrives.

Sorry for the pessimistic tone of this last post, but try to stand in my shoes and imagine having to type a rather long and articulate password with every push operation, day by day, hundreds of times, while working locally on my private projects. Either that or having to constantly switch to Bash for push and write operations. Not pleasant, at all, and was really hoping for a fix to the problem after two years.

tajmone avatar May 29 '20 10:05 tajmone

With 473 open issues (and only 286 closed), and 12 months between releases, it would seem that this project is not getting any serious attention. As much as I loved Sublime Merge initially, this issue is a showstopper for me. Authentication problems should get the highest priority, but this bug isn't even assigned to anyone.

Fotiman avatar May 29 '20 17:05 Fotiman

Hi all,

I want to start off by apologizing that this issue has affected your workflow for such a long time, and thank you for your patience. I will do everything I can to see this gets resolved.

I have been debugging this issue, and I have been able to replicate the issue with SSH, but not HTTPS. I'll be looking to get this SSH issue fixed as soon as possible.

For those seeing the issue with HTTPS, it's likely there is a configuration issue with Git. When you get a chance, could you perform the following steps:

  • Add the following keybinding to Sublime Merge (Preferences > Edit Keybindings...)
    { 
        "keys": ["ctrl+n"], 
        "command": "git", 
        "args": {"argv": ["config", "--show-origin", "credential.helper"]} 
    },
  • Press ctrl + n
  • Open the git output panel (by clicking the green tick button next to the stash button)
  • Copy the output of the command, and paste it here

Additionally, could you confirm that the credentials are being stored by Windows?

  • Open Control Panel
  • Navigate to User Accounts
  • Navigate to Credential Manager
  • Navigate to Windows Credentials
  • Confirm that the credentials are visible under Generic Credentials

Thank you again for your patience, and for reporting this issue.

Kind regards, - Dylan

dpjohnst avatar Jun 01 '20 02:06 dpjohnst

Hi @dpjohnst , thanks for the reply. As for the first test, I attempted with various keybindings but none showed any results in SM Git output panel (always says No previous commands history).

As for the credentials in the Control Panel, I can see all the http credentials for GitHub, GitLab, Bitucket, etc, under Generic Credentials (of course, no reference to my NAS, since I use SSH only there).

As for the NAS/SSH problem, I've found a workaround which seems to work, i.e. to define on each repository a new user, email and password in its Git configuration — because I noticed that SM was falling back to my standard account (GitHub), unlike Git CLI. This is not an ideal solution, but at least it restricts the problem. Somehow Git CLI is picking up the credentials on a per URL basis, but SM is not.

No idea how to fix that except by changing the .git/config of each repository (because I use the MicroSoft credentials manager instead of Git's native, it seems I can't use some of the options that enable per-URL based credentials, as supported by Git's native manager).

tajmone avatar Jun 01 '20 15:06 tajmone

Hi @tajmone,

Thank you for your response! To confirm, you are only seeing the issue for SSH?

Without seeing your setup, most likely what is happening here is that your terminal has a ssh-agent associated with it. Could you confirm whether or not the following returns any output from the terminal: ps aux | grep -i 'ssh-agent'

Additionally, if you launch Sublime Merge from the terminal, do you see the prompt for the SSH passphrase every time? Most likely /c/Program\ Files/Sublime\ Merge/sublime_merge.exe depending on where it's installed.

Thanks, - Dylan

dpjohnst avatar Jun 02 '20 01:06 dpjohnst

Hi @dpjohnst. While answering your reply I've updates SM to Build 2021 /in case this makes any difference).

To confirm, you are only seeing the issue for SSH?

No, also with HTTPS with some Git services, e.g. with Bitbucket where I get their login pop-up three times, plus the user and password popus from SM after. Again, it doesn't seem that SM is able to memorize credentials for Bitbucket, whereas it works fine with GitHub and GitLab. I've tested pushing to Bitbucket right now, since I haven't been doing so for quite a while, and problem remains unchanged since my first bug report.

Could you confirm whether or not the following returns any output from the terminal:

ps aux | grep -i 'ssh-agent'

Tried it on Git's Bash, no output whatsoever.

if you launch Sublime Merge from the terminal, do you see the prompt for the SSH passphrase every time?

I've tried the above steps with a Bitbucket repository via HTTPS, by launching SM from Git Bash, and I confirm it didn't ask me for credentials (not even on the first push). Right now I can't try this with SSH because of the above mentioned mod to the Git settings where I've manually added the user and password for each repository on my NAS drive — if you still need me to do that test I'll need to find a free time slot to unroll all those changes, but since the HTPPS test turned out to no longer ask for credentials I think that it might have answered already your question.

So, from what I've gathered so far, it seems to be an issue of SM trying to use the default/main Git account for all repositories (in my case, the GitHub account is the main account) and for some reason not being able to associate different accounts with different services.

The above tests seem to indicate that the problem is likely to be fixable without major changes, for it probably boils down to environment settings that are interfering with Git configurations (and associated tools).

tajmone avatar Jun 02 '20 09:06 tajmone

Hi, You can use pageant to avoid entering a password every time. https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

eka7a avatar Aug 15 '20 23:08 eka7a

I'm wondering if anyone ever found a solid solution for this?

I'm experiencing the same issue with SSH, where I'm prompted for passphrase on every pull/push. Looking to buy this for our entire team, but after testing it on several other dev's machines and experiencing the same, we need to wait for now - which is obviously such a shame.

Anyways - we have been using Git Bash up until now, where we just run this on launch: eval 'ssh-agent -s' ssh-add ~/.ssh/*_rsa

But that doesn't seem to work in SM. I also tried making a similar custom command, but that didn't help either.

petefox avatar Nov 09 '20 22:11 petefox

Hi @PeteFox,

Thank you for the question!

Assuming you're on Windows, the best approach currently is to use Pageant/Plink to authenticate.

You can download these tools (bundled with PuTTY) here: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

You can load your SSH keys into pageant, then set up Sublime Merge to use Plink (via Preferences > Advanced > GIT_SSH).

If you'd like a more detailed walkthrough, let me know and I can definitely write one up!

Thanks, - Dylan

dpjohnst avatar Nov 09 '20 22:11 dpjohnst

Assuming you're on Windows, the best approach currently is to use Pageant/Plink to authenticate.

Thanks @dpjohnst! This is an excellent workaround to the problem.

tajmone avatar Nov 10 '20 09:11 tajmone

That is a long unsolved issue with git command not related to Sublime Merge.

On Github.com make sure you create a PAT: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token

Second. You can also try saving the login user-password to a plain-text file, effective when the operating system credentials fail:

git config --global credential.helper store

Then entering user-password again

victor871129 avatar Nov 12 '20 16:11 victor871129

I don't think the issue is with SM as I experience this issue only when pulling/pushing to private repos on Github. Everything works find for Gitlab.

The solution as stated by @victor871129 tends to solve these perfectly well for me. Just create a PAT on Github, then use it as your password when prompted.

KhalebOBrien avatar Nov 27 '20 15:11 KhalebOBrien

Any updates on this?

ibrahimBeladi avatar Mar 26 '21 11:03 ibrahimBeladi

I'm experiencing the same issue on Linux using a Personal Access Token.

carlosgio avatar May 05 '21 18:05 carlosgio

It's like @victor871129 said, it's now a SM related problem, and his solution worked for me under Win 10 and HTTPS connection (the problem just appeared out of the blue, although login was never asked for GitHub repositories in the past).

GitHub recently updated its security for OAuth, so I guess the old tokens just stopped working.

You should have received an email from GitHub telling you that you need to create a new token. If not, here's the article mentioned in that email:

https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/

EDIT: Note that I also switched from the older store setting to wincred:

git config --global credential.helper wincred

I'm not sure if this affected the problem or not, but with wincred it works.

tajmone avatar May 23 '21 09:05 tajmone

i did run into this after dist upgrade on ubuntu. adding my key again solved it. afaik the key is now 70 instead of 64 chars long by default and thats why my old one had to be added explicitly again.

ssh-add ~/.ssh/id_rsa

bnomei avatar Jul 20 '21 12:07 bnomei

Hey Guys You can cache your password for a period of time from this menu:

Tools -> Password Caching -> Select a period of time

navidshad avatar May 03 '22 14:05 navidshad

Hey Guys You can cache your password for a period of time from this menu:

Tools -> Password Caching -> Select a period of time

This option doesn't exist in the latest version of Sublime Merge for Windows, unfortunately I still have to add my password for each pull/push in plan October 2022.

rafaelcapucho avatar Oct 26 '22 23:10 rafaelcapucho