You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Host tunnelhost # An alias for this host
HostName tunnelhost.dns.entry # I'm using IP, but the DNS entry might work for you
IdentityFile path/to/rsa/key # My id_rsa file
User my.user.name # My username, for the tunneling host
Host myserver.env # Alias for the host I actually want to connect to. Note the extension
HostName server.dns.entry
Host *.env # This wildcard matches the extension above
User my.user.name
IdentityFile path/to/rsa/key
PreferredAuthentications publickey,password # This tells SSH to use my public key for authing to the tunnelling host. You'll need to copy your keys to that host for this to work.
ProxyCommand ssh -q tunnelhost nc %h %p # Tells SSH to use the tunnelhost to connect to all *.env hosts
This alias has been in my bashrc for quite a long time:
alias socks='ALL_PROXY=socks5://127.0.0.1:1080/ \
http_proxy=http://127.0.0.1:1080/ \
https_proxy=http://127.0.0.1:1080/ \
HTTP_PROXY=http://127.0.0.1:1080/ \
HTTPS_PROXY=http://127.0.0.1:1080/'
ALL_PROXY is to be used when cloning something with git protocol, the others are all common environment variable. So commands like socks git clone, socks curl, socks wget just work. You can also directly set these variables in bashrc if you like.
Reacted by xrlin, Erisa A, Huang SJ, Konstantin Khabarlak, chenbo, michel, Eli, Patrick Wu, Yanghe Sun, RoachZhao and 26 more
Activity
JoBrad commentedon May 17, 2017
This may do what you want: I have configured SSH to use a host as a socks5 proxy. My SSH config looks something like this (h/t http://undeadly.org/cgi?action=article&sid=20070925181947):
ZeppLu commentedon May 17, 2017
This alias has been in my
bashrcfor quite a long time:ALL_PROXYis to be used when cloning something with git protocol, the others are all common environment variable. So commands likesocks git clone,socks curl,socks wgetjust work. You can also directly set these variables inbashrcif you like.yhvicey commentedon May 18, 2017
JoBrad I'm not using proxy with ssh but still thanks for your help.
Zepp (@ZeppLu) It works! thanks very much.