Solved

ubuntu 10.04 - how to give user access to folder

Posted on 2011-09-10
7
365 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now