Solved

ubuntu 10.04 - how to give user access to folder

Posted on 2011-09-10
7
370 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
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 500 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
Postfix issues with spam/auth attempts under NAT 9 138
Upgrade BIOS / EUFI at Scale 4 71
IMAP copying tool 14 49
Shrink Linux Swap File Size CentOS 10 30
Fine Tune your automatic Updates for Ubuntu / Debian
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will giveā€¦
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.:
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.

726 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