Softwares |
Main /
LinuxFileAndDirectoryPermissionsMain.LinuxFileAndDirectoryPermissions HistoryHide minor edits - Show changes to output Added lines 1-4:
(:Google1:) (:Googletxt:) ---- Deleted lines 20-25:
(:Googletxt:) (:Googlemm:) Changed line 43 from:
(: to:
(:Googlemm:) Deleted lines 0-3:
(:Googlemm:) ---- Added lines 16-21:
(:Google1:) (:Googletxt:) (:Googlemm:) Changed lines 40-43 from:
find -type d -exec chmod 755 {} \; to:
find -type d -exec chmod 755 {} \; ---- (:Googletxt:) 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 {} \; 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 - 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??? 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 |