How can I modify the default permissions in linux?

1

I'm specifically using raspbian, a debian-based version optimized for Raspberry Pi. I would like to modify the permissions that are given to the new files by default, I have searched for information and what I want to do can be done with the "umask" command.

The problem is that I do not know where to modify this parameter in my system, I have read that to affect all the users and not only until the console session is kept on, we have to modify the .bashrc that is in my home; and I do not know how to access this.

Could it be that it does not exist in my version of linux? Or am I doing something wrong?

    
asked by pacomaral 01.02.2017 в 21:52
source

2 answers

3

Make sure you are using bash. If editing .bashrc does not work for you, you can change the default umask in /etc/profile . Apart from that you have the facts upside down. The change in .bashrc in the home folder affects the user, not the system. Global settings are found in /etc .

If it's the umask for bash and you want to change the default value, check:

/etc/bash.bashrc
/etc/skel/.bashrc

in /etc/skel/ you find the system guidelines for the new user configurations, the other is the global bash configuration. If you do not find it precisely in this route (I do not know what variant of linux you use in the PI) you could use them using find / | grep bashrc .

If your distribution is more recent, it is possible that your default umask is handled by pam, in this case the configuration must be found in /etc/login.defs .

Typically you will find an entry like:

UMASK        022

That means that new files are created with mod 755. (The umask can be calculated according to 777 - the mod you are looking for, so if you want to create with mod 750, you use a umask of 027).

    
answered by 01.02.2017 в 22:06
0

The profile files are in / etc / profile /etc/profile.d / etc / bashrc / etc / login

Once changed, do not forget to also modify the files that are in / etc / skel, which are the ones that are copied when creating a new user.

    
answered by 28.06.2018 в 10:25