How To Set Default File Permissions In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The default file permissions for files and directories in Linux are typically set to 644 for files and 755 for directories. This means that files are readable and writable by the owner, and readable by everyone else. Directories are readable, writable and executable by the owner, and readable and executable by everyone else. To change the default file permissions for all files, use the chmod command with the -R (recursive) flag to set the permissions for all files and subdirectories:
$ chmod -R 644 <directory>
To change the default file permissions for all directories, use the chmod command with the -R (recursive) flag to set the permissions for all directories and subdirectories:
$ chmod -R 755 <directory>