Scientific Linux Forum.org



  Reply to this topicStart new topicStart Poll

> Secondary home partition and SELinux
Clorden
 Posted: Jan 28 2013, 08:22 AM
Quote Post


SLF Newbie


Group: Members
Posts: 5
Member No.: 1694
Joined: 13-July 12









Hello all,
I created a /home2 disk to be used as an additional /home. Of course I need to set up the selinux contexts properly but I am not sure If I should do it manually or if there is a transparent and clean way to do it.

What is the ideal solution?

Thanks!

PM
^
joka
 Posted: Jan 28 2013, 10:55 PM
Quote Post


SLF Geek
****

Group: Members
Posts: 172
Member No.: 107
Joined: 28-April 11









QUOTE (Clorden @ Jan 28 2013, 09:22 AM)
Hello all,
I created a /home2 disk to be used as an additional /home. Of course I need to set up the selinux contexts properly but I am not sure If I should do it manually or if there is a transparent and clean way to do it.

What is the ideal solution?


CODE
semanage fcontext -a -e /home /home2
restorecon -R -v /home2


Or take a look at the man page of semanage.
PM
^
Clorden
 Posted: Jan 29 2013, 08:10 PM
Quote Post


SLF Newbie


Group: Members
Posts: 5
Member No.: 1694
Joined: 13-July 12









QUOTE (joka @ Jan 28 2013, 10:55 PM)

CODE
semanage fcontext -a -e /home /home2
restorecon -R -v /home2


Or take a look at the man page of semanage.


Thanks! I actually did something different in the meanwhile.

First of all I created a new user in the /home2, then:

CODE
genhomedircon
restorecon -R -v /home2


The genhomedircon rebuilt the policy altering the file

CODE
/etc/selinux/targeted/contexts/files/file_contexts.homedirs


What do you think?
PM
^
joka
 Posted: Jan 30 2013, 10:02 PM
Quote Post


SLF Geek
****

Group: Members
Posts: 172
Member No.: 107
Joined: 28-April 11









I think both commands are solutions to your original question.

genhomedircon has the advantage that you don't need to bother about the home directory names. So it is the better choice for config and install scripts.
PM
^
Clorden
 Posted: Jan 31 2013, 01:32 PM
Quote Post


SLF Newbie


Group: Members
Posts: 5
Member No.: 1694
Joined: 13-July 12









QUOTE (joka @ Jan 30 2013, 10:02 PM)
I think both commands are  solutions to your original question.


Thanks, joka!


PM
^
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll