You are not logged in.

#1 2013-12-10 11:12:27

bigblondewolf
Member
Registered: 2013-09-14
Posts: 11

[SOLVED] How do I set the default umask? Not in /etc/profile

Hi guys

This is probably not what you expect to hear about umasks... I have set it in /etc/profile:

[2] ognyan@xxxlinux : ~ >grep umask /etc/profile
#Set our umask
umask 002

If I log on via ssh, my umask is 0002. I can start a vnc server and a konsole inside, which has umask 0002. So far so good...

I also have a vnc server running as a service. If I open a konsole from inside this vnc, bash says umask 0022. So there must be a more-default setting for umask, than /etc/profile. I found a setting in /etc/login.defs and changed it to "UMASK 007", then even rebooted, but bash inside the vnc service stays with umask 0022.

It seems not to be a setting of KDE, since both vnc sessions have different umasks, inherited by their parents. What provides the environment for the service and how can I control it?

Last edited by bigblondewolf (2013-12-11 08:37:26)

Offline

#2 2013-12-10 20:08:24

ondoho
Member
Registered: 2013-04-30
Posts: 692
Website

Re: [SOLVED] How do I set the default umask? Not in /etc/profile

on my server i have something like this in ~/.profile:

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
umask 002

and at home i have ~/.bash_profile, but no umask in it.
or is this answer too obvious? not quite sure i get your problem.

Offline

#3 2013-12-11 08:36:52

bigblondewolf
Member
Registered: 2013-09-14
Posts: 11

Re: [SOLVED] How do I set the default umask? Not in /etc/profile

I am not sure if ~/.bash_profile works, but I took your idea and put 'umask 002' in /etc/bash.bashrc and it seems to work.

I thought services start a login shell and read /etc/profile first. umask in VNC is 0002 now, thanks.

Last edited by bigblondewolf (2013-12-11 08:37:14)

Offline

Board footer

Powered by FluxBB