LinuxQuestions.org
Visit Jeremy's Blog.
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 09-06-2017, 04:08 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post SSH to FTP.


Hello.
I want my users connecting to FTP service via SSH. Is it possible? I mean is that I write rule that when users SSH to my server and Authentication then they forward to FTP automatically.

Thank you.
 
Old 09-06-2017, 04:12 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,416

Rep: Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541Reputation: 1541
Why not just use SFTP instead of making things difficult for yourself?
 
1 members found this post helpful.
Old 09-06-2017, 06:07 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,995

Rep: Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682
Not easily.
https://docstore.mik.ua/orelly/netwo...sh/ch11_02.htm
 
Old 09-06-2017, 08:43 AM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
SFTP was developed for that.

jlinkels
 
Old 09-07-2017, 11:47 AM   #5
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
Do I understand the you run the FTP server and you want to let SSH users access it? Can't you serve up the same directory with both FTP and SSH? That way, there would be no special setup, just two daemons serving content as usual. And SSH automatically gives you SFTP.
 
Old 09-07-2017, 01:10 PM   #6
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
you COULD create an ssh tunnel for ftp, however it would be more efficient to just use SFTP as has been stated prior, since SFTP clients exist for almost any conceivable operating system, and the SFTP daemon is installed alongside the SSH daemon (part of the openSSH package)
 
Old 09-07-2017, 01:22 PM   #7
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Use SFTP, if you already have ssh why bother with another protocol?
SFTP is hands down better, it is secure by design and uses only 1 port, very easy to NAT.
 
1 members found this post helpful.
Old 09-08-2017, 04:14 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,815

Rep: Reputation: 3609Reputation: 3609Reputation: 3609Reputation: 3609Reputation: 3609Reputation: 3609Reputation: 3609Reputation: 3609Reputation: 3609Reputation: 3609Reputation: 3609
Or maybe FTPS. http://opensourceforu.com/2015/03/se...rver-in-linux/
 
Old 09-12-2017, 02:50 AM   #9
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Is "SFTP" the most secure FTP daemon?
If I want do it then what is the iptables rules?
 
Old 09-12-2017, 03:19 AM   #10
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,089
Blog Entries: 3

Rep: Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665
Quote:
Originally Posted by hack3rcon View Post
Is "SFTP" the most secure FTP daemon?
If I want do it then what is the iptables rules?
Nope. SFTP is not an FTP daemon at all, it is an entirely different protocol from FTP. Only the name bears some similarity. It is the secure way to transfer files, however, if that's what you'r asking.

SFTP operates over SSH so if your iptables rules allow SSH, then SFTP will work via the SSH daemon with no additional firewall rule changes needed. If you wish to turn off SFTP and leave just SSH, that is possible. If you wish to turn off the interactive shell in SSH and leave just SFTP that it possible, too.
 
Old 09-12-2017, 05:56 AM   #11
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by hack3rcon View Post
Is "SFTP" the most secure FTP daemon?
If I want do it then what is the iptables rules?
FTPS = Secure FTP = FTP file transfer with an added encryption layer. Since this is an add-on certain software implementations can have issues (i have seen it fail quite a few times).
SFTP = Secure Shell File Transfer Protocol = file transfer using the SSH protocol. It is a built in component of SSH (it is enabled by default on desktop on Linux/Mac and nowadays smarter switches/routers use it too). It is secure by design and it is more easily manageable than FTP from the network point of view (the data is transferred over the same SSH port).
 
Old 09-12-2017, 08:43 AM   #12
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,416
Blog Entries: 4

Rep: Reputation: 3836Reputation: 3836Reputation: 3836Reputation: 3836Reputation: 3836Reputation: 3836Reputation: 3836Reputation: 3836Reputation: 3836Reputation: 3836Reputation: 3836
SFTP is what I would recommend – or, better yet, rsync --rsh=ssh.

These protocols use an SSH connection to secure the file transfer. "rsync" has the added advantage of being a synchronization engine. (Point it at two directories and tell it, "make them the same.")

Now, for routine connections among systems that just happen to be connected to the Internet, I would use OpenVPN with the tls-auth to build a "Dwarvish Door" between the two machines. This is a completely secure connection which cannot be detected(!) by those who would conspire to do mischief. The remote system appears to be connected to your internal network, yet everything that passes between the two machines is encrypted with no further attention needed from you.

OpenVPN in this capacity acts as a cryptographically secure TCP/IP router. (Or, bridge.) It exposes no "open ports" and ignores a strangers' attempts to talk to it. You might still use SSH for the convenience of password-free connections but you would not expose your SSH daemon to the outside world: only users of the OpenVPN tunnel could see it. ("Number of unauthorized access attempts: Zero.")

Last edited by sundialsvcs; 09-12-2017 at 08:48 AM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH and FTP ali2011 Programming 10 07-20-2012 11:17 AM
ftp over ssh tunnel; ftp refuses to work jakykong Linux - Networking 16 10-16-2011 08:34 AM
Access to one server via root/ssh/ftp on other only ftp anthonychallis Linux - Newbie 4 01-12-2010 03:23 PM
ftp vs ssh elainelaw Linux - Newbie 9 09-10-2009 07:19 PM
ssh and ftp artman62 Linux - Networking 4 08-25-2002 05:55 PM

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

All times are GMT -5. The time now is 07:55 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