LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-13-2011, 04:26 PM   #1
littlebigman
Member
 
Registered: Aug 2008
Posts: 448

Rep: Reputation: 32
Question Dead-simple VsFTPd anonymous read/write configuration?


Hello,

I just want to configure Vsftpd to allow users to have total access to the FTP server. The server and users are all on a private LAN behind a router with no access from the Net, so I don't need any security.

The following basic configuration doesn't allow uploading files after I log on as anonymous/whatever:

/etc/vsftpd/vsftpd.conf
Code:
listen=YES
anonymous_enable=YES
local_enable=YES
write_enable=YES
xferlog_file=YES

#anonymous users are restricted (chrooted) to anon_root
#anon_root=/home/ftp/incoming
anon_root=/var/ftp
anon_upload_enable=YES
anon_mkdir_write_enable=YES

#chroot_local_user=NO
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd.chroot_list
Here's what happens when I log on as anonymous/whatever and try to upload a file:
Quote:
> ftp server
Connected to server.
220 (vsFTPd 2.0.5)
Name (server:root): anonymous
331 Please specify the password.
Password:<whatever>
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.

ftp> ls -al
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwxr-xr-x 3 0 0 4096 Mar 13 11:19 .
drwxr-xr-x 3 0 0 4096 Mar 13 11:19 ..
drwxr-xr-x 2 0 0 4096 May 25 2010 pub
226 Directory send OK.

ftp> put /var/tmp/ftp
local: /var/tmp/ftp remote: /var/tmp/ftp
200 PORT command successful. Consider using PASV.
553 Could not create file.
Google didn't return a really simple way to configure things. Does someone know?

Thank you.
 
Old 03-13-2011, 05:50 PM   #2
grover
LQ Newbie
 
Registered: Mar 2011
Location: Germany
Distribution: Mandriva
Posts: 11

Rep: Reputation: 0
With my system I had to do the following:

chmod u+w /var/ftp/pub/

Then I was able to upload to the pub/ directory. For /var/ftp this does not work, because
vsftpd refuses to start if its root (/var/ftp) has write permissions for anonymous users.

Greetings, hope this help.
 
Old 03-14-2011, 03:40 AM   #3
littlebigman
Member
 
Registered: Aug 2008
Posts: 448

Original Poster
Rep: Reputation: 32
Thanks, but I already had /var/ftp/pub set that way:

Code:
# ll /var/ftp/
drwxr-xr-x 2 root root 4096 May 26  2010 pub

# chmod u+w /var/ftp/pub/

# ll /var/ftp/
drwxr-xr-x 2 root root 4096 May 26  2010 pub
I'm running "vsftpd-2.0.5-16.el5_5.1" on CentOS 5.5: Could it be that this issue shows with that older version, or my configuration file is wrong?
 
Old 03-14-2011, 05:37 AM   #4
grover
LQ Newbie
 
Registered: Mar 2011
Location: Germany
Distribution: Mandriva
Posts: 11

Rep: Reputation: 0
Quote:
Originally Posted by littlebigman View Post

Thanks, but I already had /var/ftp/pub set that way:
OK, but in your ftp exmaple above you didn't change into the pub directory first.
Did you actually try it with changing into the directory pub/ first?

Quote:
I'm running "vsftpd-2.0.5-16.el5_5.1" on CentOS 5.5: Could it be that this issue shows with that older version, or my configuration file is wrong?
Well, my version is vsftpd-2.2.2-4mdv2010.1

I copied your configuration and it worked (in the directory pub/).


What does your vsftpd.log say ?
 
Old 03-14-2011, 07:13 PM   #5
littlebigman
Member
 
Registered: Aug 2008
Posts: 448

Original Poster
Rep: Reputation: 32
Thanks for the help. This simple configuration works ok: After logging as ftp or anonymous, I can succesfully upload files to /var/ftp:

Code:
listen=YES
anonymous_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
Thanks again for your help.

Edit: You must also make sure "ftp" owns the directory:

chown -R ftp.ftp /var/ftp/

If owned by root.root, you'll get this when trying to upload a file: "553 Could not create file"

Last edited by littlebigman; 03-15-2011 at 05:41 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
vsFTPd - Anonymous dir write problem felipefv Linux - Server 2 12-09-2010 07:38 PM
Should be dead simple - read/write serial port from bash ericcarlson Linux - Software 3 10-21-2006 08:35 PM
Using vsftpd, trying to enable anonymous write PDAquila Linux - Software 2 06-11-2006 09:56 PM
Using vsftpd, trying to enable anonymous write PDAquila Linux - Newbie 3 06-09-2006 12:17 AM
Using vsftpd, trying to enable anonymous write PDAquila Suse/Novell 1 06-08-2006 09:30 PM


All times are GMT -5. The time now is 08:43 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration