Question

SFTP Server says you do not have the required permissions. "Permission denied"

Hello everyone, I’m having problems editing files in my droplet using Fetch, everything was working fine before until today… I’m basically trying to edit my style sheet but it’s not letting me edit it because i apparently don’t have the required permissions. I am able to access and view all my files and copy them to my desktop via Fetch using my SSH key, however i’m unable to delete or edit anything. When i look at the info of the folders, under ownership and permissions it displays that my current user can Read, Write, and Execute. Group: www-data same thing Read, Write, and Execute. Others : Read and Execute.

Any help is appreciated! Thanks.

Subscribe
Share

Okay i think i may have fixed my problem… Ran this… sudo chown myuser:www-data /var/www/html/wp-content changed priviledges sudo chown www-data:myuser /var/www/html/wp-content Then… sudo service ssh restart

I feel like I’ve done this before but for some reason it wasn’t working until i ran that in the terminal again, now i’m able to edit and delete files without a window popping up about not having permission.

I’m logging in by a user i created to login with an SSH key instead of root. I disabled root login by editing vi /etc/ssh/sshd_config. Permitrootlogin no. I believe i followed either this video or something similar to this. https://www.youtube.com/watch?v=EuIYabZS3ow

This is only affecting my users, not my root. I am able to edit and do anything as root, however it seems i can only login and view my files but not edit even though i believe i have given my user root privileges.

Which user are you logging in as via SFTP?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This question was answered by @EduardoMartinezDesign:

Okay i think i may have fixed my problem… Ran this… sudo chown myuser:www-data /var/www/html/wp-content changed priviledges sudo chown www-data:myuser /var/www/html/wp-content Then… sudo service ssh restart

I feel like I’ve done this before but for some reason it wasn’t working until i ran that in the terminal again, now i’m able to edit and delete files without a window popping up about not having permission.

View the original comment