Last active
September 27, 2024 18:58
-
-
Save alphamarket/e0ed48f8755bebdc7451b758bc6828fa to your computer and use it in GitHub Desktop.
Creating SSH proxy and making Git connect through it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [step 1] create a ssh-proxy | |
ssh -D 9999 -qCN [email protected] | |
# [step 2] make git connect through the ssh-proxy | |
# [current script only] | |
export GIT_SSH_COMMAND='ssh -o ProxyCommand="connect -S 127.0.0.1:9999 %h %p"' | |
# OR [git global setting] | |
git config --global core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:9999 %h %p"' | |
# OR [one-time only use] | |
git clone -c=core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:9999 %h %p"' [email protected]:user/repo.git | |
# OR [current repository use only] | |
git config core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:9999 %h %p"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To install
connect
on Ubuntu: