LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-22-2015, 11:22 PM   #1
Devyn
Member
 
Registered: Oct 2004
Posts: 98

Rep: Reputation: 15
oddjob selinux policy for subfolder /n/home vs /home


Hey All,

I need to have oddjob create the home folders under an alternate directory, /n/home that I plan to share out. I can successfully change the directoy from /home to /nfshome after changing the selinux context and oddjob makes the new home folder under /nfshome:

PHP Code:
[root@host /]# semanage fcontext -a -t home_root_t /nfshome
[root@host /]# semanage fcontext -a -e /home /nfshome
[root@host /]# restorecon -vR /nfshome 
(courtesy http://serverfault.com/questions/521...elinux-context )

However when I try to configure the system to use /n/home instead of /nfshome, the folder is never created AND there is nothing in the log files to even indicate that oddjob attempted to create a folder under /n/home.

PHP Code:
# ls -ldZ /home
drwxr-xr-xroot root system_u:object_r:home_root_t:s0 /home
# ls -ldZ /nfshome
drwxr-xr-xroot root system_u:object_r:home_root_t:s0 /nfshome
# ls -ldZ /n/home
drwxr-xr-xroot root unconfined_u:object_r:home_root_t:s0 /n/home
# ls -ldZ /n
drwxr-xr-xroot root system_u:object_r:file_t:s0      /n

Is there a parent relationship on folders I need to take care of with selinux first on the parent folder /n before oddjob can create home folders in /n/home/?

Also how and where to turn on SELinux debugging messages? (I'm new to selinux)

Thanks,
Devyn
 
Old 09-22-2015, 11:26 PM   #2
Devyn
Member
 
Registered: Oct 2004
Posts: 98

Original Poster
Rep: Reputation: 15
Setting SELinux labels on /n worked but what if I wish to keep /n with different labels then /n/home?

I may wish to store things on /n where home_root_t might effect performance of applications using that storage.

Cheers,
Devyn
 
Old 09-23-2015, 01:40 PM   #3
Devyn
Member
 
Registered: Oct 2004
Posts: 98

Original Poster
Rep: Reputation: 15
Hey All,

An additional question. From each client, if I'm to mount the NFSv4 share from my server on each client like this:

[ clientsrv: ] # mount -o soft,rw,timeo=5 nfsrv:/n/ /n

What permissions would I need on the client to allow home directories to be created for new users from any machine they log in too?

Cheers,
Devyn
 
Old 09-24-2015, 10:24 AM   #4
Devyn
Member
 
Registered: Oct 2004
Posts: 98

Original Poster
Rep: Reputation: 15
Hey All,

From the client, on login, the system isn't able to create the user's home directory but from the server it can of course. However in selinux if you mount the folder it is nfs_t by default. How to get around this?

PHP Code:
# ls -ldZ /n
drwxr-xr-xroot root system_u:object_r:nfs_t:s0       /n
# ls -ldZ /n/home
drwxr-xr-xroot root system_u:object_r:nfs_t:s0       /n/home
# cd /n/home
# mkdir devyn
mkdircannot create directory `devyn': Permission denied

Thanks,
Devyn
 
Old 09-24-2015, 11:00 AM   #5
Devyn
Member
 
Registered: Oct 2004
Posts: 98

Original Poster
Rep: Reputation: 15
If i already have the user folder created on the NFS server, that's fine and writes to it from users logging into the clients works fine. However as root creates the folder and root i ssquashed, what is my alternative on the client? Can I setup the mount to signal the NFS server to create the home folder somehow?

Thanks,
Devyn
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SELinux vs Apparmor for home use - Steam - AMD Amarildo Linux - Newbie 11 06-06-2015 04:13 PM
Stop users from chmod /home with selinux mijohnst Linux - Security 3 02-25-2015 04:25 AM
Fedora 16: Could not downgrade policy file (selinux-policy-targeted) coreychch Fedora 1 06-29-2012 02:33 AM
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 04:02 PM
SELinux and sftp home directory vonedaddy Linux - Security 1 12-22-2007 01:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration