LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 12-03-2010, 09:04 AM   #1
rabjac
LQ Newbie
 
Registered: Oct 2005
Posts: 18

Rep: Reputation: 0
Question Setting Up A Secure FTP Site Under RHEL 5.3


I have recently setup a RHEL 5.3 server primarily to be used as an Apache web server. I also now have a requirement to have this server also service SFTP requests for uploading/downloading files.

1. By default RHEL 5.3 allows SFTP (over TCP port 22). However when searching for SFTP site setup I've come across the fact that RedHat recommends using vsftpd. So if I configure vsftpd, what happens to the default SFTP and the ability to remotely use something like PuTTY to SSH into the server? Really looking to see if SFTP or vsftpd is best. Also, is vsftpd as or more secure than FTP over SSH?

2. I've set aside a separate disk parition (to keep it away from the system partition to help lock down security) for the SFTP site. So I want to use that as the default SFTP root directory structure. How can this be achieved?

3. My requirements dictate 3 separate directories need to be used, each with their own associated SFTP user. The user can only read/write it's own directory structure and cannot navigate out of it. Also there will be a SFTP super user able to navigate through each of the 3 directory structures mentioned, but will not be able to navigate out of it's home directory. Can this be done, if so how?

There will be no SSL certificates in play at the moment. I'm more concerned about getting things setup and working correctly first. However there may be a requirement to use them later.

The site will be accessed over the Internet initially, hence the reason I'm looking to make it as secure as possible while getting it up and running quickly.

TIA.
 
Old 12-03-2010, 11:38 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,661

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by rabjac View Post
I have recently setup a RHEL 5.3 server primarily to be used as an Apache web server. I also now have a requirement to have this server also service SFTP requests for uploading/downloading files.

1. By default RHEL 5.3 allows SFTP (over TCP port 22). However when searching for SFTP site setup I've come across the fact that RedHat recommends using vsftpd. So if I configure vsftpd, what happens to the default SFTP and the ability to remotely use something like PuTTY to SSH into the server? Really looking to see if SFTP or vsftpd is best. Also, is vsftpd as or more secure than FTP over SSH?
In my opinion, using just SSH/SFTP is more secure. Running two services on two different ports only opens up another possible attack point. If SSH is already running, you've then already got SFTP running over that same port. If I HAD to run a dedicated FTP server, I'd choose vsftpd. Since vsftpd and SSH run on different ports, one doesn't effect the other. Also, SSH is considered by lots of folks to be pretty much the most secure remote access protocol, but you'll get LOTS of opinions on that, too.
Quote:
2. I've set aside a separate disk parition (to keep it away from the system partition to help lock down security) for the SFTP site. So I want to use that as the default SFTP root directory structure. How can this be achieved?

3. My requirements dictate 3 separate directories need to be used, each with their own associated SFTP user. The user can only read/write it's own directory structure and cannot navigate out of it. Also there will be a SFTP super user able to navigate through each of the 3 directory structures mentioned, but will not be able to navigate out of it's home directory. Can this be done, if so how?
Read the man page for sshd_config, and pay attention to the ChrootDirectory flag. Set that flag accordingly, so when users log in, it puts them in a 'jail, where ALL they can see is their own home directory, or whatever you've specified here. Chroot'ing is also possible with vsftpd.
Quote:
There will be no SSL certificates in play at the moment. I'm more concerned about getting things setup and working correctly first. However there may be a requirement to use them later.
The site will be accessed over the Internet initially, hence the reason I'm looking to make it as secure as possible while getting it up and running quickly.
TIA.
Both SFTP/SSH and vsftpd support certificates.
 
1 members found this post helpful.
Old 12-09-2010, 11:44 AM   #3
rabjac
LQ Newbie
 
Registered: Oct 2005
Posts: 18

Original Poster
Rep: Reputation: 0
I have decided to go with vsftpd and have the FTP site running as I would like. I now do need to add SSL into the mix (customer's request). I already have a wildcard cert on the server and was hoping to use this by putting the follow directives into the vsftpd.conf file:

dsa_cert_file=/usr/share/ssl/certs/<certificate_file>
dsa_private_key_file=/usr/share/ssl/certs/<certificate_key_file>

Is there anything else I'm missing regarding setup for SSL encryption? When running a FTPS connection using FileZilla I get the following:

Status: Connecting to <server_IP>:990...
Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server".
Error: Could not connect to server
Status: Waiting to retry...

This test is being run with iptables off. Could it be because the server is not fully commissioned yet, the certificate is causing this error.
 
Old 12-09-2010, 12:16 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,661

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by rabjac View Post
I have decided to go with vsftpd and have the FTP site running as I would like. I now do need to add SSL into the mix (customer's request). I already have a wildcard cert on the server and was hoping to use this by putting the follow directives into the vsftpd.conf file:

dsa_cert_file=/usr/share/ssl/certs/<certificate_file>
dsa_private_key_file=/usr/share/ssl/certs/<certificate_key_file>

Is there anything else I'm missing regarding setup for SSL encryption? When running a FTPS connection using FileZilla I get the following:

Status: Connecting to <server_IP>:990...
Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server".
Error: Could not connect to server
Status: Waiting to retry...

This test is being run with iptables off. Could it be because the server is not fully commissioned yet, the certificate is causing this error.
Not sure, since most of what I do I use SSH for. However, this how-to:
http://www.cyberciti.biz/tips/config...a-ssl-tls.html

may help. Also, be aware that you need to have an FTP client that is certificate-aware.
 
1 members found this post helpful.
  


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(through web site access to ftp server) kelper Linux - Software 4 07-03-2015 05:14 PM
files not visible in ftp site (but present in the /var/ftp/folder of the server) dongrila Linux - Newbie 2 12-23-2007 10:09 PM
Accessing FTP site using FTP Clients s/w on XP machines. munirg2003 Linux - Security 5 06-26-2007 02:36 AM
Setting up secure FTP (trying vsftpd on RHEL 4) Xera Linux - General 11 11-07-2006 05:51 PM
Setting up a secure FTP and Tunneling Server Randvegeta Linux - Software 2 12-30-2005 10:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 06:58 AM.

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