Solved

ubuntu 10.04 - how to give user access to folder

Posted on 2011-09-10
7
369 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.:
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…

837 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