• No products in the cart.

Using Fixfiles and Setting Mount Contexts for SELinux

Using Fixfiles and Setting Mount Contexts for SELinux

Sequence 1. Using fixfiles

The fixfiles can be used to reset the contexts of the files of a particular application rather than having to iterate over the files manually and run restorecon against them. The fixfiles command has three modes, one of which must be specified when running the command:

  • check Show any file-related objects whose security context does not match what is specified in the file context files.
  • restore Relabel any file-related objects whose security context does not match what is specified in the file context files.
  • relabel Like restore, but also optionally removes any files in the /tmp directory first.

    -B                                     If specified with onboot, it will record the current date in the /.autorelabel file, so that it can be used later to speed up labeling. If used with restore, restore will only affect files that were modified today.
    -l logfile                             Save the output to the specified logfile
    -F                                      Force reset of context to match file_context for customizable files
    -f                                       Clear /tmp directory with out prompt for removal.
    -R rpmpackagename[,rpmpackagename…]
                                             Use the rpm database to discover all files within the specified packages and restore the file contexts. (-a will get all files in the RPM database).
    -C PREVIOUS_FILECONTEXT   Run a diff on the PREVIOUS_FILECONTEXT file to the currently installed one, and restore the context of all affected files.
    -N time                              Only act on files created after the specified date. Date must be specified in “YYYY-MM-DD HH:MM” format.

  1. Check the contexts
    # fixfiles check
  1. Restore context for all openssh files. Will skip virtual filesystem (/sys)
# fixfiles -R openssh restore
  1. Relabel the entire file system without system reboot – Force:
# fixfiles -f -F relabel

The fixfiles command is actually a shell script that uses either restorecon or setfiles depending on the requested use. Instead of requiring the user to specify which files or directories to relabel or check, fixfiles works on all mounted filesystems that support extended attribute labeling.

  1. Relabel the entire file system without system reboot:
# fixfiles relabel
[root@localhost ~]# fixfiles relabel
    Files in the /tmp directory may be labeled incorrectly, this command
    can remove all files in /tmp.  If you choose to remove files from /tmp,
    a reboot will be required after completion.
    Do you wish to clean out the /tmp directory [N]
  1. Setup the machine to relabel on the next reboot.
# fixfiles onboot  

Sequence 2. Context Mounts

[the_ad id=”2469″]

To mount a file system with the specified context, overriding existing contexts if they exist, or to specify a different, default context for a file system that does not support extended attributes, use mount -o context=SELinux_user:role:type:level. Context changes are not written to disk.
In case of NFS, this default context uses the nfs_t type. Without additional mount options, this may prevent sharing NFS volumes using other services, such as the Apache HTTP Server.

  1. Mounts an NFS volume so that it can be shared using the Apache HTTP Server:
# mount server:/export /local/mount/point -o \ 

The context specified with this option does not persist between mounts.

  1. In common policies, this default context uses the file_t type. If it is desirable to use a different default context, mount the file system with the defcontext option.
# mount /dev/sda2 /test/ -o defcontext="system_u:object_r:samba_share_t:s0"
  1. To make context mounts persistent across remounting and reboots, add entries for the file systems in the /etc/fstab file or an automounter map, and use the required context as a mount option:
server:/export /local/mount/ nfs 
context="system_u:object_r:httpd_sys_content_t:s0" 0 0

Complete this lab successfully and avail 80% discount on any course on this website. Drop a mail with screenshot at admin@skillpedia.co and we will share the discount coupon with you.

Take a look at the Courses offered with Course Contents at https://www.skillpedia.co/category/course-contents/

[the_ad id=”2469″]

September 19, 2019

103 responses on "Using Fixfiles and Setting Mount Contexts for SELinux"

  1. It’s really a great and useful piece of info. I’m satisfied that you simply shared this
    useful information with us. Please keep us informed like this.
    Thank you for sharing.

  2. Hello, after reading this remarkable article i am too happy to share my
    familiarity here with mates.

  3. excellent issues altogether, you simply won a emblem new reader.

    What may you recommend about your put up that you made a few days in the past?
    Any sure?

  4. I have been exploring for a little for any high quality articles
    or blog posts on this kind of area . Exploring in Yahoo I at last stumbled upon this site.
    Studying this information So i am glad to convey that I’ve an incredibly good
    uncanny feeling I discovered exactly what I needed.
    I such a lot indubitably will make sure to don?t forget this site and give it a
    look regularly.

  5. May I just say what a relief to discover a person that actually
    understands what they are talking about online.
    You certainly understand how to bring an issue to light and make it important.
    More and more people really need to read this and
    understand this side of your story. I was surprised that you are not more popular because you most certainly have the gift.

  6. I have learn a few good stuff here. Definitely value bookmarking for revisiting.

    I wonder how much effort you place to create such a excellent informative website.

  7. Hi, its pleasant paragraph on the topic of media print, we all know media is a wonderful
    source of information.

  8. It’s going to be end of mine day, but before ending I am reading
    this great post to increase my experience.

  9. Do you have any video of that? I’d love to find out some additional information.

  10. Great ? I should certainly pronounce, impressed with your web site.
    I had no trouble navigating through all tabs as well as related information ended up being truly easy
    to do to access. I recently found what I hoped for before you know it in the
    least. Reasonably unusual. Is likely to appreciate it for those
    who add forums or anything, web site theme .

    a tones way for your customer to communicate. Nice

    My website … Keto Lite Keto Review

  11. I and also my buddies were found to be viewing the nice secrets and techniques located on the website and the sudden I had
    an awful feeling I never thanked you for those secrets.
    Most of the people became for that reason passionate to
    read all of them and now have in fact been making the most of them.
    Thanks for simply being well helpful and for having
    this sort of superior things millions of individuals are really wanting to learn about.

    My personal sincere apologies for not saying thanks to you

    Visit my web-site; Max Extend Pills

  12. Since the admin of this web page is working, no hesitation very rapidly it will be well-known, due to its
    quality contents.

    My webpage: wm casino download ios

  13. What’s up mates, its fantastic article about cultureand entirely explained, keep it up
    all the time.

    Here is my homepage – http://www.vstromturkiye.com

  14. Wow, fantastic blog layout! How long have
    you ever been blogging for? you make blogging glance easy.
    The entire look of your website is great, let alone the content![X-N-E-W-L-I-N-S-P-I-N-X]I simply couldn’t go away your site prior to suggesting that I actually loved
    the standard info an individual supply on your guests?
    Is going to be again continuously to check up on new posts.

    Visit my homepage: pf-mold.com

  15. Hurrah, that’s what I was seeking for, what a information! existing
    here at this blog, thanks admin of this website.

    Take a look at my web page; mega888 slot

  16. Thanks for helping out, great information.

    my homepage :: Cool Portable Air Conditioner

  17. Thanks for a marvelous posting! I actually enjoyed
    reading it, you might be a great author. I will ensure that I bookmark your blog and
    may come back from now on. I want to encourage that you continue your great work, have a nice morning!

  18. I am really glad to glance at this web site posts which includes lots of
    helpful information, thanks for providing these information.

    My web page – Max Brute Pills

  19. This piece of writing presents clear idea in favor of the new people
    of blogging, that really how to do blogging and site-building.

    Here is my web blog: 44706648-90-20190827182230.webstarterz.com

  20. Very excellent visual appeal on this website, I’d rate
    it 10.

    my homepage: Astroscope Pro

  21. I think the admin of this site is actually working hard in support of his web site,
    as here every data is quality based material.

    Here is my webpage Body Core Keto Reviews

  22. I like the helpful info you supply for your articles.
    I will bookmark your blog and check again here
    frequently. I am quite sure I will be informed a lot of new stuff right right here!
    Good luck for the next!

  23. Hey There. I discovered your weblog the use of msn. This is an extremely smartly written article.
    I’ll be sure to bookmark it and return to read extra of your useful
    information. Thanks for the post. I’ll definitely return.

    my web-site: Pellamore

  24. Simply wish to say your article is as surprising. The clearness to your publish
    is just great and that i could assume you’re knowledgeable on this subject.
    Well with your permission let me to snatch your feed to stay updated with imminent post.
    Thank you 1,000,000 and please carry on the enjoyable work.

    Also visit my web site – Pellamore

  25. I don’t ordinarily comment but I gotta admit regards
    for the post on this one :D.

    My webpage: Arctic Air Portable Air Conditioner

  26. I used to be recommended this blog via my cousin. I’m no longer certain whether or not this put up is written by him as nobody else understand
    such certain about my trouble. You are incredible! Thank you!

    Look into my site – http://www.consulenzaleonardo.com/modules.php?name=Your_Account&op=userinfo&username=HinesShavonne

  27. Good post.Never knew this, thanks for letting me know.

    my web-site; 3DS Pills

  28. Hi there, I enjoy reading all of your article post.

    I wanted to write a little comment to support you.

    Here is my site; ACV Rx Side Effects

  29. What’s Taking place i am new to this, I stumbled
    upon this I have discovered It absolutely useful and it has helped me out loads.
    I’m hoping to give a contribution & help other customers like its helped me.

    Great job.

    my web page: http://www.goldenanapa.ru

  30. I got this web page from my friend who informed me regarding this website and at the moment this time I am
    browsing this web page and reading very informative posts here.

    my website – Maximum Recall Brain

  31. hey there and thank you for your info ? I’ve definitely picked up anything new from right here.
    I did however expertise some technical points using this website,
    as I experienced to reload the web site a lot of times previous to I could get it to load correctly.

    I had been wondering if your hosting is OK? Not that I’m complaining, but slow loading instances times will sometimes affect your placement in google and could damage your quality score if advertising
    and marketing with Adwords. Anyway I’m adding this RSS to my
    e-mail and could look out for a lot more of your respective intriguing content.
    Make sure you update this again soon.

    Also visit my blog :: Virectin Loaded Reviews

  32. Article writing is also a fun, if you be familiar with after that you can write if not it
    is difficult to write.

    Here is my website Spark Aura Serum Review

  33. What you said was actually very logical.
    However, what about this? suppose you were to
    write a killer title? I ain’t saying your content isn’t good, however suppose you added a post title that grabbed people’s attention?
    I mean Using Fixfiles and Setting Mount Contexts for SELinux – SkillPedia is a little vanilla.

    You ought to look at Yahoo’s home page and watch how they create news titles to grab viewers interested.

    You might add a video or a related pic or two to get people interested about everything’ve
    written. Just my opinion, it could bring your posts a little

    My website … Total Pure CBD Reviews

  34. I got what you mean, appreciate it for posting.
    Woh I am delighted to find this website through google.

    Also visit my homepage: BioKeto Review

  35. You made some good points there. I looked on the internet for the subject and found most persons will
    go along with with your blog.

    Also visit my site – Libido Boost Male Enhancement Pills

  36. After checking out a few of the articles on your website,
    I truly appreciate your technique of writing
    a blog. I bookmarked it to my bookmark website list and will be checking
    back soon. Please check out my website as well and let me
    know how you feel.

    Feel free to surf to my blog post … Summer Valley CBD Review

  37. I think this is among the most significant info for me.

    And i’m glad reading your article. But should
    remark on some general things, The website style is ideal,
    the articles is really great : D. Good job,

    My webpage Modern Belle Review

  38. I am glad for writing to make you understand of the terrific encounter my cousin’s girl
    developed reading through the blog. She discovered so many details, including what it’s
    like to possess a very effective teaching character to get
    the mediocre ones smoothly understand a number
    of advanced subject matter. You undoubtedly surpassed people’s desires.
    Thank you for churning out such productive, safe, explanatory and even easy tips on the topic
    to Julie.

    my page :: U Slim X Keto BHB

  39. Hello there! Do you use Twitter? I’d like to follow you
    if that would be ok. I’m absolutely enjoying your blog and
    look forward to new posts.

  40. Thanks for the sensible critique. Me & my neighbor were just preparing to do some research on this.
    We got a grab a book from our local library but I think I learned more clear from this post.
    I am very glad to see such wonderful info being shared freely out there.

    my blog post … Green Flame CBD Cost

  41. I was reading through some of your blog posts on this website and I conceive
    this website is real informative! Retain putting up.

    my webpage :: bbs.yunweishidai.com

  42. Wow, wonderful weblog layout! How lengthy have you
    ever been running a blog for? you make running
    a blog look easy. The full look of your web site is excellent, let alone the content material![X-N-E-W-L-I-N-S-P-I-N-X]I simply couldn’t go away your web site prior to suggesting that I actually loved
    the usual information a person provide to your guests?
    Is gonna be again continuously in order to check up on new posts.

    Check out my blog post :: Ilok Air

  43. Perfectly pent content material, Really enjoyed studying.

    my blog post – http://www.hltkd.tw/

  44. I’m not sure where you are getting your information, but good topic.
    I needs to spend some time learning much more or understanding more.

    Thanks for great info I was looking for this information for my

    My blog post: forum.m2clasic.ro

  45. I am curious to find out what blog platform you are
    using? I’m experiencing some small security issues with my latest blog
    and I would like to find something more safeguarded.
    Do you have any suggestions?

    Feel free to visit my blog post: Primal Testo XL

  46. Provera Irregular Periods New York

  47. Howdy would you mind stating which blog platform you’re using?
    I’m going to start my own blog in the near
    future but I’m having a difficult time deciding between BlogEngine/Wordpress/B2evolution and Drupal.

    The reason I ask is because your layout seems different then most blogs and I’m looking for something
    unique. P.S Sorry for getting off-topic but I had
    to ask!

    Feel free to surf to my web-site :: Far East XL Reviews

  48. I couldn?t resist commenting. Exceptionally well written!

    My blog post :: Pure CBD Softgels

  49. What’s up all, here every one is sharing such experience, therefore it’s good to read this blog,
    and I used to go to see this website all the time.

    Visit my homepage :: Captive Skin Face Cream

  50. I just like the valuable info you supply in your articles.
    I will bookmark your weblog and take a look at once more right here
    frequently. I’m quite sure I will be told lots of new stuff right right
    here! Good luck for the following!

    Here is my site :: Luiresse Skin Care

  51. Wow, amazing blog format! How long have you been running a blog for? you made running a blog glance easy. The full glance of your website is fantastic, as smartly as the content!

  52. http://buyplaquenilcv.com/ – hydroxychloroquine purchase online

  53. I have been browsing online greater than three hours
    nowadays, yet I by no means found any fascinating article
    like yours. It is pretty value sufficient for me.
    In my opinion, if all web owners and bloggers made
    good content as you did, the internet will probably
    be much more helpful than ever before.

    Also visit my page pubic hair

  54. Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something.
    I think that you could do with a few pics to drive
    the message home a bit, but instead of that, this
    is magnificent blog. A fantastic read. I’ll definitely be back.

    Look at my web page: having sex

  55. I and also my pals have already been looking through the excellent suggestions
    found on your web page and then all of the sudden came up with an awful suspicion I had not expressed respect to the web blog owner
    for them. Those people appeared to be as a result joyful to
    read through them and already have quite simply been tapping into them.
    Thanks for simply being quite considerate and also for considering variety
    of impressive resources millions of individuals are really desirous to
    discover. My honest regret for not expressing appreciation to

    Feel free to surf to my blog post … skin greatly

  56. We are a group of volunteers and starting a brand new scheme
    in our community. Your website offered us with valuable information how to have better sex paintings on. You have done
    an impressive job and our entire community shall
    be thankful to you.

  57. My brother recommended I might like this website.
    He was entirely right. This post actually made my day.
    You can not imagine simply how much time I had spent for this info!

    Feel free to visit my website genital hair removal

  58. Howdy just wanted to give you a quick heads up.
    The words in your article seem to be running off the
    screen in Internet explorer. I’m not sure if
    this is a formatting issue or something to do with web browser compatibility but I thought I’d post to let you
    know. The layout look great though! Hope you get the problem fixed soon. Thanks

    Here is my website: fat burners

  59. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet
    my newest twitter updates. I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this.

    Please let me know if you run into anything. I truly enjoy reading your
    blog and I look forward to your new updates.

    Also visit my web-site … cannabis dispensaries-san diego

  60. Hey very nice website!! Man .. Beautiful .. Amazing .. I’ll bookmark your
    web site and take the feeds additionally?I’m glad to seek out a lot of useful information right here in the publish, we need work out more techniques on this regard,
    thank you for sharing.

    my homepage :: substance abuse treatment

  61. Thank you a lot for providing individuals with such a breathtaking chance to
    read articles and blog posts from this site.
    It is usually very amazing and full of a lot of fun for
    me and my office colleagues to search your website on the least thrice per
    week to see the fresh issues you will have. Of course, I am usually contented with the gorgeous thoughts you give.

    Selected two tips on this page are particularly the
    most impressive I’ve ever had.

    my web site … foods rich in omega 3 fatty acids

  62. I have read so many articles or reviews
    eating healthy on a budget the topic of
    the blogger lovers except this post is actually a
    pleasant article, keep it up.

  63. Super-Duper blog! I am loving it!! Will come back again. I am bookmarking your feeds also

    Check out my blog post; http://www.aniene.net

  64. [url=https://www.blogexpander.com/]grow your blog – blogexpander[/url]

  65. Saved as a favorite, I love your site!

    my web page; http://forum.m2clasic.ro

  66. Hurrah, that’s what I was exploring for, what a stuff! existing here at this webpage, thanks admin of this site.

    Feel free to visit my site :: healthy eating diets

  67. https://buyneurontine.com/ – what is gabapentin prescribed for

  68. Good web site you’ve got here.. It?s difficult to find quality writing like
    yours these days. I truly appreciate individuals like you!
    Take care!!

    Here is my web-site :: skin health

  69. https://prednisonebuyon.com/ – pednisone over the counter at walmart

  70. 40mg Levitra Pills On Line For Sale

  71. Finasteride Vs Propecia Androgenetic Alopecia

  72. Hi there would you mind stating which blog platform you’re using? I’m planning to start my own blog in the near future but I’m having a hard time deciding between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your layout seems different then most blogs and I’m looking for something unique. P.S Apologies for being off-topic but I had to ask!

  73. Terrific work! This is the type of info that should be shared around the web. Shame on the seek engines for no longer positioning this publish upper! Come on over and consult with my web site . Thanks =)

  74. hello my lovely stopforumspam member

    What are the Types of Loans in Ohio depending on the purpose
    Specific purpose payday loans in Ohio. Funds received in debt may be spent only for a specific purpose specified in the loan agreement.
    Non-purpose loan. The debtor may spend the money received at his discretion.
    Most popular specific purpose payday loans in Ohio are:

    House loan. The most common, of course, is a mortgage when the purchased property acts as collateral for a loan. Sometimes a youth loan is issued, with lighter conditions for debtors. Still quite common is a housing loan that does not imply purchased housing in the form of collateral.
    Car loan – payday loans in Ohio to a car or similar vehicle. The key is often the purchased goods, making the terms of the loan better. Also, loan conditions are improved: car insurance, life and health insurance of the borrower, and receiving a salary to the account of the creditor bank.
    Land loan. To purchase a plot for construction or agricultural activities.
    Consumer. For purchases in modern supermarkets, equipment stores, you can take a personal loan right at the point of sale. Often, specialists located there can contact the bank and get a regular or fast payday loans. Borrowed funds automatically pay for the goods, and the consultant explains when and how to re-pay the debt.
    Educational loan. It is issued to students, as well as to applicants who have passed the competition, to pay for tuition at universities, colleges, etc.
    Broker loan. For the circulation of securities, payday loans in Ohio are issued to an exchange broker, se-curities are purchased securities.
    Others. Objectives not related to those listed, but agreed and approved by the creditor.

  75. You bear a really fantastic capability. Your marketing skill sets are extremely good. Many thanks for providing information over the internet and cultivating your readers.

  76. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get three emails with the same comment. Is there any way you can remove me from that service? Many thanks!

  77. whoah this blog is fantastic i love reading your posts. Keep up the good work! You know, many people are looking around for this info, you can help them greatly.

  78. Hi! I understand this is sort of off-topic however I needed to
    ask. Does operating a well-established blog such as yours require a massive amount work?

    I am brand new to running a blog but I do write in my journal daily.
    I’d like to start a blog so I will be able to share my experience and feelings online.

    Please let me know if you have any recommendations or great sex tips for brand new aspiring bloggers.


  79. I always used to study paragraph in news papers but now as I am a
    user of web therefore from now I am using net for content, thanks to web.

    Here is my homepage – Candra

Leave a Message

Your email address will not be published.

Powered by © ASPL Delhi.