By greasan
Hi,
I know there is pam_umask that controls permissions for newly created files and folders. The default settings are active in /etc/login.defs (umask 022) and pam_umask is activated using the file /etc/pam.d/common-session.
Well, umask 022 effects, that new files have permissions of 644 and folders 755.
But something is weird there. When I connect via SFTP, new folders have a permission of 775 (umask 002) and new files the default 644 (umask 022).
Why do they have different permissions? Is there a way to configure different default permissions for files and folders? But I changed nothing of the default configuration and my .profile is untouched.
Any suggestions?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
What are you using to SFTP to the droplet? Many times they set their own permissions and so can change things away from the default. It almost sounds like this is the cause.
Have you also tried setting the same umask values in the /etc/profile file as well? If you are using BASH you may wish to add it to the /etc/bashrc file as well.
The /etc/profile and /etc/bashrc files can override defaults set in other locations in many case.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.