Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Permissions 1

Status
Not open for further replies.

Mag0007

MIS
Feb 15, 2005
829
US
How can I make sure a certain directory (/var/important, /usr/bin, etc..etc..) are only writable by root?

I need to know the "find" syntax for it, I have been using google, but no luck.

 
ls -ld to the directory, permisions must be:

[tt]drwx------ root root some_date /var/important[/tt]

Cheers.
 
A starting point (in ksh):
[ -z "$(find /path/to/dir -prune -user 0 -a ! \( -perm -020 -o -perm -002 \))" ] && echo "WARNING"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
chmod 755 on the directories you want only writeable by root. Users will most likely need access to /usr/bin so keep this as a 5 not a 0.

Please explain what you want the find syntax for?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top