LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-05-2006, 04:09 PM   #1
Evil Otto
LQ Newbie
 
Registered: Jul 2006
Posts: 8

Rep: Reputation: 0
Can't upload files to home directory with vsftpd


This is a strange one.

I've gotten vsftpd running, and I can log in. However, when I try to put a file to my default directory (/home/$user) I get a "553 Could not create file." from my client. However, when I switch to a subdirectory (/home/$user/directory) I can put a file there. Permissions appear identical on both directories.

Any thoughts?
 
Old 10-05-2006, 04:43 PM   #2
chimi
LQ Newbie
 
Registered: Aug 2005
Distribution: debian sarge
Posts: 16

Rep: Reputation: 0
this maybe sounds kinda obvious but ...

can this file already be there??
 
Old 10-06-2006, 03:08 AM   #3
JAdj
Member
 
Registered: Aug 2006
Posts: 30

Rep: Reputation: 15
Can you do ls -la in both directories and paste it here?
 
Old 10-06-2006, 08:20 AM   #4
Evil Otto
LQ Newbie
 
Registered: Jul 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Code:
<prompt>ls -la
total 3916
drwxr-xr-x  4 zach zach    4096 Oct  3 09:38 .
drwxr-xr-x  3 root root    4096 Apr  7 21:46 ..
-rw-------  1 zach zach    6512 Oct  2 18:10 .bash_history
-rw-r--r--  1 zach zach      24 Apr  7 21:46 .bash_logout
-rw-r--r--  1 zach zach     191 Apr  7 21:46 .bash_profile
-rw-r--r--  1 zach zach     124 Apr  7 21:46 .bashrc
-rw-------  1 zach zach     662 Aug 14 17:55 dead.letter
-rw-r--r--  1 root root  608654 Mar  1  2006 dhcp-3.0.2-34.FC4.i386.rpm
-rwxrw-r--  1 zach zach      72 Oct  2 17:38 gtcdb
-rw-r--r--  1 zach zach     120 Apr  7 21:46 .gtkrc
drwxr-xr-x  8 zach zach    4096 Oct  2 16:56 infobot-0.45.3
-rw-rw-r--  1 zach zach  112346 Aug  4  2004 infobot-0.45.3.tar.gz
-rw-rw-r--  1 zach zach   12709 Apr 14 21:17 infobot-0.45.3.tar.gz?download
-rw-------  1 zach zach     991 Sep 25 23:40 .mysql_history
-rw-r--r--  1 root root 3125693 Apr  7 23:08 pine-4.64-1.i386.rpm
drwxrwxr-x  2 zach zach    4096 Oct  3 09:40 sample
-rw-r--r--  1 zach zach     658 Apr  7 21:46 .zshrc
<prompt>cd sample
<prompt>ls -la
total 28
drwxrwxr-x  2 zach zach 4096 Oct  3 09:40 .
drwxr-xr-x  4 zach zach 4096 Oct  3 09:38 ..
-rw-r--r--  1 zach zach 5515 Oct  3 09:40 dumb.png
Where "zach" is my username, "sample" is a directory I just created, and "dumb.png" is a file I just tried to upload with the WinXP command line FTP client, like so:

Code:
>ftp 192.168.1.254
Connected to 192.168.1.254.
220 (vsFTPd 2.0.3)
User (192.168.1.254:(none)): zach
331 Please specify the password.
Password:
230 Login successful.
ftp> put dumb.png
200 PORT command successful. Consider using PASV.
553 Could not create file.
ftp> cd sample
250 Directory successfully changed.
ftp> put dumb.png
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 File receive OK.
ftp: 5515 bytes sent in 0.00Seconds 5515000.00Kbytes/sec.
ftp> quit
221 Goodbye.
Hope this is what you're looking for.
 
Old 10-07-2006, 05:42 PM   #5
Evil Otto
LQ Newbie
 
Registered: Jul 2006
Posts: 8

Original Poster
Rep: Reputation: 0
The culprit was SELinux. Once I disabled that all was fine. Replying here so if someone else has the same problem they'll see a possible solution.

I'll have to go and reconfigure it later so I can turn it back on. Not a hugely security-sensitive environment, but I should be running it all the same.
 
Old 10-08-2006, 10:21 AM   #6
jlgreer1
Member
 
Registered: Aug 2005
Location: Under the rainbow
Distribution: LFS 7, CentOS 7, OS X
Posts: 119

Rep: Reputation: 25
Please post the SELinux configuration here after it is satisfactory.

Thank you,
fos....
 
Old 12-07-2010, 01:05 PM   #7
Justin.Buser
LQ Newbie
 
Registered: Aug 2007
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by Evil Otto View Post
This is a strange one.

I've gotten vsftpd running, and I can log in. However, when I try to put a file to my default directory (/home/$user) I get a "553 Could not create file." from my client. However, when I switch to a subdirectory (/home/$user/directory) I can put a file there. Permissions appear identical on both directories.

Any thoughts?
This is most likely an SELINUX issue, you can either disable selinux (not recommended in a production environment) or execute the following command as root:
setsebool -P ftp_home_dir=1

That will allow ftp users to write to their home dirs.
 
  


Reply



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
anonymous users can't upload files-vsftpd dx0r515t Linux - Networking 3 11-21-2012 12:09 AM
can't upload large files with vsftpd ~help redhatattack Linux - Newbie 5 08-01-2006 06:17 PM
Mac user cannot upload files,vsftpd frankotse Linux - Networking 1 07-06-2005 03:16 PM
unable to upload files with RH9 & Vsftpd ToBe Linux - Networking 1 10-27-2003 04:41 PM
vsftpd home directory Harpune Linux - Networking 2 03-16-2003 10:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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