SLS

 
HowTo: Download files via SFTP (Secure File Transfer Program) when your SSH server is behind a firewall

Author: G0NZ0

Linux Version: Any

NOTICE: this is complementary to Upload files via SCP (Secure Copy Program) when your SSH server is behind a firewall

Requirements:

1) It is hereby assumed that your remote machine runs a unix and on it SSHD is enabled
(to check: /etc/init.d/sshd status, to start or stop: /etc/init.d/sshd start or /etc/init.d/sshd stop).
We will call your firewalled machine my_host and let's suppose that username is a user on it.

2) There must be a "visible" machine which lets you login through SSH. Let's call it visiblehost.ac.uk. In other words you have an account on it, say visible_username

Problem 1: You want to connect via SSH to a remote machine which is behind a firewall

This is other than SFTP. However since this commands are needed for SFTP as well, I will report them here.

First you have to login into the visible machine:

ssh -X visible_username@visiblehost.ac.uk 


Then you have to login into your firewalled machine:

ssh -X username@my_host 


Now from here you can start applications also with GUI. For example typing thunderbird you will see on your local machine thunderbird running, even if you don't have thunderbird installed locally! You just need to have a compatible OS (if you're on Windows, it won't work)

Problem 2: You want to connect via SFTP to a remote machine which is behind a firewall in order to transfer files

Since you cannot SFTP your firewalled machine directly, you ill need first to SSH on visiblehost.ac.uk.
You will have to do a double SFTP but once you are on visiblehost.ac.uk you cannot reach my_host.
Thus SSH is needed before SFTP

First you have to login in SSH into the visible machine:

ssh -X visible_username@visiblehost.ac.uk 


Then you have to login in SFTP into your firewalled machine:

sftp username@my_host 


Ok, almost done: now you can get any files you want.

get whatever_you_want


Be careful: now these files will go in your account on visiblehost.ac.uk !!
You were connected in SSH to it, not in SFTP, so now you need to start a SFTP session directly on it in order to get the files:

sftp visible_username@visiblehost.ac.uk 

get whatever_you_want 


Finally you will have those files on your own local computer (in home, since we didn't specify more options in SFTP). No matter if your local machine is firewalled, since it is you that are starting the connection.

To terminate either a SSH session or a SFTP session, type exit.

Comments and Suggestions:
forums.suselinuxsupport.de/

There are no comments on this page. [Add comment]


Warning: include(http://forums.suselinuxsupport.de/ssi.php?a=active) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/customers/webs/slwiki/actions/footer.php on line 51

Warning: include() [function.include]: Failed opening 'http://forums.suselinuxsupport.de/ssi.php?a=active' for inclusion (include_path='.:/home/customers/webs') in /home/customers/webs/slwiki/actions/footer.php on line 51

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.0
Page was generated in 0.0208 seconds