LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-17-2009, 08:41 PM   #1
SQADude
LQ Newbie
 
Registered: Nov 2009
Posts: 7

Rep: Reputation: 0
Can't upload file using vsftp as anonymous user


I have a vsftpd server running on an Ubuntu 9.04 version. The vsftpd server is set to accept anonymous users. The anonymous users are set to /var/ftp

My /etc/vsftpd.conf has these settings:

Code:
listen=YES

anonymous_enable=YES

anon_root=/var/ftp

local_root=/var/ftp

local_enable=YES

write_enable=YES

anon_upload_enable=YES

anon_mkdir_write_enable=YES

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

secure_chroot_dir=/var/run/vsftpd

pam_service_name=vsftpd

tcp_wrappers=YES

rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem

rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key


From another host, I tried to FTP to the Ubuntu machine. I can log in as anonymous. However, when I try to "put" a file, I get a 553 error.

I don't have SELinux running on my system so it's not SELinux that's preventing anonymous FTP uploads.

I changed the permissions on /var/ftp to 777 but that prevents users from logging in as anonymous to the FTP server for some reason.

I looked at the /var/log/vsftpd.log and I see these log events:

Code:
Tue Nov 17 18:07:12 2009 [pid 13769] CONNECT: Client "10.xxx.1.130"
Tue Nov 17 18:07:17 2009 [pid 13768] [ftp] OK LOGIN: Client "10.xxx.1.130", anon password "password"
Tue Nov 17 18:08:57 2009 [pid 13771] [ftp] FAIL UPLOAD: Client "10.xxx.1.130", "/libflashplayer.so", 0.00Kbyte/sec
Tue Nov 17 18:28:17 2009 [pid 14256] CONNECT: Client "10.xxx.1.130"

I looked at the other threads about trying to upload as an anonymous user using vsftp but none of them have answers or solutions.

Is there anything else I need to do to allow an anonymous user to upload files to /var/ftp?
 
Old 11-17-2009, 09:01 PM   #2
AuroraZero
Member
 
Registered: Oct 2009
Location: memphis, TN
Distribution: SlackWare 14.2, Android, Slax, Centos 5.9 Final, Centos 6
Posts: 188

Rep: Reputation: 32
Quote:
Originally Posted by SQADude View Post
I have a vsftpd server running on an Ubuntu 9.04 version. The vsftpd server is set to accept anonymous users. The anonymous users are set to /var/ftp

My /etc/vsftpd.conf has these settings:

Code:
listen=YES

anonymous_enable=YES

anon_root=/var/ftp

local_root=/var/ftp

local_enable=YES

write_enable=YES

anon_upload_enable=YES

anon_mkdir_write_enable=YES

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

secure_chroot_dir=/var/run/vsftpd

pam_service_name=vsftpd

tcp_wrappers=YES

rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem

rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key


From another host, I tried to FTP to the Ubuntu machine. I can log in as anonymous. However, when I try to "put" a file, I get a 553 error.

I don't have SELinux running on my system so it's not SELinux that's preventing anonymous FTP uploads.

I changed the permissions on /var/ftp to 777 but that prevents users from logging in as anonymous to the FTP server for some reason.

I looked at the /var/log/vsftpd.log and I see these log events:

Code:
Tue Nov 17 18:07:12 2009 [pid 13769] CONNECT: Client "10.xxx.1.130"
Tue Nov 17 18:07:17 2009 [pid 13768] [ftp] OK LOGIN: Client "10.xxx.1.130", anon password "password"
Tue Nov 17 18:08:57 2009 [pid 13771] [ftp] FAIL UPLOAD: Client "10.xxx.1.130", "/libflashplayer.so", 0.00Kbyte/sec
Tue Nov 17 18:28:17 2009 [pid 14256] CONNECT: Client "10.xxx.1.130"

I looked at the other threads about trying to upload as an anonymous user using vsftp but none of them have answers or solutions.

Is there anything else I need to do to allow an anonymous user to upload files to /var/ftp?
No clue to as to what 777 is but I think you mean 755. Also make sure the server did not accidentally ban your ip. I know sounds stupid but it has and does happen.
 
Old 11-17-2009, 09:05 PM   #3
SQADude
LQ Newbie
 
Registered: Nov 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AuroraZero View Post
No clue to as to what 777 is but I think you mean 755. Also make sure the server did not accidentally ban your ip. I know sounds stupid but it has and does happen.
777 is RWX permission for all -- rwxrwxrwx
755 was the default permission for /var/ftp -- rwxr-xr-x


Also, how do I check to see that the vsftpd server didn't accidently ban my IP?
 
Old 11-17-2009, 09:34 PM   #4
AuroraZero
Member
 
Registered: Oct 2009
Location: memphis, TN
Distribution: SlackWare 14.2, Android, Slax, Centos 5.9 Final, Centos 6
Posts: 188

Rep: Reputation: 32
Quote:
Originally Posted by SQADude View Post
777 is RWX permission for all -- rwxrwxrwx
755 was the default permission for /var/ftp -- rwxr-xr-x


Also, how do I check to see that the vsftpd server didn't accidently ban my IP?
Ok I understand you want people to be able to upload and stuff to this right anonymously ? Do you have a firewall set up?
 
Old 11-18-2009, 01:50 PM   #5
SQADude
LQ Newbie
 
Registered: Nov 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AuroraZero View Post
Ok I understand you want people to be able to upload and stuff to this right anonymously ? Do you have a firewall set up?
Not on the VSFTP server or the client attempting to upload files to it. Both machines are on a company intranet. There is a firewall for external access but between these two hosts, no, there is no firewall in effect.
 
Old 11-18-2009, 02:15 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,224
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Quote:
anon_root=/var/ftp

local_root=/var/ftp
I guess you cannot have the same dir for local user and anonymous users. Change or comment out the 2nd option and see if it works.
 
Old 11-18-2009, 05:03 PM   #7
SQADude
LQ Newbie
 
Registered: Nov 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
I guess you cannot have the same dir for local user and anonymous users. Change or comment out the 2nd option and see if it works.
I changed the settings so local_root is /var/ftp and anon_root is /var/ftp/anonymous

I also created a /var/ftp/anonymous directory

Restarted vsftpd service.

I still cannot upload files to the /var/ftp/anonymous directory as anonymous.

Also, I put a file called foo.conf in the /var/ftp/anonymous directory. I can't get the foo.conf file because FTP complains that it cannot open the file.

Am I setting up the user correctly? Do I have to have a user named "anonymous" in the /etc/passwd file?
 
Old 11-19-2009, 03:28 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,224
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
You can try this:
Code:
chown root:root /var/ftp/anonymous
mkdir /var/ftp/anonymous/uploads
chown -R ftp /var/ftp/anonymous/uploads
Add also
Code:
ftp_username=ftp
in vsftpd.conf
This way the anonymous user can upload in /var/ftp/anonymous/uploads dir

Regards
 
  


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
Upload file to ftp server -vsftp- but can not delete or change the file once uploaded murattas6 Linux - Server 2 06-26-2009 06:00 AM
anonymous user can not upload file olympic Linux - Newbie 4 01-19-2007 07:39 AM
Proftpd-How Do You Change The Permissions On A File From Anonymous Upload saxsd Linux - Security 5 03-07-2006 09:48 AM
anonymous upload with vsftp rachuba Linux - Software 0 12-29-2002 06:39 PM
anonymous user can't login vsftp java8964 Linux - General 1 08-07-2002 08:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:24 PM.

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