Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-02-2017, 03:39 AM
|
#1
|
Senior Member
Registered: Jan 2015
Posts: 1,432
Rep:
|
A question about "chmod".
Hello.
If I want to give a directory read,write and execute permission for "jason" user then first of all I must change the owner of directory to "jason" user then use "chmod +rwx directory name" ?
Code:
# chown -R jason test
# chmod +rwx test
Am I on a right track?
Thank you.
|
|
|
10-02-2017, 03:59 AM
|
#2
|
Member
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567
|
Yes, the "+rwx" will cause r, w and x to be added to the permissions of test/ for every user/group owners, subtracting the dmask.
Or another solution could be to make a specific group own the directory, add rwx for the group owners and finally add user "jason" to that group.
|
|
|
10-02-2017, 05:04 AM
|
#3
|
Senior Member
Registered: Dec 2011
Location: Simplicity
Posts: 2,918
|
Be carefull not to follow symlinks!
First do
Code:
chown -hR jason test
if this gives a syntax error, fall back to without -h (then your chown is an old GNU or BSD version)
I usually do
to make clear it is for the user only.
Last edited by MadeInGermany; 10-02-2017 at 05:08 AM.
|
|
|
10-02-2017, 05:46 AM
|
#4
|
Member
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997
|
Try it, then post, in code tags, what you get from: ls -alR test
|
|
|
10-02-2017, 05:55 AM
|
#5
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,702
|
just a comment: x is not execute permission on directories, but search permission.
|
|
|
10-02-2017, 07:28 AM
|
#6
|
Senior Member
Registered: Jan 2015
Posts: 1,432
Original Poster
Rep:
|
Quote:
Originally Posted by !!!
Try it, then post, in code tags, what you get from: ls -alR test
|
Code:
drwxr-xr-x. 3 jason jason 17 Oct 2 12:38 test
|
|
|
10-02-2017, 07:28 AM
|
#7
|
Senior Member
Registered: Jan 2015
Posts: 1,432
Original Poster
Rep:
|
Quote:
Originally Posted by MadeInGermany
Be carefull not to follow symlinks!
First do
Code:
chown -hR jason test
if this gives a syntax error, fall back to without -h (then your chown is an old GNU or BSD version)
I usually do
to make clear it is for the user only.
|
Thus, My steps were OK?
|
|
|
10-02-2017, 07:44 AM
|
#8
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,702
|
yes
|
|
|
10-07-2017, 02:45 AM
|
#9
|
Senior Member
Registered: Jan 2015
Posts: 1,432
Original Poster
Rep:
|
Thank you.
|
|
|
All times are GMT -5. The time now is 08:21 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|