Avatar of Computer Guy
Computer Guy

asked on 

Linux Permissions Issue (Can't Upload)

My user is tom.

my folder structure is setup like such:

/var/www/domain1.com/public_html

/var/www/domain1 are set as root:root.
public_html is set to www-data:www-data

I added my user tom to www-data (and did login/logoff)

When I attempt to upload to public_html, I get an access denied error.

What do I need to do to upload to this folder?
LinuxLinux NetworkingLinux Security

Avatar of undefined
Last Comment
Robert
ASKER CERTIFIED SOLUTION
Avatar of Robert
Robert
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Computer Guy
Computer Guy

ASKER

Currently is is set to:

drwxr-xr-x  www-data www-data public_html

What permission number is drwxrwxr-x
Avatar of gheist
gheist
Flag of Belgium image

You dont want any writable file in web-reachable place.
Suhosin,selinux and apparmor are all well trained against such files.
Avatar of Computer Guy
Computer Guy

ASKER

In this case I am in the middle of uploading some files locally to server via sftp. Is there a better way in this case?
Avatar of gheist
gheist
Flag of Belgium image

If you have huge collection of files rsync is better, but you are close to perfection.
Avatar of Robert
Robert
Flag of United States of America image

You can use chmod to change permissions:

chmod 775 on the directory will give user and group full permissions, while everyone else is given only read and execute.

To apply this change recursively, you can to the following:

cd /var/www/domain1.com && chmod -R 775 public_html
Linux
Linux

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

71K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo