LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 10-02-2017, 03:39 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post 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.
 
Old 10-02-2017, 03:59 AM   #2
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
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.
 
Old 10-02-2017, 05:04 AM   #3
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,918

Rep: Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237
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
Code:
chmod u+rwx test
to make clear it is for the user only.

Last edited by MadeInGermany; 10-02-2017 at 05:08 AM.
 
Old 10-02-2017, 05:46 AM   #4
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 383Reputation: 383Reputation: 383Reputation: 383
Try it, then post, in code tags, what you get from: ls -alR test
 
Old 10-02-2017, 05:55 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,702

Rep: Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536
just a comment: x is not execute permission on directories, but search permission.
 
Old 10-02-2017, 07:28 AM   #6
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Quote:
Originally Posted by !!! View Post
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
 
Old 10-02-2017, 07:28 AM   #7
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Quote:
Originally Posted by MadeInGermany View Post
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
Code:
chmod u+rwx test
to make clear it is for the user only.
Thus, My steps were OK?
 
Old 10-02-2017, 07:44 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,702

Rep: Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536Reputation: 7536
yes
 
Old 10-07-2017, 02:45 AM   #9
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on "qscan" (used by "qpxtool" for scanning DVD/CD burn quality) haertig Linux - Software 1 02-10-2013 07:16 PM
[SOLVED] A "DropBox" question, error: Can't sync:".directory":access denied. Robert.Thompson Slackware 4 08-25-2011 09:02 AM
Python: how do you accomplish "chmod 2755 somedir" - os.chmod not working as expected BrianK Programming 2 11-29-2010 03:03 PM
newbie question: whats the difference between "su root", "su" and "su -&quo mojarron Slackware 9 12-07-2009 04:08 PM
Logged in as "root"/Fedora 8 but get "Operation not permitted" when using "chmod etc gosunlee Linux - Newbie 7 02-10-2008 05:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration