I have everyone restricted to their home folder via FTP. Within each home I have a public_html directory which I'm not able to upload to.
I have added my user source
to the ftp group. the public_html folder is...
drwxrwsr-x 2 source ftp 4096 public_html
I'm not sure why I'm not able to upload files. What am I doing wrong with permissions?
update
The VSFTPD logs read:
- TIMESTAMP - [pid 2] CONNECT: Client "xx.xxx.xx.xx"
- TIMESTAMP - [pid 1] [user] OK LOGIN: Client "xx.xxx.xx.xx"
update
SmartFTP returns the error:
[18:36:52] SIZE index.php
[18:36:52] 550 Could not get file size.
update
Smart FTP Logs
[23:15:31] TYPE I
[23:15:31] 200 Switching to Binary mode.
[23:15:31] SIZE index.php
[23:15:31] 550 Could not get file size.
[23:16:02] SIZE index.php
[23:16:02] 550 Could not get file size.
[23:16:32] SIZE index.php
[23:16:32] 550 Could not get file size.
[23:17:02] SIZE index.php
[23:17:02] 550 Could not get file size.
[23:17:32] SIZE index.php
[23:17:32] 550 Could not get file size.
[23:18:02] SIZE index.php
[23:18:02] 550 Could not get file size.
[23:18:12] DELE index.php
[23:18:12] 550 Permission denied.
[23:18:12] DELE test.php
[23:18:12] 550 Permission denied.
[23:18:19] TYPE A
[23:18:20] 200 Switching to ASCII mode
The FTP logs simply show login success messages, which user and which IP they're from.
Permissions of public_html
drwxr-sr-x 2 source ftp 4096 2010-08-15 18:40 public_html
even when public_html is 777 I'm unable to write to it.
Please check you have write_enable=YES in your vsftpd.conf
You can su(do) to the user and try making the file by hand, that should rule out filesystem permission errors.
Could you post the full log from smartftp and perhaps your vsftpd.conf?
I suspect that your homedirs are not globally executable or readable, hence it's not the publc_html directory that's the problem, but rather one of its parent directories. What are their perms?
Is this a redhat based system with selinux enforced? Type:
getenforce
and let us know what it says, if it's enforcing you need to specifically allow FTP users to access their home directories:setsebool -P ftp_home_dir=1
Also, can you access the home directories as the user? It sounds stupid but the permissions might be wrong. SSH in as root and try:
su - username
It should automatically go into their home directory, then cd into public_html and verify with
pwd
and cd into the directory if not. If you can't permissions issues.Next, try to write a file:
echo "test" >> test.txt
if it doesn't work, again permissions issues.I know you say you've tried 777 permissions, but neither of your two ls examples above show 777 (rwxrwxrwx). Of course this shouldn't be needed, but it might be useful to rule out this possibility.
Another thing is, you might need to add the STOR command to the cmds_allowed directive if you have one and that command is not already there.
A reasonably comprehensive list is probably something like
cmds_allowed=ABOR,CWD,LIST,MDTM,MKD,NLST, PASS,PASV,PORT,PWD,QUIT,RETR,RMD,RNFR, RNTO,SITE,SIZE,STOR,TYPE,USER,ACCT, APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST