LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-10-2011, 10:23 PM   #1
sspiro
Member
 
Registered: Jun 2002
Location: Tampa, FL
Distribution: Debian Lenny
Posts: 39

Rep: Reputation: 15
Stupid chmod/permissions question..


I always seem to confuse the hell out of myself when doing permissions..

I need to allow a user (named "user", member of the "ftp" group) full read/write/execute access to the /var folder for ftp'ing.

What is the best chmod command to run to accomplish this task? I can't seem to get it riht..
 
Old 01-10-2011, 10:40 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
To the entire /var directory ??? .. probably not ideal, can you restrict to say /var/ftp or something ? .. if you cant it may be better to use an acl to give the user access
 
Old 01-10-2011, 10:45 PM   #3
sspiro
Member
 
Registered: Jun 2002
Location: Tampa, FL
Distribution: Debian Lenny
Posts: 39

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by kbp View Post
To the entire /var directory ??? .. probably not ideal, can you restrict to say /var/ftp or something ? .. if you cant it may be better to use an acl to give the user access
If not the /var directory, then the /var/www

It's for my own usage, for setting up my webserver at home, etc. After i'm done transfering files and setting up, etc i'll disable the access and the ftp account.

But for now, i can't ftp in to my box and accomplish what I want and its frustrating me.
 
Old 01-10-2011, 10:52 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Take a look at 'man setfacl' ... let us know if you need help

cheers
 
Old 01-10-2011, 11:02 PM   #5
sspiro
Member
 
Registered: Jun 2002
Location: Tampa, FL
Distribution: Debian Lenny
Posts: 39

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by kbp View Post
Take a look at 'man setfacl' ... let us know if you need help

cheers

I have no exposure to acl's at all.. So yes, help would be awesome.
 
Old 01-11-2011, 06:26 AM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Basically you can use acl's to provide access to files and directories without changing the base UGO permissions

eg.
Code:
[me@xxxxxx tmp]$ mkdir -p blah/test/test2/crapola
[me@xxxxxx tmp]$ ls -ld blah/
drwxrwxr-x. 3 me me 4096 Jan 11 23:11 blah/
[me@xxxxxx tmp]$ getfacl blah
# file: blah
# owner: me
# group: me
user::rwx
group::rwx
other::r-x

[me@xxxxxx tmp]$ setfacl -Rm u:testuser:rwx blah
[me@xxxxxx tmp]$ getfacl blah
# file: blah
# owner: me
# group: me
user::rwx
user:testuser:rwx
group::rwx
mask::rwx
other::r-x

[me@xxxxxx tmp]$ getfacl blah/test
# file: blah/test
# owner: me
# group: me
user::rwx
user:testuser:rwx
group::rwx
mask::rwx
other::r-x
The '-m' argument is modify and the '-R' means recursive, to remove an acl use '-x' or '-b' to remove all extended acl's. So to provide access to /var/www for user 'user', you could run 'setfacl -Rm u:user:rwx /var/www' and an 'ls -ld /var/www' wouldn't look any different, the same UGO permissions would be present.

Hope this is clear enough, cheers

Last edited by kbp; 01-11-2011 at 06:27 AM.
 
Old 01-11-2011, 07:29 AM   #7
sspiro
Member
 
Registered: Jun 2002
Location: Tampa, FL
Distribution: Debian Lenny
Posts: 39

Original Poster
Rep: Reputation: 15
It is; it's beautiful. Thanks for the help!!!
 
  


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
Stupid chmod tricks with Rox filer Randux Slackware 5 08-11-2006 04:44 AM
Stupid, stupid question; I lost Klaptop. :( Surfrider Slackware 2 08-31-2005 09:12 PM
Windows partition requires root permissions- chmod question Garibaldi3489 Slackware 19 05-16-2005 01:52 AM
stupid question about chmod salami Linux - General 4 08-30-2004 06:25 AM
Hopefully a stupid Newbie Question - Sound/Permissions airsylph Linux - Newbie 2 01-26-2002 02:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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