SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi all, earlier installed slackware, then created a user and logged into to it and started X. I downloaded terminator from slackbuilds, i didn't use sbopkg, anyway it created the package in /tmp. I did installpkg /tmp/terminator* and afterwards user lost commands, my fluxbox menu have just had exit on it...i was wondering if editing /etc/profile umask to 077 from 022 could do this. i also got
zshermission denied:/var/spool/mail/user , to solve this i removed terminator package and reinstalled matamail package..anyone have any ideas?
i was wondering if editing /etc/profile umask to 077 from 022 could do this.)
Yep. I know you didn't use sbopkg but the first msg or two of issue 57 should be relevant. I'm sure a search for sane root umasks in Slackware will also turn up stuff.
Yes, changing /etc/profile file umask setting could be the reason. Setting the permission to 077 will make the files or directories to be created with the following permissions:
Directories:
Root: drwx------
User: ----------
Files:
Root: rwx------
User: ---------
In this scenario only root user will have access to those files and not the normal user if you have done the editing
Thanks for the replies slakmagik, T3RM1NVT0R. Would this have happened if only user had umask of 077 and root had 022. Is there a file i can edit which would give users default umask (of my choice) when created, without altering roots?
and scroll down a bit you will find some lines which read as follows:
Code:
# By default, we want this to get set.
# Even for non-interactive, non-login shells.
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi
Here there are two sections one for root user + service accounts and one for normal users. The first section which has umask 002 is for normal users. Any file created by them will have rw-rw-r-- permissions set by default. The second section for root and service account. So any file created by them will have rw-r--r-- permissions set by default.
Thanks again T3RM1NVT0R, is there not a file i can edit so on creation of a user it will be my choice of umask instead of editing ~/.bashrc? ... like login.defs or some file, without changing roots umask.
As far as I am aware /etc/bashr is the file where you can define the permissions that will be set on by default when a file/directory is created by the user.
/etc/login.defs file is helpful at the time of user creattion. If you define the UMASK value there then it will only for the creation of user's home directory at the time of useradd. This can also be achieved by using the following command:
Code:
useradd -K UMASK=umask_value_you_want <username>
If you set the UMASK value of 002 in the above command then the user's home directory will get created with the following rights:
drwxrwxr-x
If you want to specify file creation permission for all users you can define it in /etc/bashrc (This will be global and affect all users because /home/user/.bashrc points to /etc/bashrc). If you want it for specific users then you can do the following:
1. Copy the /etc/bashrc to /etc/myrc using the following command:
Code:
cp /etc/bashrc /etc/myrc
2. Edit the .bashrc file of that particular user to point to /etc/myrc as follows:
Code:
# .bashrc
# Source global definitions
if [ -f /etc/myrc ]; then
. /etc/myrc
fi
# User specific aliases and functions
3. Edit /etc/myrc and edit the following section:
Code:
vi /etc/myrc
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 077
else
umask 022
fi
In this way you will not touch /etc/bashrc and you can always point the specific users to point to /etc/myrc files instead of /etc/bashrc by editing their /home/user/.bashrc file.
/etc/bashrc is not a Slackware file though it can, of course, be created - it's not even a documented bash feature - and only affects bash users, of course. Also be careful using UID/GID checks from other distros. I'd personally recommend not messing with umask at all but, if you must, you can set it on a per user basis in personal shell configs or affect all users by modifying /etc/profile. You could also drop something in /etc/skel so it would affect all users created after that point, depending on their shell. And login.defs is another way - it's my understanding that it not only governs the creation of the home directory but also sets the default if not overridden by something else. There's a lot of ways to go - I'm sure yet more that haven't been mentioned.
Yes, there seems alot of different ways to enforce umask on users, either at creation or when they login. Putting something in /etc/skel for umask when creating a user, and maybe /etc/bashrc when users login...but there are a quite a few choices, i'll to try them and other suggestions to see what suits me best. Thanks T3RM1NVTOR slakmagic
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.