LinuxQuestions.org
Visit Jeremy's Blog.
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 03-22-2006, 07:54 AM   #1
imsam
Member
 
Registered: Dec 2003
Posts: 64

Rep: Reputation: 15
Basic chmod question


I did some reading on this but still not clear.

How do I give the user sam both read and write privileges to folder /var/www/html/sams_website?
 
Old 03-22-2006, 08:00 AM   #2
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Rep: Reputation: 30
Hi

Do the following

If user sam is the owner of the directory

# chmod 755 /var/www/html/sams_website

If user sam is just a user

# chmod 775 /var/www/html/sams_website
 
Old 03-22-2006, 08:25 AM   #3
imsam
Member
 
Registered: Dec 2003
Posts: 64

Original Poster
Rep: Reputation: 15
sam is not the owner

My problem is sam is not the owner of the directory.

1. Do I need to make sam the directory owner for me to give that account read and write access

2. If I do, how do I make sam the owner of the directory?
 
Old 03-22-2006, 08:33 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by shawnbishop
Hi

If user sam is just a user

# chmod 775 /var/www/html/sams_website
This **might** work---some clarification:

The permissions are in the order: owner, group, others Thus, the above command gives full privileges to the owner and the group. This will work only if Sam is a member of the file's assigned group.

To give access to any user: chmod 777

To give access to ONLY Sam, where he is not the owner of the file, then Sam would have to be the only member of the file's group

If you're wondering what all the numbers mean:
for each digit: 4=read, 2=write, 1=execute
7= full privilege
6= read/write only
5= read/execute only
etc.
 
Old 03-22-2006, 10:26 AM   #5
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
if Sam is to have complete control over the directory, make him the owner:

Code:
chown sam <directory>
that way you can set permissions 755 - rwx for owner, rx for group (need these to view a dir), rx for everyone else (probably needed as it's for a website).

777 isn't recomended before you do that for ease
 
  


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
chmod question Napalm Llama Linux - General 2 06-17-2005 09:17 AM
chmod question tongar Linux - Newbie 2 01-30-2005 02:43 PM
chmod -R question spooge Linux - General 2 01-13-2005 02:58 PM
chmod Question Rawr101 Linux - General 1 09-19-2004 03:17 AM
Question regarding chmod Yohhan Linux - Software 3 01-26-2003 02:24 AM

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

All times are GMT -5. The time now is 10:03 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