How to find root owned world writable files?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to find root owned world writable files?
# 8  
Old 10-12-2010
Quote:
find / -type d -user root -perm /o=w
I believe that this is a syntax error. thegeek has posted a correction.

Try:
Code:
find / -type d -user root -perm -o=w

Be cautious of making changes to unix directory permissions based on external advice and always be in a position to undo a change.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

Create zip file from root owned fstab

I want to zip up my fstab file for backup purposes. This does not work because of permission issues. cd /etc/ zip -u fstab.zip fstab Can I use this with zip? echo xxx | sudo -S or change fstab owner to me? (3 Replies)
Discussion started by: drew77
3 Replies

2. Shell Programming and Scripting

World writable home dirs

what is wrong with this script? I get: ./perm.sh: command substitution: line 21: unexpected EOF while looking for matching `"' ./perm.sh: command substitution: line 22: syntax error: unexpected end of file Script: #!/bin/bash for dir in `/bin/cat /etc/passwd | /bin/egrep -v... (4 Replies)
Discussion started by: greenja9
4 Replies

3. UNIX for Dummies Questions & Answers

Read authorization for everybody on sub-directory owned by root

Hello. On my family laptop, I have a directory named /local. It is owned by root. I want to create a sub-directory named documents ( /local/documents ). I want to exclude exec for every body in that directory I want every authenticated linux user can create a sub directory ( ie :... (7 Replies)
Discussion started by: jcdole
7 Replies

4. AIX

find command to list all the 777 files and directories owned by root user

Hi I'm logged in to an AIX box now and we need to do an audit on this box. cbssapr01:# pwd / Which command will show all the files and directories owned by root user with permissions as 777 ? (8 Replies)
Discussion started by: newtoaixos
8 Replies

5. AIX

AIX 5.x OpenSSH choot and non-root owned

Good day. I was looking at implementing a chroot environment using openssh. I know I can use the sshd_config file and dictate that it is to use chroot for a specific directory for a user/group. However, the issue with this is that it is has to be root owned. To my knowledge, there is no mount... (0 Replies)
Discussion started by: smurphy_it
0 Replies

6. UNIX for Dummies Questions & Answers

find directories owned by a given user

Hi, I want to know if the is a way I can list the directories owned by a given user. Say i am logged in as that user. I found out the find command lists the files owned by a certain user/group but i want to know only the directories and if possible the permissions associated with these... (6 Replies)
Discussion started by: poojabhat
6 Replies

7. UNIX for Dummies Questions & Answers

user able to delete directory owned by root

I've tried to figure this out. I'm only about 6 mos into my AIX admin duties, but I've got a "security" problem I can't figure out. I've created a sub directory as follows: drwx------ 2 root system 256 Apr 13 16:02 mike I've logged in another session with the following user: $ id... (2 Replies)
Discussion started by: mpheine
2 Replies

8. UNIX for Dummies Questions & Answers

How do i find out the list of users whose terminal is writable?

Hello, i just wanted to know how do i find out the list of users whose terminal is writable?i mean i used who -T but this gives a list of all users whose terminal is writable or blocked and not writable. So how do i do this?I am new to Unix. (2 Replies)
Discussion started by: salman4u
2 Replies

9. AIX

How to find world writable files? (AIX)

Hi Group, Could someone tell me how to find world writable files on my server? I can use find command in conjuction with -perm option and I will get an output. But what I need is an output which looks similar to ls -l output. Meaning, it should give me the full path of the file along with the... (1 Reply)
Discussion started by: matifr
1 Replies

10. Shell Programming and Scripting

Perl CGI to access / edit "root" owned config files

I am trying to write a CGI program which accesses UNIX configuration files and changes them as required. The thing is, I don't want the CGI program to be "root" owned - it's Perl based! Is there any way that the Perl CGI program can request a username and password - and then use this to... (1 Reply)
Discussion started by: WIntellect
1 Replies
Login or Register to Ask a Question
Paranoid::Glob(3pm)					User Contributed Perl Documentation				       Paranoid::Glob(3pm)

NAME
Paranoid::Glob - Paranoid Glob objects VERSION
$Id: Glob.pm,v 0.2 2010/04/21 09:07:30 acorliss Exp $ SYNOPSIS
$obj = Paranoid::Glob->new( globs => [ qw(/lib/* /sbin/* /etc/foo.conf) ], literals => [ qw(/tmp/{sadssde-asdfak}) ], ); print "Expanded globs: ", join(" ", @$obj); $rv = $obj->addGlobs(qw(/etc/* /bin/*)); $rv = $obj->addLiterals(qw(/etc/foo.conf)); $obj->consolidate; @existing = $obj->exists; @readable = $obj->readable; @writable = $obj->writable; @executable = $obj->executable; @owned = $obj->owned; @directories = $obj->directories; @files = $obj->files; @symlinks = $obj->symlinks; @pipes = $obj->pipes; @sockets = $obj->sockets; @blockDevs = $obj->blockDevs; @charDevs = $obj->charDevs; $obj->recurse(1, 1); DESCRIPTION
The primary purpose of these objects is to allow an easy way to detaint a list of files and/or directories while performing shell expansion of names. It does this with a caveat, however. If a given file or directory name exists on the file system as a literal string (regardless of whether it has shell expansion characters in it) it will be added as such. It is only filtered through bsd_glob if it does not exist on the file system. The objects can also be created with instructions to explicitly treat all names as literal strings. Any undef or zero-length strings passed in the files array are silently removed. As a convenience subsets of the expanded files can be returned based on the common stat/lstat tests. Please note the obvious caveats, however: asking for a list of directories will fail to list directories if the effective user does not have privileges to read the parent directory, etc. This is no different than performing '-d', etc., directly. If you care about privilege/permission issues you shouldn't use these methods. An additional method (recurse) falls outside of what a globbing construct should do, but it seemed too useful to leave out. SUBROUTINES
/METHODS new $obj = Paranoid::Glob->new( globs => [ qw(/lib/* /sbin/* /etc/foo.conf) ], literals => [ qw(/tmp/{sadssde-asdfak}) ], ); This class method creates a Paranoid::Glob object. It can be constructed with optional literal strings and/or globs to expand. All are filtered through a [[:print:]] regex for detainting. Any undefined or zero-length strings are silently removed from the arrays. The object reference is a blessed array reference, which is populated with the expanded (or literal) globs, making it easy to iterate over the final list. If any entry in the globs array fails to detaint this method will return undef instead of an object reference. addGlobs $rv = $obj->addGlobs(qw(/etc/* /bin/*)); Adds more globs to the object that are detainted and filtered through bsd_glob. Returns false if any strings fail to detaint. All undefined or zero-length strings are silently removed. addLiterals $rv = $obj->addLiterals(qw(/etc/foo.conf)); Adds more literal strings to the object that are detainted. Returns false if any strings fail to detaint. All undefined or zero-length strings are silently removed. consolidate $obj->consolidate; This method removes redundant entries and lexically sorts the contents of the glob. exists @existing = $obj->exists; This object method returns a list of all entries that currently exist on the filesystem. In the case of a symlink that exists but links to a nonexistent file it returns the symlink as well. readable @readable = $obj->readable; This method returns a list of all entries that are currently readable by the effective user. In the case of a symlink it returns the symlink only if the target of the symlink is readable, just as a normal stat or -r function would. writable @writable = $obj->writable; This method returns a list of all entries that are currently writable by the effective user. In the case of a symlink it returns the symlink only if the target of the symlink is writable, just as a normal stat or -w function would. executable @executable = $obj->executable; This method returns a list of all entries that are currently executable by the effective user. In the case of a symlink it returns the symlink only if the target of the symlink is executable, just as a normal stat or -x function would. owned @owned = $obj->owned; This method returns a list of all entries that are currently owned by the effective user. In the case of a symlink it returns the symlink only if the target of the symlink is owned, just as a normal stat or -o function would. directories @directories = $obj->directories; This method returns a list of all the directories. In the case of a symlink it returns the symlink if the target of the symlink is a directory, just as a normal stat or -d function would. files @files = $obj->files; This method returns a list of all the files. In the case of a symlink it returns the symlink if the target of the symlink is a file, just as a normal stat or -f function would. symlinks @symlinks = $obj->symlinks; This method returns a list of all the symlinks. pipes @pipes = $obj->pipes; This method returns a list of all the pipes. In the case of a symlink it returns the symlink if the target of the symlink is a pipe, just as a normal stat or -p function would. sockets @sockets = $obj->sockets; This method returns a list of all the sockets. In the case of a symlink it returns the symlink if the target of the symlink is a socket, just as a normal stat or -S function would. blockDevs @blockDevs = $obj->blockDevs; This method returns a list of all the block device nodes. In the case of a symlink it returns the symlink if the target of the symlink is a block device node, just as a normal stat or -b function would. charDevs @charDevs = $obj->charDevs; This method returns a list of all the character device nodes. In the case of a symlink it returns the symlink if the target of the symlink is a character device node, just as a normal stat or -c function would. recurse $obj->recurse; $obj->recurse(1); $obj->recurse(1, 1); This method with recursively load all filesystem entries underneath any directories already listed in the object. It returns true upon completion, or false if any errors occured (such as Permission Denied). Two optional boolean arguments can be passed to it: Option1: Follow Symlinks Option2: Include "Hidden" directories Both options are false by default. If Option1 (Follow Symlinks) is true any symlinks pointing to directories will be recursed into as well. Option2 in its default false setting excludes dot files or directories just as normal shell expansion would. Setting it to true causes it to include (and recurse into) hidden files and directories. DEPENDENCIES
o Carp o Errno o Fcntl o File::Glob o Paranoid o Paranoid::Debug BUGS AND LIMITATIONS
AUTHOR
Arthur Corliss (corliss@digitalmages.com) LICENSE AND COPYRIGHT
This software is licensed under the same terms as Perl, itself. Please see http://dev.perl.org/licenses/ for more information. (c) 2009, Arthur Corliss (corliss@digitalmages.com) perl v5.14.2 2010-05-03 Paranoid::Glob(3pm)