Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Easy - How to change user permissions

Posted on 2004-10-30
Medium Priority
Last Modified: 2013-12-16
Vanilla Debian Install:
Should be very simple. How do I change user permissions?
I know chmod and chown.
You can give user,rights, and other permissions.
How do I specify the actual user that is getting the rights, or the actual group?
In windows you say you want a specific user to have specific rights.

I can type chmod u+w file.txt and that will give write access to the user....which user? The user thats logged in? That's root then.

My problem is I have a webserver, apache. I need to secure all web files but make it so only the root and the user 'ftp' can have full and total access to them.

I did some playing around and probably screwed up the files, so to redo it would be the best.

chmod ugo-rwx /var/backhand/htdocs would take away all access right?
Then I should build up from there to do it correctly. The webuser (www) should have read access, right?, and the root/ftp user should have god rights. I have searched and searched, i think its the concept I don't have.

No one logs into this box besides me with root, i know its bad, and ftp with a client, and www from the internet.
Question by:undy30
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 40

Accepted Solution

jlevie earned 340 total points
ID: 12453992
'chmod u+w file.txt' gives the current owner (user) of the file write permissions. To set the owner you can (as root) use 'chown some-user file.txt'.

What you probably want to do for the web site content is to execute:

chown ftp file.html
chmod 644 file.html

That will make the site files owned by ftp and readable by group and other. Being readable by other will be necessary for the web server to work.

Author Comment

ID: 12454015
Ok. So that works. But what if I add another use who wants to do updates later?
Would I make them the owner and then change the rights? Or would I be forced to make a group  and assign them the group rights?

Also I have many folders, how can I chown them all at once.
I do chown ftp /var/backhand/* and it works, but it doesn't flow down through each folder.
LVL 40

Expert Comment

ID: 12454057
There can only be one owner of a file system object. To have multiple users be able to write/delete files you'd want both users to be in the same group and give group write perms (chmod g+w).

chmod, chown, and chgrp can do recursive options, like 'chgrp -R ...'

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question