mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Add global ssh_config path to git ssh wrapper
This ensures that a matching entry in a local ssh_config (~/.ssh/config) doesn't override the "-i" parameter.
This commit is contained in:
parent
f813cce4ad
commit
0b286f1bc3
@ -1,6 +1,18 @@
|
||||
#!/bin/sh
|
||||
OPTS="-oStrictHostKeyChecking=no -oPasswordAuthentication=no -oKbdInteractiveAuthentication=no -oChallengeResponseAuthentication=no"
|
||||
if [ ! -z "$GIT_IDENTITY" ]; then
|
||||
if test -n "$GIT_IDENTITY"; then
|
||||
OPTS="$OPTS -i $GIT_IDENTITY"
|
||||
# Check /etc/ssh and /usr/local/etc/ssh for the global ssh_config
|
||||
if test -e "/etc/ssh/ssh_config"; then
|
||||
OVERRIDE_SSH_CONFIG="/etc/ssh/ssh_config"
|
||||
elif test -e "/usr/local/etc/ssh/ssh_config"; then
|
||||
OVERRIDE_SSH_CONFIG="/usr/local/etc/ssh/ssh_config"
|
||||
else
|
||||
OVERRIDE_SSH_CONFIG=""
|
||||
fi
|
||||
# If a global ssh_config was found, add it to the opts. This keeps the
|
||||
# user's ~/.ssh/config from overriding the "-i" param.
|
||||
if test -n "$OVERRIDE_SSH_CONFIG"; then
|
||||
OPTS="$OPTS -F $OVERRIDE_SSH_CONFIG"
|
||||
fi
|
||||
fi
|
||||
exec ssh $OPTS "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user