
Sample umask Values and File Creation Permissions Or you can set up a umask in /etc/bashrc or /etc/profile file for all users. If you will create new files / folders from your Bash session, you can set umask value in your shell profile ~/.bashrc file. If files / directories need be created, for example, by PHP, you need to modify the PHP code: So if you will use some kind of FTP program to upload files into /opt/lampp/htdocs you need to configure your FTP server to use the umask you want. It can be used to control the default file permissions for new files. The user file-creation mode mask (umask) is used to determine the file permissions for newly created files.
#Linux permissions reset how to#
I think Adam was asking how to change the umask value for all processes that are trying to operate on the /opt/lampp/htdocs directory. Better to use the first one in any situation.Use chmod 755 $(find /path/to/base/dir -type d) otherwise.The -type x option searches for specific type of file only, where d is used for finding directory, f for file and l for link. To change all the directories to 755 ( drwxr-xr-x): find /opt/lampp/htdocs -type d -exec chmod 755 \ if the number of files you are using is very large. I suspect what you really want to do is set the directories to 755 and either leave the files alone or set them to 644. But why on earth would you want to? It might make sense for the directories, but why set the execute bit on all the files? I copied the permissions from it and solved my permission problems in under an hour.The other answers are correct, in that chmod -R 755 will set these permissions to all files and subfolders in the tree.

Fortunately, I had a laptop of the same distro and it had almost the same set of installed packages. After I realized that I wanted the cross-compiler's files to be chown'ed to root and not me, I foolishly ran chown -R root:root /usr and nuked my permissions by accident. I ran into this problem with my desktop when I manually installed a cross-compiler I had just created using rsync with the -a flag.

To do that, you usually have to copy permissions from another computer that has permissions that are 'close enough'.

You can use this to repair the permissions on /usr/bin/sudo: chown root:root /usr/bin/sudoĪfter you've done this, you can select the 'resume normal boot' option (or just restart your computer if you don't have one) and log in normally and use the sudo command to repair the rest of your permissions. Since the shell is logged in as root, all commands will be run as root without needing the sudo command.

Then select the option that will give you a root prompt. First, select the fsck recovery option to remount / in read-write mode and mount all the other file systems in fstab. Start linux in recovery mode, and (if you use a popular distro) you should eventually be presented with a short menu of recovery options. If you use one of the popular distros of linux (something like Ubuntu), there should be an option to start linux in recovery mode (the option might be found under an 'Advanced Options' sub-menu if you use GRUB 2). Reboot your computer and hold F8 after the BIOS splash to bring up the GRUB boot menu.
