Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I tried putting umask 117 in ~/.bash_profile, logging out then in again, and creating a file.
The permissions are still rw-rw-r--. So that didn't do it.
I tried putting umask=117 in ~/.bash_profile, logging out then in again, and creating a file.
The permissions are still rw-rw-r--. So that didn't do it either.
"If you put your files in your home directory, no one will be able to read them." - Unfortunately this is not the case on my system (Mandrake 9.1, default install). My home directory (and everybody else's too) has the permissions rwxr-xr-x, so they are basically "open". And I'd like to try to fix this.
Setting umask to 177 in ~/.bash_profile creates new files with the right permissions (rw-------), but directories with the wrong ones - so I do not have access to new dirs I create. The magic number for umask seems to be 077. Dirs are now created rwx------, which is good.
Konsole(s) opened from KDE revert to a umask of 022, which is annoying. Konsole doesn't seem to read ~/.bash_profile, which is odd.
All I have to do now is some fancy command-line stuff with "find" and "chmod" and whatnot to reset the permissions properly for all those files and directories that I and the other users have so far created.
MadTurki, I think you will have to edit all those bashrc and bash_profile files. If there are many users, I expect you can create a script to do this for you, but for just a few, it's probably not worth the effort.
For users that you will create in the future though, take a look in /etc/skel.
So, this is working great for users that telnet or ssh into the server. But the same people using samba are still ending up with the default 755 permissions :S How can I make this effect samba as well?
You don't need to edit every user's files unless they are specifically setting the umask already. If there is no umask command in their home files, then /etc/profile is used. You can add umask to that to make it systemwide (provided it's not overridden in a user's home directory).
Also, there's no need to add it to both bash files. You can simply source .bashrc from .bash_profile, and make whatever modifications you want to .bashrc: