LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-25-2008, 01:00 PM   #1
displacedtexan
LQ Newbie
 
Registered: May 2007
Posts: 22

Rep: Reputation: 15
FTP over SSH problems


So, my web host doesn't offer SFTP, but does offer SSH, so I am trying to connect to the ftp server via an SSH tunnel.

I am forwarding local port 2021 to the IP address of the server's port 21.

When I connect via my ftp client I get:


"Status: Connecting to 127.0.0.1:2021...
Status: Connection established, waiting for welcome message...
Response: 220 ProFTPD 1.3.1 Server ready.
Command: USER blah
Response: 331 Password required for blah
Command: PASS *******
Response: 230 User blah logged in
Command: SYST
Response: 215 UNIX Type: L8
Command: FEAT
Response: 211-Features:
Response: MDTM
Response: AUTH TLS
Response: PBSZ
Response: PROT
Response: REST STREAM
Response: SIZE
Response: 211 End
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is the current directory
Command: TYPE I
Response: 200 Type set to I
Command: PASV
Response: 227 Entering Passive Mode (208,115,37,162,138,27).
Command: LIST"

And no further response. If I try active mode, I get:

"Response: 257 "/" is the current directory
Command: TYPE I
Response: 200 Type set to I
Command: PORT 127,0,0,1,7,229
Response: 500 Illegal PORT command
Error: Failed to retrieve directory listing"

Now I would like to both the control and data ftp stream to be encrypted, if possible.

So, what am I doing wrong?

Thanks!!
 
Old 01-25-2008, 01:17 PM   #2
mtford
LQ Newbie
 
Registered: Jan 2005
Distribution: Scientific Linux (based on RHEL)
Posts: 11

Rep: Reputation: 0
I don't think tunnelling works easily for FTP: see the FAQ at
http://www.stunnel.org/faq/troubleshooting.html#ToC18

Have you tried scp?

Last edited by mtford; 01-25-2008 at 01:19 PM.
 
Old 01-26-2008, 09:57 AM   #3
displacedtexan
LQ Newbie
 
Registered: May 2007
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by mtford View Post
I don't think tunnelling works easily for FTP: see the FAQ at
http://www.stunnel.org/faq/troubleshooting.html#ToC18

Have you tried scp?
Yeah, I have tried scp. The hosting company has it disabled somehow. They use jailed ssh, although I am not sure that is what is keeping me from using scp.

Any other ideas?

Thanks!!
 
Old 01-26-2008, 10:46 AM   #4
mtford
LQ Newbie
 
Registered: Jan 2005
Distribution: Scientific Linux (based on RHEL)
Posts: 11

Rep: Reputation: 0
The other option is to emulate scp using the ssh command-line. I've used the following commands in bash, but they probably work in other shells too.

Code:
To get a file:
ssh user@host "cat /remote/file/to/read" > /local/file/to/write

To put a file:
ssh user@host "cat > /remote/file/to/write" < /local/file/to/read
Wildcard copies won't be simple with this method, so you'll probably have to tar.gz the files first, and untar them from a shell at the other end (assuming you have enough space to tar the files, otherwise you'll have to be creative).
 
  


Reply



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



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
problems tunneling ftp thru ssh ewlnxnewB Linux - Networking 6 11-13-2003 09:54 PM
FTP and SSH Ikik Linux - Networking 10 08-20-2003 10:55 AM
Problems with SSH/FTP on LAN w0rmh0l3 Linux - Networking 10 03-08-2002 08:32 AM
FTP over SSH?? markma Linux - Security 1 12-29-2000 01:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration