setting folders to different permissions

43 views
Skip to first unread message

Brian Keating

unread,
Dec 18, 2014, 10:35:57 AM12/18/14
to puppet...@googlegroups.com
Hi,
I want to set /home dir to chmod 750 but all dirs included to 755.  Anyone have a solution?
Thanks,
Brian.

jcbollinger

unread,
Dec 19, 2014, 9:59:52 AM12/19/14
to puppet...@googlegroups.com


If you really want to do this then you'll have to manage the subdirectories of /home separately from /home itself.  If you can't be sure of knowing what all the subdirectories are, then you could perhaps do it with an Exec.

I am compelled to observe, however, that your requirement seems backwards.  Surely you want /home to be 755, and its subdirectories 750, yes?  Not that that changes the answer.


John


Lowe Schmidt

unread,
Dec 19, 2014, 10:52:05 AM12/19/14
to puppet...@googlegroups.com
That won't help, because if "other" cant run execute on /home they can cd into directories below /home.

--
Lowe Schmidt | +46 723 867 157

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1b8dabb1-64a4-4e9b-9385-a091278f2d33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Craig White

unread,
Dec 22, 2014, 3:44:56 PM12/22/14
to puppet...@googlegroups.com
The answer may actually depend on the OS you are using but I agree with John that this actually requires 2 separate directives...

On a Red Hat system...

# cat /etc/default/useradd
# useradd defaults file
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=yes

the /home/$USER would have 755 permissions by default though you could use puppet to ensure that if a $USER changes his $HOME directory permissions, they are changed back.
Likewise, you could set /home to 750 permissions to ensure that any changes are overridden. Obviously if you set /home to 750 permissions, then the 'group' would have to be set to a group that all users belong to so there's something lacking in the question (i.e. 'users' on a Red Hat system).
Reply all
Reply to author
Forward
0 new messages