LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-11-2006, 05:19 PM   #1
ajd344
LQ Newbie
 
Registered: Apr 2006
Distribution: Kubuntu,Ubuntu (also Xandros,DSL)
Posts: 17

Rep: Reputation: 0
Smile Need to get command for folder permissions


Hey! I'm running Ubuntu. I have a folder in the /opt/ folder I need to make full-access. Can you give me a command that makes it full-access (read,write,etc.) INCLUDING subdirectories? I guess it would be for everyone (if possible), but if it has to be something it would be user 'andrew'.

Thanks!
 
Old 10-11-2006, 05:29 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
chmod -R 777 /opt/whatever

really not likely to be a great solution to whatever problem you have though... you might want to explore your underlying requirements.
 
Old 10-11-2006, 08:28 PM   #3
ajd344
LQ Newbie
 
Registered: Apr 2006
Distribution: Kubuntu,Ubuntu (also Xandros,DSL)
Posts: 17

Original Poster
Rep: Reputation: 0
Smile

Thanks, that worked! I want to make sure I'm doing this right. I'm running a webserver (xampp), and PHP was having troube, and exploring it from my windows pc to the server (samba), premissions would get messed up.

So, it making the directory full-access a good solution to this problem? I need full access to work on my site through samba.

Gracias!
 
Old 10-12-2006, 06:52 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
World writable permissions are typically not a good idea.
Set the permissions to "770" for starters. "2770" may be better even.
And give them an appropriate user/group as owner.
Samba will access the files as some user/group, so you'll only need to give "full" access to that user/group.

Make also sure that the user under which your webserver runs has read access to the files (for your website).
 
Old 10-12-2006, 03:18 PM   #5
ajd344
LQ Newbie
 
Registered: Apr 2006
Distribution: Kubuntu,Ubuntu (also Xandros,DSL)
Posts: 17

Original Poster
Rep: Reputation: 0
OK, I understand this so far. I access smb through user 'andrew', which is also the user in which the server runs. Can you give me a command that will set 770 or 2770 (whats the difference, anyway?) for just andrew? Thanks!
 
Old 10-13-2006, 03:03 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Read = 4, Write = 2 and Execute = 1.
7 = 4 + 2 + 1 = rwx (read-write-execute).
0 = no permission.
Permissions are usually given in 3 such digits: one for the user that owns the file/dir, one for the group and one for everyone else.
So, 770 simply means full access to user/group, no access at all for anyone else.
The 2 in front indicates the setGID permission bit. This bit sets the Group ID (the numerical representation of a group) whenever the directory is executed (ie when someone searches through the directory or adds/deletes a file).
This will have the effect that all newly created files will automatically be owned by the group that owns the directory itself. This in turn has some benefits relating to access for website admins.

Use "chown" to make the directory owned by "andrew". Then use "chmod" with permission 770, 2770 or even more strict (ie 750).

If you're not comfortable using the octal representation of permissions, you can use the character representations too. See man chmod for details.
Example:
chmod -R u+rwx some_dir
gives the user (owner) rwx permissions.
 
  


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
permissions difference between /home/..../folder and /root/folder darkleaf Linux - General 3 07-21-2005 06:23 PM
folder Permissions issinho Linux - Security 3 07-10-2005 03:35 PM
folder permissions steve007 Linux - Newbie 1 06-30-2005 01:46 PM
Folder permissions Canam97 Mandriva 7 03-11-2005 12:01 AM
Folder permissions help Seventh Linux - Newbie 2 04-22-2004 06:56 PM


All times are GMT -5. The time now is 03:11 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration