git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jean-Louis FLOQUET <jese.jlf@gmail.com>
To: git@vger.kernel.org
Subject: [Question] : git 2.33.1 asks every time password
Date: Thu, 30 Dec 2021 16:56:12 +0100	[thread overview]
Message-ID: <CAHo1AWxzPsnLuT8JRWovtaRrGvRS8+0NyucU5K8VEnaL1xxW3Q@mail.gmail.com> (raw)

Hi,

I use some scripts to do some batch operations (pull / push), using
rsa key and ssh-agent / ssh-add. I'm under Windows 10 (with all
updates).
When launching my script (see below, truncated : more than 100 repo),
I have to enter rsa passphrase (OK) then all push/pull are done
without any user interaction (no passphrase, no password, nothing)
All Git versions up to 2.33.0.2 are working fine, but since 2.33.1,
git asks every time the password.
I had to create a 'config' file within '.ssh' directory to support my
rsa key (too old format ?). Instructions according to
https://stackoverflow.com/questions/35233777/git-error-unable-to-negotiate-with-xx-xx-xxx-xxx-no-matching-host-key-type-fo
I also have seen that some people have to add 'ssh-add -K', but it
seems to be only for MacOS.
According to release notes for 2.33.1, Git Credential Manager for
Windows has been replaced by Git Credential Manager Core, but I don't
know if it is the "root" problem, and if yes, how to fix my issue.
I would greatly appreciate any help / solution. Thanks in advance.

Best Regards,
JL

===========================================================================================
transcript
user@computer MINGW64 /my_path1 (master)
$ ./pull_all.sh
Loading agent...
Adding key
Agent pid 1968
Enter passphrase for /path_to_rsa_key:
Identity added: /path_to_rsa_key (/path_to_rsa_key)
key : finish

Repository = /my_path1
git pull --quiet my_server master
Password authentication
(user@server) Password:

Repository = /my_path2
git pull --quiet my_server master
Password authentication
(user@server) Password:

Repository = /my_path3
git pull --quiet my_server master
Password authentication
(user@server) Password:

Appuyer sur touche pour continuer
user@computer MINGW64 /my_path1 (master)
===========================================================================================
rsa_key
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,xxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END RSA PRIVATE KEY-----
===========================================================================================
create_env.sh :
!/bin/sh

# Note: ~/.ssh/environment should not be used, as it
#       already has a different purpose in SSH.

#Create directory if not exist
mkdir -p ~/.ssh/

#Create variable
env=~/.ssh/agent.env

#Create file if not exist
touch $env

# Note: Don't bother checking SSH_AGENT_PID. It's not used
#       by SSH itself, and it might even be incorrect
#       (for example, when using agent-forwarding over SSH).

agent_is_running() {
if [ "$SSH_AUTH_SOCK" ]; then
# ssh-add returns:
#   0 = agent running, has keys
#   1 = agent running, no keys
#   2 = agent not running
ssh-add -l >/dev/null 2>&1 || [ $? -eq 1 ]
else
false
fi
}

agent_has_keys() {
ssh-add -l >/dev/null 2>&1
}

agent_load_env() {
echo "Loading agent..."
. "$env" >/dev/null
}

agent_start() {
(umask 077; ssh-agent >"$env")
. "$env" >/dev/null
}

add_key() {
echo "Adding key"
eval `ssh-agent -s`
ssh-add /path_to_rsa_key
echo "key : finish"
}

if ! agent_is_running; then
agent_load_env
fi
===========================================================================================

             reply	other threads:[~2021-12-30 15:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-30 15:56 Jean-Louis FLOQUET [this message]
2021-12-30 20:35 ` [Question] : git 2.33.1 asks every time password brian m. carlson
2021-12-31  8:47   ` Jean-Louis FLOQUET
2021-12-31 12:55     ` Erik Cervin Edin
2021-12-31 13:04       ` Erik Cervin Edin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHo1AWxzPsnLuT8JRWovtaRrGvRS8+0NyucU5K8VEnaL1xxW3Q@mail.gmail.com \
    --to=jese.jlf@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).