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

x
?
Solved

ubuntu 10.04 - how to give user access to folder

Posted on 2011-09-10
7
Medium Priority
?
377 Views
Last Modified: 2012-05-12
Hi,

I am the root of my computer and there is a folder at /csd. Unfortunately, everytime i need to access the folder, i need to login as root.
This is the permissions for the folder : drwxr-xr-x    root root

How, I do i change it so that i have read write excute access it . Thanks.
0
Comment
Question by:zizi21
[X]
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
7 Comments
 
LVL 21

Expert Comment

by:Papertrip
ID: 36517863
chown -R yourusername /csd

Open in new window

0
 
LVL 12

Expert Comment

by:Steve
ID: 36517864
chmod 777 csd

that'll give everyone full access to read/write to that folder - INCLUDING anonymous users..

this can be a security risk though if its internet writable.. a 'chmod 775' will give the logged in user write access.. but not anonymous users..

0
 
LVL 21

Accepted Solution

by:
Papertrip earned 2000 total points
ID: 36517870
or
chown -R username:groupname /csd

Open in new window

or
chmod 777 /csd

Open in new window




The best option is
chown -R username:groupname /csd

Open in new window

, but you need to know a group you are in, usually your primary group is the best choice but that totally depends on how the files will be accessed/used.

Your primary group should be the first one listed from the command 'groups'
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 21

Expert Comment

by:Papertrip
ID: 36517875
-R is for recursive, so you don't end up just changing ownership/perms on the directory but instead get everything underneath as well.
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36517883
a 'chmod 775' will give the logged in user write access.. but not anonymous users..

For this situation that will only work if the user is in group 'root'.
0
 
LVL 7

Expert Comment

by:boon86
ID: 36517968
i use:

chown -Rf username:groupname /csd

Open in new window

recursive for each files and folder inside /csd

then chmod +x /csd or chmod 755 /csd

if you plan to use it on web server like nginx or lighttpd, you need to do like this:

First, you had to grant access to your home directory:

setfacl -m u:yourusername:rx /csd


Next, you had to grant access to your static app:

setfacl -R -m u:yourusername:rx /csd

0
 

Author Comment

by:zizi21
ID: 36518673
thanks a million
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

604 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