LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-25-2009, 10:34 PM   #1
scucci
Member
 
Registered: Sep 2009
Posts: 31

Rep: Reputation: 15
Secure VSFTPD Installation Questions


Hello,

I just installed VSFTPD with SSL and I was wondering how I can make this more secure? How do you setup VSFTPD ftps as implicit or explicit? I also wanted to setup each account to chroot users. From my assumption "chroot" only allows the user to view their home directory. This is all very new to me, but very exciting.

I've also seen people setup FTP with ssl (FTPS) and ssh (SFTP). What are some of your recommendations on this?

Thanks

scucci
 
Old 09-26-2009, 05:15 AM   #2
zidane_tribal
Member
 
Registered: Apr 2005
Location: chained to my console.
Distribution: LFS 6.1
Posts: 143

Rep: Reputation: 18
is it possible to make vsftpd more secure? keke.

as for chrooting users, if you check in vsftpd's config file (usually in /etc/vsftpd.conf) you will see an option to enable chrooting of users, vsftpd has this built in.

you might also want to read the man page for the conf file (command: man vsftpd.conf) as it has some very nice extra options that can add a fair amount of security, including the option to explicitly allow some users to log in, or implicitly allow all users to log in.

it's a fair amount to read, and sometimes seems a bit of a dark art, but it's very thorough and well worth the time.

have fun
 
Old 09-27-2009, 04:06 PM   #3
scucci
Member
 
Registered: Sep 2009
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks - It worked and its setup now.

One last question for you though. I created a self signed certificate for vsftpd so that it could use SSL and I'm using CORE FTP as my FTP agent. It only works when I put it under the connection type "AUTH SSL" and won't work when I have it selected as "FTPS (SSL Direct)". Can anyone shed some light on the differences?

thanks
 
Old 09-27-2009, 04:32 PM   #4
zidane_tribal
Member
 
Registered: Apr 2005
Location: chained to my console.
Distribution: LFS 6.1
Posts: 143

Rep: Reputation: 18
Quote:
Originally Posted by scucci View Post
Thanks - It worked and its setup now.

One last question for you though. I created a self signed certificate for vsftpd so that it could use SSL and I'm using CORE FTP as my FTP agent. It only works when I put it under the connection type "AUTH SSL" and won't work when I have it selected as "FTPS (SSL Direct)". Can anyone shed some light on the differences?

thanks
although i have not used COREFTP, it sounds as though it supports ssh file transfers as well as ssl ftp.

ssl ftp uses ssl to encrypt a normal ftp connection, which prevents anyone snooping on your connection, but you are still using the ftp protocol.

you can, however, transfer files directly over ssh itself. you may wish to read the man page ("man scp" from the shell should do the trick). scp allows you to copy files over an ssh connection (this does not use the ftp protocol, it is analagous to opening an ssh connection, and cat'ing the file through. it's a lil more complex, but you get the idea).

the difference being, ssl ftp is using ftp (port 21, and a few others), it is an ftp protocol connection with some encryption added on. ssh transfers use the ssh server (port 22), and use a completely different protocol.

you can probably use "FTPS (SSL Direct)" mode if you set the port to 22 and enter your ssh account details, instead of the ftp details.

it's quite a nifty system, very usefull for copying files to and from a machine if you havent set up an ftp server yet, and of course, it's ssh encrypted.

apologies if i have rambled, i'm stuffed up with flu atm and floating on a pink fluffy cloud of medication...
 
Old 09-28-2009, 03:56 PM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by scucci
I've also seen people setup FTP with ssl (FTPS) and ssh (SFTP). What are some of your recommendations on this?
Two different protocols / implementations. Both get you encryption on the wire -- assuming you're forcing users to use SSL, and not continuing to allow clear-text ftp sessions.

Also, since SSL was slapped on to ftp after the fact, you still have to live with the "cruft" associated with ftps. (Primarily firewall issues; iptables has a module to work around this.)
 
Old 09-28-2009, 04:27 PM   #6
scucci
Member
 
Registered: Sep 2009
Posts: 31

Original Poster
Rep: Reputation: 15
Well since I'm using FTPS in "explict" mode the data connection stays on the same inital port, but the data is later on encrypted. With implict mode you have to use port 990, but everything is encrypted from start to end. Both have the data and login's encrypted, so I'm not sure what the major differences are between them. From my point of view if I can keep the ports the same it might save a headache for both our clients and us. Is there a security hole in doing this though?
 
Old 09-28-2009, 04:51 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I'm not familiar with an ftps "explicit mode" like you're describing, but look here:
Code:
$ egrep '^ftp[ s]|^ftps*-data' /etc/services 
ftp-data        20/tcp
ftp-data        20/udp
ftp             21/tcp
ftp             21/udp          fsp fspd
ftp-data        20/sctp                 # FTP
ftp             21/sctp                 # FTP
ftps-data       989/tcp                 # ftp protocol, data, over TLS/SSL
ftps-data       989/udp                 # ftp protocol, data, over TLS/SSL
ftps            990/tcp                 # ftp protocol, control, over TLS/SSL
ftps            990/udp                 # ftp protocol, control, over TLS/SSL
ftps / ftps-data are IANA-recognized service ports. So I'm not sure if you may be saving a headache or creating a headache by using (IMO) non-standard ports.
 
Old 09-29-2009, 05:38 PM   #8
scucci
Member
 
Registered: Sep 2009
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks for that!! From what I've configured it only works using port 21 or "auth ssl". How would I configure VSFTPD to use port 990 for full (implicit) FTPS? What I did was configure a self signed certificate for VSFTPD while adding the following lines to /etc/vsftpd/vsftpd.conf.

ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=NO
force_local_logins_ssl=NO
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
rsa_cert_file=/etc/vsftpd/vsftpd.pem


explicit Security: In order to establish the SSL link, explicit security requires that the FTP client issue a specific command to the FTP server after establishing a connection. The default FTP server port is used. This formal method is documented in RFC 2228.

Implicit Security:
Implicit security automatically begins with an SSL connection as soon as the FTP client connects to an FTP server. In implicit security, the FTP server defines a specific port for the client (990) to be used for secure connections.
 
Old 09-29-2009, 05:48 PM   #9
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
From my reading of vsftpd.conf, it looks like you enable the directive implicit_ssl.
 
Old 09-30-2009, 08:26 PM   #10
scucci
Member
 
Registered: Sep 2009
Posts: 31

Original Poster
Rep: Reputation: 15
Interesting.....I just entered the directive implicit_ssl=YES and received this error when trying to restart the service. This might seem like a silly question, but does it matter where in the config I put the directive?


root@localhost ~]# nano /etc/vsftpd/vsftpd.conf
[root@localhost ~]# service vsftpd restart
Shutting down vsftpd: [FAILED]
Starting vsftpd for vsftpd: 500 OOPS: unrecognised variable in config file: implicit_ssl
[FAILED]
 
Old 09-30-2009, 10:03 PM   #11
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Perhaps check the vsftpd.conf(5) manpages for the version you have installed. It may be that the directive is not present in all versions (or that it's present under a different name).
 
Old 10-01-2009, 01:55 AM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,309

Rep: Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744
By comparison, the Linux man page for same does not have that option http://linux.die.net/man/5/vsftpd.conf, although it does have several ssl related options.
 
Old 10-02-2009, 09:31 PM   #13
scucci
Member
 
Registered: Sep 2009
Posts: 31

Original Poster
Rep: Reputation: 15
Thank you everyone for your replies to this post, you've helped me out so much!!

I'm going to stop posting on this thread and start a new one regarding configuration of Implicit FTP on CentOS, I hope to see you there
 
  


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
VSFTPD with secure & non-secure logins Ricci Graham Linux - Software 6 02-24-2020 11:49 PM
How secure is vsftpd? What alternative is there for more secure access? Gum Linux - Security 5 03-24-2009 05:00 PM
vsftpd, and premoicuous. Is it secure? jsbush Linux - Security 2 11-04-2003 12:16 PM
vsftpd very very secure, so secure i can't use it... baronsam Linux - Networking 4 10-06-2003 06:12 PM
Vsftpd Folder ownerships - Is this secure? Korff Linux - Security 2 06-06-2003 01:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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