Recent Changes - Search:

Softwares

.

LinuxFileAndDirectoryPermissions

Main.LinuxFileAndDirectoryPermissions History

Hide minor edits - Show changes to output

December 13, 2012, at 01:56 AM by 15.211.153.75 -
Added lines 1-4:
(:Google1:)
(:Googletxt:)
----
Deleted lines 20-25:
(:Google1:)
(:Googletxt:)

(:Googlemm:)
Changed line 43 from:
(:Googletxt:)
to:
(:Googlemm:)
July 04, 2012, at 01:37 AM by 115.242.129.136 -
Deleted lines 0-3:
(:Google1:)
(:Googlemm:)
----
Added lines 16-21:

(:Google1:)
(:Googletxt:)

(:Googlemm:)
April 25, 2009, at 12:39 PM by 118.95.7.226 -
Changed lines 40-43 from:
find -type d -exec chmod 755 {} \;
to:
find -type d -exec chmod 755 {} \;

----
(:Googletxt:)
April 25, 2009, at 12:38 PM by 118.95.7.226 -
Added lines 1-4:
(:Google1:)
(:Googlemm:)
----
February 22, 2007, at 08:47 AM by 61.17.222.118 -
Changed lines 29-36 from:
SGID is similar for the group permissions : 02???
to:
SGID is similar for the group permissions : 02???

%blue%Setting permission correctly.

You can use these commands to set 755 on directories and 644 on files

find -type f -exec chmod 644 {} \;
find -type d -exec chmod 755 {} \;
February 22, 2007, at 08:43 AM by 61.17.222.118 -
Added lines 3-5:

%blue%Find directory with 777 permission.
find . -type d -perm 777
Added lines 10-15:
%blue%To locate all world-writable files on your system, use the following command:

root# find / -perm -2 ! -type l -ls

In the normal course of operation, several files will be world-writable, including some from /dev, and symbolic links, thus the "! -type l" which excludes these from the previous find command.
Changed lines 7-9 from:
to:
%blue%To find all files for particular user
find / -user nobody -ls (where nobody is the username)
Changed lines 6-18 from:
find /dev -perm -2 -print
to:
find /dev -perm -2 -print

%blue%SUID commands

The SUID mechanism allow ordinary users to temporarily access some files with the rights of file's owner.

For example it is possible (by passwd command) to change his password, writing in /etc/passwd which is owned by root, because /bin/passwd is executable by anybody but SUID for root ; when executing passwd the real user id (user who runs the command) is different from the effective user id (root) necessary to write in /etc/passwd

SUID is indicated by a 's' in place of 'x' for the owner-execute permission : -rwsr-xr-x

in octal notation a SUID program is indicated by 04???

SGID is similar for the group permissions : 02???
Deleted line 1:
Deleted line 2:
Deleted line 3:
Added lines 1-9:
%blue%Never make files world-writable, search for world-writable files in the current directory.

find . -perm -2 -print

%blue%search for suid and sgid files.

find / -type f -perm +6000 -ls
%blue%search the /dev directory for world writable files.
find /dev -perm -2 -print
Edit - History - Print - Recent Changes - Search
Page last modified on December 13, 2012, at 01:56 AM