Celeb Glow
news | March 23, 2026

Permission denied in FTP even though I'm the owner

Okay, so I've tried my best at finding the answer to this by searching and looking through possible duplicates, but I just can't so forgive me if it's out there somewhere anyways.

My issue is as follows. I've set the owner of /var/www to myuser:www-data and permissions of the folder and all (currently just the basic index.html) it's content to 750, and Apache seems to run it as supposed, but I can't access it when I FTP into the server as the myuser user. I mean, I can access it, but as soon as I try to edit, delete or add something I just get 500 Permission denied, and if I try to edit the permissions I get 500 Unknown SITE command.

Help! What do I do wrong? The idea on setting the user and group, and then the permissions as above was from a good friend of mine who is sort of an expert, but I feel like I'm bothering him when I ask so many questions, so if you can help me some more, that would be great!

I'm trying to put a backup with 4 vhosts back into the www-folder, but what I put there shouldn't be of any concern, right? That's just the confing of the vhosting later that has got anything to do with that, right?

Thanks in advance!

Added info:

I ran this: myuser@myserver:/$ groups myuserAnd got this: myuser : myuser adm cdrom sudo dip plugdev lpadmin sambashareThen I ran this: myuser@myserver:/$ groups www-dataAnd got this: www-data : www-data

And then this: myuser@myserver:/var/www$ ls -lAnd got this: total 4 -rwxr-x--- 1 tjita1 www-data 177 Jan 25 17:45 index.html

Regarding the ftpserver, I didn't do anything in particular, I just installed vsftpd. Oh yeah, I also added a line in I think /etc/vsftpd.conf or something like that, that reads something like this: chmod_enable=YES.

Also, I can't get those 4-space-indents to work, sorry about that..

2

4 Answers

After you install the ftp server with sudo apt-get install vsftpd you will have to configure it. To enable write access you have to edit the /etc/vsftpd.conf file and uncomment the

#write_enable=YES

line, so it should read

write_enable=YES

Save the file and restart vsftpd with sudo service vsftpd restart.

For other configuration options consult this documentation or man vsftpd.conf

3

A simple way I found to use ftp with curl command here. If you wanna use ftp with a single command than use the following command

sudo curl -T file_to_be_uploaded.txt ftp:// --user username:password

If you get an error 551: permission denied than run it the file you are uploading might be present on the remote and you don't have permission to overwrite it. So upload it with a different file name or delete the current file on the remote.

I had the same problem & none of the suggestions about Write_enable or folder permissions worked. I changed my connection type in my FTP client from FTP to SSH/SFTP, and everything worked fine. Apparently, VSFTPD requires a secure connection to write.

1

Run below command - which folder you require files to upload

sudo chown -R <>:root <> example

sudo chown -R myloginid:root /home/myproject

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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