LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SSH and secure FTP tunnel from remote computer : Is this scenario possible ? (http://www.linuxquestions.org/questions/linux-newbie-8/ssh-and-secure-ftp-tunnel-from-remote-computer-is-this-scenario-possible-688373/)

uncle-c 12-04-2008 02:58 PM

SSH and secure FTP tunnel from remote computer : Is this scenario possible ?
 
Hello folks,
I've been doing some reading on SSH and finding out and learning more about its very useful features. I was particularly impressed with the -D option which allows usage of the socks proxy facility when browsing the web in insecure environments. This got me thinking as I would like to do something similar but with FTP.
Here goes.
PC 1: -----SSH---------------> PC 2: ----FTP-----> FTPSite ( no sshd)

PC 1: <--secure----file.txt---secure------PC 2:<------file.txt ----FTPSite

The FTPsite is not running sshd so it will have to be standard ftp between PC2 and FTPSite , this connections' security is of lesser importance but the connection between PC1 and PC2 is more likely to be compromised and hence needs to be encrypted.
I could easily ftp direct from PC1 to FTPsite but that would be insecure. Or I could ssh into PC2, ftp to FTPSite from there and then use scp to copy to PC1 but that seems a bit long winded.
Would the above secure ftp tunnel be possible with a ssh command culminating in me then ftp'ing ( from PC1) to localhost:xxxx which would be a secure connection to FTPsite ?

Thanks again !

Uncle-C

teknik 12-04-2008 04:06 PM

you could always just use SFTP...

http://en.wikipedia.org/wiki/SSH_file_transfer_protocol

rizwanrafique 12-04-2008 04:10 PM

duplicated so editing

rizwanrafique 12-04-2008 04:14 PM

ssh tunnel can be setup using something like:

Code:

ssh -L localhost:<local_port>:<ftp_server>:<ftp_port> ssh_usernanme@ssh_host
Code:

ssh -L localhost:2100:ftp.example.com:21 rizwan@ssh.example.com
Connect to ftp server using:
Code:

ftp localhost 2100
That's how you setup and use ssh tunnel. You'll have to dig up a bit to use data and control ports over tunnel.


All times are GMT -5. The time now is 06:15 PM.