LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-01-2019, 09:56 AM   #1
bulgin
Member
 
Registered: Mar 2010
Posts: 74

Rep: Reputation: Disabled
Local web server unable to view images file perimssions confusion


Hello.

I have a local development web server in which the file properties are set to wwww-data:www-data for the server to work and everything works fine.

However, when doing administrative work using Nautilus file manager, it is very frustrating to go into directories that have image files in which I need to tweak them, and having no access to file (see attached images with permissions).

What kind of permissions/ownership must I use so that 1) the server is safe from hacks when migrated to a public server and 2) that allow me as a logged in user (not root) to view the images (and thus alter them through image editing software)?

should I become a part of the www-data group?

The directories are 755 and the files are 644.

Thank you.
Attached Thumbnails
Click image for larger version

Name:	photos.jpg
Views:	20
Size:	85.0 KB
ID:	29364   Click image for larger version

Name:	permissions.jpg
Views:	17
Size:	35.5 KB
ID:	29365  

Last edited by bulgin; 01-01-2019 at 09:57 AM. Reason: add photos
 
Old 01-01-2019, 10:22 AM   #2
bulgin
Member
 
Registered: Mar 2010
Posts: 74

Original Poster
Rep: Reputation: Disabled
I noticed that in the directories with the inaccessible image files, that the file permissions were 660 not 644. I changed to 644 and now I can edit them.

I also added my personal user to the www-data group.

Please advise if the above is safe.

Thank you.
 
Old 01-02-2019, 01:01 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by bulgin View Post
I noticed that in the directories with the inaccessible image files, that the file permissions were 660 not 644. I changed to 644 and now I can edit them.

I also added my personal user to the www-data group.

Please advise if the above is safe.

Thank you.
I guess you mean 664, so your user's www-data group has write permissions on these files.
I'd suggest you to revert back permissions to 644 and change the ownership of these files to your user. Of course that means that you're not going to edit these files via the webserver.

Regards
 
Old 01-02-2019, 05:39 AM   #4
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by bulgin View Post
should I become a part of the www-data group?

The directories are 755 and the files are 644.
Which means that for both directories as well as files the GROUP doesn't have write permission (both are readonly for others than the owner).
Becoming part of the group thus won't give you any extra rights.

What the other reply (#5) suggested: make everything OWNER your user and GROUP www-data and leave the permissions as above.
Then YOU (as owner) are the only one who can change them and the webserver only has READ permission and thus cannot change things, which actually is more secure.
If you got an upload capability, let those go to a single directory which is still owned by www-data, so that (only) there the webserver can store files.
 
  


Reply

Tags
permissions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get local htdocs images to show on a web page. Usalabs Linux - Server 14 07-10-2012 08:17 PM
Embed web cam images in web page secondhandman Linux - Newbie 1 06-30-2012 08:46 PM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 07:11 PM
web server, unable to view test page gigya Linux - Software 1 01-30-2004 10:34 AM
cannot view web page from local lan Tigger Linux - Networking 4 05-31-2003 01:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration