Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
default homedir permissions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
beerli
n00b
n00b


Joined: 18 Apr 2004
Posts: 9
Location: vienna/austria

PostPosted: Mon Oct 24, 2005 4:51 pm    Post subject: default homedir permissions Reply with quote

I'm using useradd and /etc/skel for a default homedir design.

does anyone know how to set the default mask of a homedir created by useradd to 600 instead of 755?
is there a option to set in /etc/default/useradd?

thanks.
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Mon Oct 24, 2005 4:54 pm    Post subject: Reply with quote

Moved from Installing Gentoo to Other Things Gentoo.
Not an installation question.
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered

talk is cheap. supply exceeds demand
Back to top
View user's profile Send private message
ohyeah1942
n00b
n00b


Joined: 21 Mar 2004
Posts: 68

PostPosted: Tue Oct 25, 2005 5:35 am    Post subject: Reply with quote

well, you can change the umask in i think /etc/profile

That will let you set the default permissions that new files and directories are created with.

However I'm not sure thats what you want to do, as it would affect your entire system not just your home directoreis.

This is also a question I have. I hope you get a reply, I never really did.
Back to top
View user's profile Send private message
piwacet
Guru
Guru


Joined: 30 Dec 2004
Posts: 486

PostPosted: Mon Dec 12, 2005 6:07 pm    Post subject: Reply with quote

To change the default permissions when I log in to my user account, I've edited ~/.bashrc and added:

Code:
umask 077


at the end. This seems to set the default file and directory permissions I want, and so far is working.

Note that the first time you do this you must log out and log back in to have this take effect.

Also note this changes the default permissions of your session, no matter which directory you are working in. Since my user almost always uses files in the user home directory, this works fine. But when you su root, these new permissions will still be in effect (which I did not want). I wanted whatever work I do as root to have gentoo's default permissions, so I added to my /root/.bashrc:

Code:
source /etc/profile


Thus, when I su to root, gentoo's default permissions are in effect. When I exit from the root shell, the umask 077 permissions resume.

HTH
Back to top
View user's profile Send private message
hayalci
n00b
n00b


Joined: 18 Jul 2004
Posts: 44

PostPosted: Tue Mar 21, 2006 4:14 pm    Post subject: Reply with quote

You can have a look at /etc/login.defs
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum