Article delegate-en/3040 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A3039@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: Support for SFTP protocol
30 Jul 2005 08:45:02 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi,

In message <_A3039@delegate-en.ML_> on 07/28/05(17:32:50)
you Yair Lenga <p34fqbdyi-p5lznxk2zfxr.ml@ml.delegate.org> wrote:
 |I looking for an application that can translate between ftp and sftp 
 |protocol (secure ftp, part of the ssh pacakge). I noticed that delegate 
 |can handle many protocols, but sftp is not listed.

Sftp/SSH has not been implemented in DeleGate, since I have not heard
any request about it.

 |I will appreciate any information on how to sftp module for Delegate.

I'm interested in it then I read the specification of sftp in
draft-ietf-secsh-filexfer-09.txt, and other docs at
<URL:http://www.ietf.org/html.charters/secsh-charter.html>
But I felt the sftp/SSH specification is a little too large for
trial implementation.  So I did it "using sftp command as a gateway
program from FTP client to SFTP server".  I uploaded it as
DeleGate/9.0.4-pre1 at <URL:ftp://ftp.delegate.org/pub/DeleGate/alpha/>

DeleGate for SFTP/FTP gateway can be invoked like this:

  % delegated -v -P8021 SERVER=ftp MOUNT="/* sftp://SftpServer/*"

With this DeleGate, you can access "sftp://User:Pass@SftpServer" as if
it is "ftp://User:Pass@DeleGate:8021".

Although the overhead caused by using sftp command as a gateway and
the limitation of available commands in the FTP protocol, it seems
to work for practical use.  I tested it with several FTP client
including ftp command and Mozilla and MSIE.  I tested the DeleGate on
MacOSX and FreeBSD.  For example, the enclosed is the log when I
tested it on MacOSX.

I felt that using sftp command as SFTP/FTP gateway can be a right
solution, by extending it so that it accepts FTP commands and responds
in FTP status response :)

Cheers,
Yutaka
--
  D G   Yutaka Sato <y.sato@delegate.org> http://delegate.org/y.sato/
 ( - )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller

% delegated -v -P8021 SERVER=ftp MOUNT="/* sftp://localhost/*"
...
07/30 17:34:11.09 [7210] 0+0: --INITIALIZATION START: 9.0.4-pre1 on Darwin/7.9.0--
...
07/30 17:34:11.14 [7210] 0+0: arg[3] SERVER=ftp
07/30 17:34:11.14 [7210] 0+0: arg[4] MOUNT=/* sftp://localhost/*
...
07/30 17:34:27.35 [7212] 1+0: (0) accepted [32] -@[127.0.0.1]localhost:56042 (0.012s)(1)
07/30 17:34:27.35 [7212] 1+0: PATH: ftp://-:21!localhost:8021!localhost:56042!anonymous@localhost;1122712467
07/30 17:34:27.36 [7212] 1+0: FTP server ftp://-:21/
07/30 17:34:27.36 [7212] 1+0: *** / => sftp://localhost/ ***
07/30 17:34:27.36 [7212] 1+0: MOUNTED-TO: //localhost/
07/30 17:34:27.41 [7212] 1+0: -SFTPGW:CWD set FS->fs_proto=sftp
07/30 17:34:27.45 [7212] 1+0: bind_insock(19,127.0.0.1,0) = 0, errno=0
07/30 17:34:27.45 [7212] 1+0: ## connect[19] failure (57)
07/30 17:34:27.45 [7212] 1+0: ### IDENT CONNECT(localhost:113) TIMEOUT(1000ms) (60)
07/30 17:34:27.45 [7212] 1+0: #### no authorization required
07/30 17:34:31.65 [7212] 1+0: Unknown request: FEAT^M
07/30 17:34:33.23 [7212] 1+0: FTP-control-remote: 127.0.0.1:8021
07/30 17:34:33.23 [7212] 1+0: FTP-data-local[20]: 127.0.0.1:56044
07/30 17:34:33.23 [7212] 1+0: PASV [X][|||56044|] >> 229 Entering Extended Passive Mode (|||56044|)^M
07/30 17:34:33.23 [7212] 1+0: *** / => sftp://localhost/ ***
07/30 17:34:33.23 [7212] 1+0: MOUNTED REMOTE [yutaka@localhost:22] LIST .
07/30 17:34:33.23 [7212] 1+0: FTP LOGIN FROM localhost TO yutaka@localhost
07/30 17:34:33.23 [7212] 1+0: -SFTPGW:change_server REAL_PROTO=sftp <-FS
07/30 17:34:33.23 [7212] 1+0: PATH: ftp://localhost:22!localhost:8021!localhost:56042!anonymous@localhost;1122712467
07/30 17:34:33.24 [7212] 1+0: FTP server ftp://localhost:22/
07/30 17:34:33.24 [7212] 1+0: FTPHOPS: 1 [11/32 - -1/-1]
07/30 17:34:33.24 [7212] 1+0: -SFTPGW:connect_serv REAL_PROTO=sftp ->FS
07/30 17:34:33.25 [7213] 1+0: -- Fork(SftpGW): 7212 -> 7213
07/30 17:34:33.25 [7213] 1+0: --SFTPGW start
07/30 17:34:33.25 [7213] 1+0: --SFTPGW >> 220 SFTP/FTP gateway ready.
07/30 17:34:33.25 [7212] 1+0: willSTLS_SV: ServerFlags=10
07/30 17:34:33.25 [7213] 1+0: --SFTPGW << [USER][yutaka]
07/30 17:34:33.25 [7213] 1+0: --SFTPGW >> 331 Send password or passphrase for 'yutaka'
07/30 17:34:33.25 [7213] 1+0: --SFTPGW << [PASS][****]
07/30 17:34:33.25 [7213] 1+0: --SFTP: sftp -oPort=22 yutaka@localhost
07/30 17:34:33.26 [7213] 1+0: --SFTP: pty master 22 /dev/ttypc
07/30 17:34:33.39 [7213] 1+0: --SFTP >>(FORK-1) Connecting to localhost...
07/30 17:34:33.96 [7213] 1+0: --SFTP >>(FORK-1) The authenticity of host 'localhost (::1)' can't be established.
07/30 17:34:33.96 [7213] 1+0: --SFTP >>(FORK-1) RSA key fingerprint is b8:60:03:fa:37:5a:76:7b:a7:ed:80:e3:24:8b:50:f8.
07/30 17:34:33.96 [7213] 1+0: --SFTP >>(FORK-1/NO-NL)[Are you sure you want to continue connecting (yes/no)? ]
07/30 17:34:33.97 [7213] 1+0: --SFTP: answered yes for...
Connecting to localhost...^M
The authenticity of host 'localhost (::1)' can't be established.^M
RSA key fingerprint is b8:60:03:fa:37:5a:76:7b:a7:ed:80:e3:24:8b:50:f8.^M
Are you sure you want to continue connecting (yes/no)? 
07/30 17:34:33.97 [7213] 1+0: --SFTP >>(FORK-2) 
07/30 17:34:33.97 [7213] 1+0: --SFTP >>(FORK-2) Warning: Permanently added 'localhost' (RSA) to the list of known hosts.^M
07/30 17:34:34.13 [7213] 1+0: --SFTP >>(FORK-2/NO-NL)[yutaka@localhost's password: ]
07/30 17:34:34.15 [7213] 1+0: --SFTP: sent the password...
07/30 17:34:34.15 [7213] 1+0: --SFTP >>(FORK-3) 
07/30 17:34:34.29 [7213] 1+0: --SFTP >>(FORK-4) sftp> sftp> Progress meter disabled
07/30 17:34:34.29 [7213] 1+0: --SFTP >>(FORK-4/NO-NL)[sftp> ]
07/30 17:34:34.30 [7213] 1+0: --SFTPGW >> 230 Ok
07/30 17:34:34.30 [7213] 1+0: --SFTPGW << [PWD][]
07/30 17:34:34.30 [7213] 1+0: --SFTP << pwd^M
07/30 17:34:34.30 [7213] 1+0: --SFTP >>(PWD) Remote working directory: /Users/yutaka
07/30 17:34:34.30 [7213] 1+0: --SFTP >>(PWD/NO-NL)[sftp> ]
07/30 17:34:34.31 [7213] 1+0: --SFTPGW >> 257 "/Users/yutaka"
07/30 17:34:34.31 [7212] 1+0: LoginPWD: "/Users/yutaka"
07/30 17:34:34.31 [7213] 1+0: --SFTPGW << [PASV][]
07/30 17:34:34.32 [7213] 1+0: server_open(SftpGW,*:0,listen=1)
07/30 17:34:34.32 [7213] 1+0: server_open(SftpGW,*:0) BOUND
07/30 17:34:34.32 [7213] 1+0: --SFTPGW >> 227 Enterning Passive Mode (0,0,0,0,218,245)
07/30 17:34:34.32 [7212] 1+0: ftp_conndata: connected 127.0.0.1:56054->localhost/0.0.0.0:56053 [21]
07/30 17:34:34.32 [7212] 1+0: -- with PASV
07/30 17:34:34.32 [7212] 1+0: PASV [B][InheritingFromUnboundProxyMode] >> 227 Entering Passive Mode (InheritingFromUnboundProxyMode).^M
07/30 17:34:34.32 [7212] 1+0: *** / => sftp://localhost/ ***
07/30 17:34:34.32 [7213] 1+0: --SFTPGW << [LIST][.]
07/30 17:34:34.32 [7213] 1+0: --SFTPGW >> 150 Ok
07/30 17:34:34.32 [7213] 1+0: --SFTP << ls -l .^M
07/30 17:34:34.32 [7212] 1+0: FTP-CACHE: LIST [.] = [][]:0
07/30 17:34:34.32 [7212] 1+0: DATA 127.0.0.1:56053 -> 127.0.0.1:56054 .. 127.0.0.1:56044 -> 127.0.0.1:56045
07/30 17:34:34.69 [7213] 1+0: --SFTPGW >> 226 Ok
07/30 17:34:34.77 [7212] 1+0: FTP data-relay([21]8000b -> [23]8000b) 13236b / 1/ 0.45s (read-EOF)
07/30 17:34:34.77 [7212] 1+0: *** / => sftp://localhost/ ***
07/30 17:34:34.77 [7212] 1+0: ## EXIT onetime [LIST]
07/30 17:34:34.77 [7212] 1+0: SFTPGW:EXIT disabled
07/30 17:34:36.20 [7213] 1+0: --SFTPGW << [QUIT][]
07/30 17:34:36.20 [7213] 1+0: --SFTPGW >> 221 Ok Bye.
07/30 17:34:36.21 [7212] 1+0/1/1: disconnected [32] -@[127.0.0.1]localhost:56042 (8.870s)(0)
07/30 17:34:36.21 [7213] 1+0: --SFTPGW finished
07/30 17:34:37.55 [7210] 1+0: DeleGate SERVER EXITS: caught SIGINT [2]
07/30 17:34:37.55 [7210] 1+0: Killpg(7210,15)
07/30 17:34:37.57 [7210] 1+0: FINISH.

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V