[Question] : git 2.33.1 asks every time password

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
===========================================================================================



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux