How to open from SFTP Server via SOCKS proxy

2,064 views
Skip to first unread message

Mark

unread,
Apr 3, 2014, 5:20:25 AM4/3/14
to bbe...@googlegroups.com
Hi there,

I'm wondering if there's a way that I can use BBEdit to edit the files on servers that I connect to via a SOCKS proxy?

To give a bit more detail.  When working from home, I SSH to my computer in the office using the following command:
ssh ma...@remote.computer.mywork.com -D8080

This sets up a SOCKS proxy on port 8080 on my local computer.  Any traffic that goes through that proxy appears to have come from my workstation in the office, thus allowing me to access other work servers which are behind the firewall.

To SSH into one of the other servers (which are usually inaccessible from home), I use the following command:
ssh -o ProxyCommand='nc -x localhost:8080 %h %p' remot...@server.mywork.com

Is there any way I can connect to servers via SOCKS proxy within BBEdit? 

Thanks
Mark

Mark

unread,
Apr 7, 2014, 10:46:40 AM4/7/14
to bbe...@googlegroups.com
Never mind. I figured it out myself.

This can be done using a local SSH config file.  Create a new file inside the .ssh directory within your home directory, and call the file "config".  Here is the full content of my ~/.ssh/config file

ProxyCommand /usr/bin/nc -x localhost:8080 %h %p

After opening the initial connection to my desktop computer in the office which creates the SOCKS proxy, any subsequent SSH connection will follow the rules in this config file.  This, in turn, has the effect of making BBEdit connect through my temporary SOCKS proxy.

Wildcards can also be used in the config file, so if you routinely connect to more than one server behind the firewall, you can do *.mywork.com instead of listing each one individually.

Mark


On Thursday, April 3, 2014 10:20:25 AM UTC+1, Mark wrote:
Hi there,

I'm wondering if there's a way that I can use BBEdit to edit the files on servers that I connect to via a SOCKS proxy?

To give a bit more detail.  When working from home, I SSH to my computer in the office using the following command:
ssh -l mark remote.computer.mywork.com -D8080

This sets up a SOCKS proxy on port 8080 on my local computer.  Any traffic that goes through that proxy appears to have come from my workstation in the office, thus allowing me to access other work servers which are behind the firewall.

To SSH into one of the other servers (which are usually inaccessible from home), I use the following command:
ssh -o ProxyCommand='nc -x localhost:8080 %h %p' -l remote-user server.mywork.com
Reply all
Reply to author
Forward
0 new messages