Hello, I need some help setting the default umask for a user when they log in.
I tried to set umask 0002 in gecos field. Doesnt work.
I tried to change in /etc/login.defs. Doesnt work.
Still default 0022 when they login.
Need some help here.
Set default umask for users when they login?
7 posts
- Posts: 4
- Joined: Fri Aug 10, 2012 10:28 pm
use umask in /etc/fstab ( man fstab ? )
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)
Licaon_Kter wrote:use umask in /etc/fstab ( man fstab ? )
I have the same problem and tried umask in fstab,
- Code: Select all
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime,umask=0007 0 1
Doesn't work. It makes the file system read-only, which took an awful lot of googling to get out of, but no effect on umask which was still 0022. Any other way to fix the umask problem?
- Posts: 3
- Joined: Tue Nov 06, 2012 10:49 pm
How about the obvious - set it in /etc/profile?
- Posts: 1381
- Joined: Sun Jan 15, 2012 1:11 pm
The /etc/profile file states that you shouldn't set it there:
/etc/profile wrote:# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.
- Posts: 3
- Joined: Tue Nov 06, 2012 10:49 pm
That comment does not say that umask should not be set in /etc/profile, only that it is not.
For pam_umask to work, it would have to be mentioned somewhere in /etc/pam.d/, and it is not. So:
For pam_umask to work, it would have to be mentioned somewhere in /etc/pam.d/, and it is not. So:
- Code: Select all
echo "session optional pam_umask.so usergroups" |sudo tee -a /etc/pam.d/common-session
jojopi wrote:That comment does not say that umask should not be set in /etc/profile, only that it is not.
So I just tried setting it in /etc/profile, and to my surprise it actually worked. Thanks!
- Posts: 3
- Joined: Tue Nov 06, 2012 10:49 pm