Reputation: 2451
Is there a way to override the default home directory permissions for new users on a compute engine instance?
I tried to modify /etc/adduser.conf
, but it does not seem to be used for accounts created automatically when accessing the instance for the first time using the GCloud SDK.
Upvotes: 0
Views: 488
Reputation: 97
You need to change the parameter UMASK in the file /etc/login.defs in order to change the default home directory permission for new users created from the GCloud SDK.
The value of UMASK for default is 022 that means rwx-rw--rw-,you can simply subtract the umask from the base permissions to determine the final permission for directory as follows: 777 – 022 = 755
Directory base permissions : 777 umask value : 022 Subtract to get permissions of new directory (777-022) : 755 (rwxr-xr-x)
The above is an example of value 022 but you can set your UMASK as you need, in this link you can find how to calculate the UMASK value https://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html.
Upvotes: 0