Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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... i am fairly new to linux world and trying to learn web administration using fedora core 3 as my OS and apache as my web server.
I am trying to setup default home directory permission for each new user created on the system (for the web purpose). After googling for a while, I learned that the default permission needs to be 755 for all the home directories created (so that the users can access the pages stored under public_html...yes, the I set the permission for public_html to be 755).
Now, I want to setup the default permission for each home directory created to be 755 automatically. can this be accomplished by editing the .bash_profile file under /etc/skel ?
I tried putting in the command chmod 755 $HOME in the .bash_profile (it was just a blind attempt...) and it didn't seem to work! (i am not surprised..hehe). Ofcourse, it got copied over to the newly created user but no effect in terms of what I want to accomplish...
Can anyone suggest me anything on how to establish this setup? Thank you very much in advance!
It didn't work:-( FYI: the default permission on /etc/skel is set to 755 (drwxr-xr-x). However, to be sure I did a chmod 755 on that directory and created a new user account and the new account's home dir has the default permission of drwx------
and it is same as above for the home directories created...
I tried adding 'umask 0022' at the end of .bash_profile file located under /etc/skel and it didn't do the trick... logged in and logged out as the newly created user and the home directory has the still the same old default permission
and if you are asking what do I get for umask for the newly created home dir then the answer is 0022 . As I said before, it is 0022 for both newly created dir and for the /etc/skel directory. It is the permission that differs.... (Please read one of my previous posts)
Matir... what do you mean by I need to run umask 0022 prior to creating a new user? where do you suggest me to run that?? Can you eloborate a little more on that... Do I have to run that manually everytime I create a new user?? I just want to automate the whole process of setting the right permissions for each newly created home dir...
In a console, just like you would be about to add a new user, please run 'umask' by itself and post the output. You don't set umasks for directories, but for users.
I did that as a root for the /etc/skel directory... then I did the same as both root and the newly created user under the home directory of the new user and I get the same 0022
umask does not care about directories. Directories care about umask. According to http://lists.ssc.com/pipermail/linux...r/021773.html, which could be found by googling, you need to set the umask in /etc/logins.def.
Thanks for pointing me to that URL... it was helpful and I added UMASK 0022 to the file and created a new user.... Surprisingly enough the home dir got the permission I needed!
However, a new problem arised.... the permissions for 'public_html' or any other subdirs of /etc/skel/ is not carried over to the newly created user. The original permission for 'public_html' is set to 755 but for newly created user this directory has the permission of drwx------.
Just for fun, I changed the permission of 'public_html' to be 777, created a new user and the permission under the home dir is drwx------ for 'public_html'
I am confused to understand on what's going on now???
I wish I understood as well. I would've thought it performs a copy, preserving permissions, then chowns the files in question... or, for that matter, switches to the new user, and performs a copy, in which case the umask should take effect.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.