We help IT Professionals succeed at work.

Configure vsftpd for anonymous read/write

timvand
timvand asked
on
Medium Priority
510 Views
Last Modified: 2008-01-09
I have installed Trustix 3.0, 2.6.16 which has the option to default install vsftp.  The directory structure is as follows;

root@actilx01 /home/ftp# pwd
/home/ftp
root@actilx01 /home/ftp# ls -l
total 16
d--x--x--x  2 root root 4096 Jun  2  2005 bin/
d--x--x--x  2 root root 4096 Mar 25 19:13 etc/
d--x--x--x  2 root root 4096 Jun  2  2005 lib/
drwxr-sr-x  4 root root 4096 Mar 26 09:58 pub/

root@actilx01 /home/ftp# ls -l pub/
total 112
drwxr-sr--  2 root root  4096 Mar 26 10:00 download/
-rw----r--  1 root root 99720 Mar 26 05:31 memtest
drwx-ws-wx  2 root root  4096 Mar 26 09:44 upload/

Here is the vsftp.conf file;
anonymous_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=NO
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd/xfer.log
xferlog_std_format=YES
idle_session_timeout=600
data_connection_timeout=120
nopriv_user=ftp
ftpd_banner=vsftpd (Trustix)
pam_service_name=vsftpd
userlist_enable=YES
listen=YES
tcp_wrappers=YES
secure_chroot_dir=/var/lib/vsftp/chroot
anon_world_readable_only=YES
download_enable=YES


Currently, it is possible to write/upload files to pub/upload.  When attempting to cd to pub/download, the following error occurs;
550 Failed to change directory

I suspect it is a permissions issue, just not clear on the what the issue is or how to correct it.

Thanks in advance for any assistance.
Tim
Comment
Watch Question

Gabriel OrozcoSolution Architect

Commented:
in order to enable users to access, check with what user is vsftp running. I bet it is nobody user.

so you can either

chown nobody download/

or enable access to the directory to all non root users:

chmod o+x download/

hope this help

Author

Commented:
Ok.

Here is the output from ps -ef;

root@actilx01 /home/ftp# ps -ef |grep ftp
root      2601     1  0 10:13 pts/1    00:00:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
root      2633  1977  0 13:38 pts/1    00:00:00 grep ftp
root@actilx01 /home/ftp#

It would appear to be running as root.  Seems kind of sketchy, however, this is the default config.  If I understand correctly, this parameter is what the service runs under though, nopriv_user=ftp.  Any other suggestions or what else am I missing here?

Appears to be working, however the files in the /download need to have the go+r set, correct?

Thanks for the prompt reply.
T
Solution Architect
Commented:
oops... yes, if the config file say that, then the ftp user is running as user "ftp".

so choose one or the other (or both, hehehehe)

chown ftp download
and the
chmod go+rx download

keep in mind a directory needs the "x" permission in order to allow you to enter inside it

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.