LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 12-04-2008, 02:58 PM   #1
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Fedora 14, Ubuntu , Slax 5.1.8, OpenSolaris, Centos 4.8
Posts: 296

Rep: Reputation: 30
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
 
Old 12-04-2008, 04:06 PM   #2
teknik
Member
 
Registered: Jun 2006
Location: Winnipeg, Canada
Distribution: Slackware 12.1
Posts: 33

Rep: Reputation: 16
you could always just use SFTP...

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

Last edited by teknik; 12-04-2008 at 04:07 PM. Reason: Link to wikipedia entry
 
Old 12-04-2008, 04:10 PM   #3
rizwanrafique
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, openSUSE, CentOS
Posts: 147

Rep: Reputation: 19
duplicated so editing

Last edited by rizwanrafique; 12-11-2008 at 04:43 AM.
 
Old 12-04-2008, 04:14 PM   #4
rizwanrafique
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, openSUSE, CentOS
Posts: 147

Rep: Reputation: 19
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ftp over ssh tunnel; ftp refuses to work jakykong Linux - Networking 16 10-16-2011 07:34 AM
Copying files to local computer whilst in ssh tunnel Maverick1182 Linux - Newbie 4 10-07-2006 01:29 PM
Tunnel all internet traffic through a ssh connected remote computer Bateman Linux - Networking 12 12-10-2004 05:53 AM
Remote Desktop using SSH tunnel..... help! redhatbeatswin Linux - Newbie 5 08-14-2004 11:51 AM
SSH Tunnel and FTP Issues ayrton Linux - Networking 2 02-16-2004 05:03 AM


All times are GMT -5. The time now is 05:10 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration