LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 09-11-2015, 11:01 AM   #1
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Rep: Reputation: Disabled
Assigning rights of a specific directory to user


Hello,

I am using CentOS

How can I assign 777 permissions of a specific directory to a particular user?

Thanks in anticipation
 
Old 09-11-2015, 12:03 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Make that user the owner and give the owner full rights.
 
Old 09-11-2015, 12:06 PM   #3
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled
You mean
Code:
chown :userName /tmp/foldername
chmode 777 /tmp/foldername
Thanks again
 
Old 09-11-2015, 12:24 PM   #4
hortageno
Member
 
Registered: Aug 2015
Distribution: Ubuntu 22.04 LTS
Posts: 240

Rep: Reputation: 67
Quote:
Originally Posted by Raakh5 View Post
You mean
Code:
chown :userName /tmp/foldername
chmode 777 /tmp/foldername
Thanks again
If it's 777 then the user doesn't matter anyway.

BTW "chown :username ..." would change the group since the argument is "[OWNER][:[GROUP]]".

Code:
man chown
 
Old 09-11-2015, 12:26 PM   #5
hortageno
Member
 
Registered: Aug 2015
Distribution: Ubuntu 22.04 LTS
Posts: 240

Rep: Reputation: 67
Quote:
Originally Posted by hortageno View Post
If it's 777 then the user doesn't matter anyway.

BTW "chown :username ..." would change the group since the argument is "[OWNER][:[GROUP]]".

Code:
man chown
BTW2: 777 is almost never the right thing to do...
 
Old 09-11-2015, 12:26 PM   #6
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled
Can you please give me any code example?
 
Old 09-11-2015, 12:42 PM   #7
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
To only give permission to one user and noone else:

Code:
chown userName /tmp/foldername
chmod 700 /tmp/foldername
 
1 members found this post helpful.
Old 09-11-2015, 12:44 PM   #8
hortageno
Member
 
Registered: Aug 2015
Distribution: Ubuntu 22.04 LTS
Posts: 240

Rep: Reputation: 67
Quote:
Originally Posted by Raakh5 View Post
Can you please give me any code example?
Just don't use the colon. If you use a colon, then the expression after it is the group.

[spoonfeed]chown userName /tmp/foldername[/spoonfeed]
 
1 members found this post helpful.
Old 09-11-2015, 01:55 PM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by Raakh5 View Post
How can I assign 777 permissions of a specific directory to a particular user?
That question is self-contradictory.

777, by definition, is global access for anybody. The first 7 is the owner of the file, the second 7 is any members in the same group as the file, the third 7 is "everybody else". If you want to limit access to a particular user, you need to make that user the owner, and then change the permissions to 700, to cut off access for anybody but the owner.
 
  


Reply



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
[SOLVED] New user with own rights, should only can access to his own directory and processes Sebi94 Linux - General 5 07-21-2012 07:52 PM
User rights setup, Tomcat and Apache users both need access to a directory zeeshan12 Linux - Server 6 11-10-2011 05:38 AM
/home rights for Active Directory user? cwhitmore Linux - Security 1 09-22-2006 12:57 PM
power mgmt and assigning rights ej1155 Linux - Newbie 1 06-23-2004 12:02 AM
Giving a user CHMOD rights to the /var/www/html directory? scubes13 Linux - Networking 3 08-18-2002 03:38 PM

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

All times are GMT -5. The time now is 05:15 PM.

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