I have a script with this snippet:
ssh-agent bash -c "ssh-add $SOME_KEY; \
git submodule update --init foo"
The script hangs while asking the user:
RSA key fingerprint is SHA256:[the fingerprint]
Are you sure you want to continue connecting (yes/no)?
How can I make the script continue (with a yes)?
-
I know that I can invoke
ssh -o StrictHostKeyChecking=no
to disable this but I'm callinggit
notssh
. -
I know that I can configure
~/.ssh/config
to disable strict key checking for that host–but I don't want to modify the user's system. -
I know that I can
chmod 000 ~/.ssh/known_hosts
to disable key checking for that user, but I don't want to modify the user's system -
I thought I could insert
yes |
in front ofgit
but it doesn't seem to work.
Best Answer
From Stack Overflow, via muru, passing ssh options to git clone: