Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I keep getting a "permission denied" error on my /var/www/html/ via ftp.

Checking permissions (ls -l) on the directory has this output:

total 0

Yet, checking the permissions on 1 level above:

drwxrwxr-x   2   ftpuser   user_group   html

This appears to be right...

Why would I have two different ls -l outputs for the same directory?

Also, if I run WinSCP, I get Owner = 0 for the directory.


Here is the vsftpd.conf: http://codepad.org/CCfcyCnO

Here is the approved user_list. "alxvallejo" is what I added: http://codepad.org/XOHI4Icp

Currently, I can login only as root.

share|improve this question
    
Which ftp daemon are you using ? What credentials are you logging in with and how do they relate to the permissions on the directory ? –  Iain Mar 12 '12 at 19:15
    
I'm using vsftpd. The users are the same for when I login ftp and when I list permissions. The group is what throws me off... –  AlxVallejo Mar 12 '12 at 19:23
    
Can you post as an edit to the question the contents of your vsftpd.conf please. –  Iain Mar 12 '12 at 19:25
    
Sure, see edit. Thanks –  AlxVallejo Mar 12 '12 at 19:40
add comment

2 Answers

ls -l gives you the contents of the given directory. So when you do ls -l /var/www/html/ it will give you the contents of /var/www/html/. If you want to see the directory itself do this: ls -ld /var/www/html/.

Also, keep in mind that your FTP daemon can have additional ACLs setup beyond the unix level user/group permissions. You may want to check the ftp configuration to make sure it allows writing to /var/www/html/.

share|improve this answer
    
hm, vsftpd.conf doesn't seem to list any directories at all in the file –  AlxVallejo Mar 12 '12 at 19:14
    
Are you using the anonymous user? –  Kyle Mar 12 '12 at 19:16
    
anonymous_enable=NO –  AlxVallejo Mar 12 '12 at 19:20
    
Have you tried uploading a file using SCP via WinSCP? Is there a reason you need ftp when scp and sftp is more secure? Permissions are much easier to fix and track down with those. –  Kyle Mar 12 '12 at 19:24
    
Ya, I get the same error in WinSCP. Keep in mind I'm binding the html folder to the home/ftpuser/ directory. That shouldn't matter since permissions are carried over. –  AlxVallejo Mar 12 '12 at 19:28
add comment

ls -l just lists of the contents of the working directory. Since the directory is empty, it returns total 0.

Since the wwww directory is in /var/www, a ls -l from /var/www is going to show you the permissions of the each file and directory in /var/www.

The command you want to run FROM /var/www/thml is ls -ld

Your ftp server might be configured to only permit uploads to a specific directory.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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