Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I would like to to a ftp to sftp bridge connection like I can do it using bitvise tunnelier. My idea is when some client connects to my server via ftp (intranet) I would establish immediately a sftp connection to another server (outside intranet) sending files securely and automatically from my client to the other server outside the intranet, even the files are sent insecurely from my client to my server.
I have tried ssh port forwarding without success. Any idea?
Since you have not explained (actual commands, FTP transfer test results, error output) the "without success" part it is impossible to comment on this. SSH can provide you with a permanent tunnel from one system to another but it won't get you a SSL-ized connection in the sense of FTPS. (That is, SSL-ized FTP, like IMAPS is SSL-ized IMAP and HTTPS is SSL-ized HTTP.) The only GNU/Linux tool I know that should be able to "translate" between protocols is Delegate. If you OTOH actually meant SFTP (as in SSH subsystem) then the answer simply is "no". SFTP and FTP are not compatible in any way I know of.
You are right. My idea is to do a FTP to SFTP bridge so if someone is sending me something using FTP I connect to SFTP to another server (outside my intranet) and send It again using SFTP.
One possibility would be to implement a script that maps all files from the ftp folder and resend it using sftp. My problem in this case is that the client has no feedback about the correctness of the connection, i.e, if the sftp connection fails, the ftp client won't know it.
My Aim is to have a FTP to SFTP bridge like bitvise tunnelier.
I don't think what you want is directly possible. Even a product like the Bitvise Tunnelier wouldn't do this. All that program appears to do is initiate an SSH tunnel to a preconfigured host and install a local service that can interpret FTP commands and translate them into SFTP commands.
Since you want to connect to a third system, this setup wouldn't work. The client would only ever be connecting to your system, not the third party one.
A script option would probably be the best bet. The client would know that the file was successfully sent to your system. However, from there it would be up to you to ensure that the file was successfully sent to the third party. But you could add email notifications, automatic retries, etc. to your script; basically whatever kind of due diligence you want.
The only other option I can think of would be to give the client direct access to the third party, however, I'm assuming you don't want to go that route.
Thanks for all!
This looks like a great solution. However, Is there any script that controls the sftp connections?
My aim is to implement a script like below:
0. Some user using ftp connects to my ftp server.
1. Prior allowing the transfer. Mount the sshfs unit.
2. If there is no connection then forbids the transfer. (sending back a transfer error).
3. Else copy the file to the unit and disconnect.
My problem here is that I don't know how to control the ftp server connections. If there is no easy solution I will further with sshfs avoiding feedback connection information.
0. Some user using ftp connects to my ftp server.
1. Prior allowing the transfer. Mount the sshfs unit.
2. If there is no connection then forbids the transfer. (sending back a transfer error).
3. Else copy the file to the unit and disconnect.
If you wish to mount sshfs automatically (rather than having it permanently mounted) use Autofs.
However if you wish to use the username and/or password provided by the ftp client to connect to the ssh server I suspect some programming will be required.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.