Browsing articles tagged with "chmod - Admins Goodies"
Feb 20, 2013
tom

List all folders that have permissions of 777

Is there any way to list all the folders that have permissions of 777? Asked by Anselme find / -type d -perm 777 -print Answered by faker Check more discussion of this question. Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Print for later Bookmark in Browser Tell a friend

Continue Reading »
Jan 18, 2013
tom

/dev/* permission

I accidentally sudo chmod 666 /dev/*. And now many devices in my computer messed up. I have fixed some of them like /dev/shm, /dev/snd but I am not sure about the rest. What’s the correct permission for file and folder in /dev/* ? Can I restore it to the default value ? Asked by iKid In modern Linux systems, the /dev/ filesystem gets rebuilt at every boot by udev. If you can afford to reboot, […]

Continue Reading »
Jan 12, 2013
tom

File readable by only PHP?

I’d like to make a file on my server be readable by PHP, but not directly accessible with a browser. Say my Apache installation’s root is /apache. I’d like PHP to be able to get the text of /apache/1.txt, but not allow the user to go to domain.tld/1.txt and view the contents. I’d still like to be able to read/write the file through FTP/SFTP without root. What would be the propper chmod string for this? […]

Continue Reading »
Jul 18, 2012
tom

centos 6.2 gives read permission denied when root has set read permissions to all users

Installing Dropbox on Centos 6.2 owned by root. Demonstrating that the dropbox folder is owned by root with read permissions to all “root” user gives read permissions to all users [root@localhost Dropbox]# ls -la total 436 drwxr–r–. 6 root root 4096 Jul 17 20:01 . drwxr-xr-x. 3 root root 4096 Jul 11 20:11 .. -rw-r–r–. 1 root root 29 Jul 17 20:01 .dropbox drwxr-xr-x. 4 root root 151552 Jul 17 20:03 .dropbox.cache drwxr-xr-x. 2 root […]

Continue Reading »
May 4, 2012
tom

Correct recursive chmod

I’d like to recursively chmod a directory so that: Files are 0664 Directories are 0775 How to do it better, shorter, fancier? Maybe, use umask somehow? All find solutions are too long: I always end with Copy-Paste Asked by o_O Tync Depending on your version of chmod, you may be able to do this: chmod -R . ug+rwX,o+rX,o-w Note the capital X. This sets the executable bit on directories and files that already have any […]

Continue Reading »
Apr 3, 2012
tom

Set Default User / Group (Sticky Bit) in Ubuntu

To enforce the following permissions on files in /var/www, can I use the commands chmod u+s and chmod g+s? Permissions: chown -R root:web /var/www chmod -R g+rw /var/www Asked by Trent Scott Setting the setgid bit on a directory will cause files and directories to inherit the group ownership of that directory. It will not have any impact on file or directory permissions. File and directory permissions are controlled primarily by the process umask, which […]

Continue Reading »
Mar 7, 2012
tom

Is there an alternative for this chmod command on Debian?

I’m trying to setup a chmod using this command sudo chmod +a “www-data allow delete,write,append,file_inherit,directory_inherit” app/cache app/logs apparently this does not work on debian. Any clue on how to achieve the same thing ? Asked by Paté The Symfony documentation at Installing and Configuring Symfony explains that if chmd +a is not supported, you can install the acl package and use the setfacl command instead of chmod +a. Once you install the acl package, follow […]

Continue Reading »
Feb 28, 2012
tom

Why is “chmod -R 777 /” destructive?

I’m not asking how to fix this problem, as there are a ton of references of that already on serverfault (reinstall OS). I also completely understand why this is bad form. I’m just curious as to why it does anything destructive at all. If you’ve ever ran this command you pretty much immediately destroy your operating system. I’m not clear why removing restrictions has any impact on existing processes. For example, if I don’t have […]

Continue Reading »
Feb 26, 2012
tom

Change all file permissions to 644 and all folder permissions to 755 recursively

How to change all file permissions to 644 and all folder permissions to 755 recursively using chmod in the following two situation: If they had 777 permissions Regardless of the permission (with ANY permissions) Asked by smhnaji find . -type d -perm 777 -exec chmod 755 {} \; (for changing the directory permission) find . -type f -perm 777 -exec chmod 644 {} \; (for changing the file permission) If they did not have 777 […]

Continue Reading »
Feb 10, 2012
tom

Linux ACL behaviour: settings the mask changes ‘ls’ output, but not actual permissions

It might be the time of night, but this is puzzling me. Picture the following. [root@node1 acltest]# getfacl foo/ # file: foo # owner: root # group: testuser user::rwx group::r-x other::—[root@node1 acltest]# ls -la . total 24 drwxr-xr-x 3 root root 4096 Feb 9 21:53 . drwxr-xr-x 25 root root 4096 Feb 9 21:54 .. drwxr-x— 2 root testuser 4096 Feb 9 21:53 foo [root@node1 acltest]# setfacl -m m::rwx foo [root@node1 acltest]# getfacl foo/ # […]

Continue Reading »
Pages:1234567»