-2

Im trying to configure VSFTPD to allow anonymous users to upload. For example im trying to upload from cisco router to the linux (CentOS) machine the config files. Here i have post my vsftpd.conf file

grep -v ^# /etc/vsftpd/vsftpd.conf |grep -v ^$

anonymous_enable=YES
local_enable=YES
guest_enable=YES
virtual_use_local_privs=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
idle_session_timeout=600
chroot_local_user=YES
ls_recurse_enable=YES
listen=YES
user_sub_token=$USER
local_root=/ftp/virtual/$USER
userlist_enable=YES
tcp_wrappers=YES
hide_ids=YES

And for the folders i have all configured with 777 etc. and also i have put on all directory "chown -R ftp:ftp pub/" Also i am able to download files from the /pub/upload/ but i cant upload.

  • For future reference please post the actual error messages and the relevant configuration settings with the question, rather than on a remote site. – HBruijn Mar 19 '14 at 16:26
  • I love to but the code was too big and i cant find something or i dont know how to post the code without getting too much space, and if it ok to post too big ... sorry in advanced ! – ivmp Mar 19 '14 at 18:03
  • I've edited your post with a solution to that problem. – HBruijn Mar 19 '14 at 20:35
0

The default for CentOS is to have SELinux enabled. Confirm that with the getenforce command.

If in Enforcing mode that's the likely reason anonymous FTP uploads are disabled.

Use setsebool -P allow_ftpd_anon_write=1 to change that policy and you should be able to upload anonymously.

  • With getenforce i get this as output [root@centos ~]# getenforce Enforcing Also i use setsebool -P allow_ftpd_anon_write=1 and still nothing. Then i disable the "selinux" and from the windows PC using filezilla i can upload but from the router i cant. From the cisco router i use the copy running-config ftp://ipaddres and i get error %Error opening ftp://ipaddress/running.cfg (Permission denied). I use the full path ftp://ipadd/pub/upload and still nothing ... any idea ? – ivmp Mar 19 '14 at 18:20
  • A quick search found this Cisco Manual which seems to indicate that you don't need anonymous FTP at all, specify a username on te Cisco IOS prompt with #ip ftp username <username> and #ip ftp password <password> and then copy your config with copy running-config ftp: but it has been ages since anyone trusted me to manage their network... – HBruijn Mar 19 '14 at 20:43
  • Ok i will take your way ... but now i have other problems ... this same vsftpd i have configured to work with Berkeley DB and i have configure the cisco VoIP to make backup and it works but now for the running config on the cisco router i have problems. When i execute the copy runn... ftp://<user>:<pass>@<ip> i have error saying wrong user and pass ... but when i try to connect using filezilla also iv got error except when i use port 22 SSH/SFTP ... – ivmp Mar 20 '14 at 11:25
  • I have successfuly copy the running ... but using the old username and password from voip ... i would like to add new one ... so i just have to change the .db file like change the file.txt and again execute the db_load -T -t hash -f /etc/vsftpd/virtualfile.txt /etc/vsftpd/virtualfile.db ??? – ivmp Mar 20 '14 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.