Skip to main content
Solved

How do I change any /etc/...conf file I want via script in Self Service?


Forum|alt.badge.img+5
  • Contributor
  • 30 replies

I am trying to change the /etc/krb5.conf file. I have specific settings that I can't share... what I did was create a policy, under files and processes I put vi /etc/krb5.conf and the bash script I need run to change these settings. Did I do this right?

Best answer by ThijsX

@kdean on your own mac do the following, it is pretty easy.

  • Create your correct krb5.conf config file
  • copy/replace the new krb5.conf file to /etc/
  • Start in this case Composer.app
  • Drag and drop the /etc/krb5.conf file to composer
  • Make sure to set correct permissions in composer
  • Create PKG and test and distribute to your fleet
  • Roll out the PKG via Self Service, or the way you prefer.

This can be done on various ways, scripts that pulls down the file from a public share oi. Packages with copy/replace scripts

Cheers

View original
Did this topic help you find an answer to your question?

13 replies

Forum|alt.badge.img+1

removed


Forum|alt.badge.img+12
  • Contributor
  • 61 replies
  • February 25, 2019

Actually you want to create your script in the editor of your choice or within computer management/scripts/new. If you want you can upload the script you created into JAMF via JAMF admin. Then within your policy go to scripts and add your script there.


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 30 replies
  • February 25, 2019

@ifbell I created the script in the editor of choice, I uploaded the script via JAMF Admin, but it is not changing the /etc/krb5.conf on the machine I scoped it to, I put vi /etc/krb5.conf under files and processes. I even put sudo vi .... and neither worked.


Forum|alt.badge.img+9
  • Contributor
  • 149 replies
  • February 25, 2019

@kdean Does the script do what you want when you run it locally on the system with sudo sh /path/to/script.sh?

If so, you should be able to go to your policy and use the Scripts payload. Choose your script (leaving it set to After should be fine).

Once you have the script payload in your policy, you can remove the item from files & processes.


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 30 replies
  • February 26, 2019

@merps What if I just want to replace the /etc/krb5.conf file without creating a script to replace it. Currently these machines have a blank /etc/krb5.conf file, is there a way to just have this file uploaded to each machine that runs the script from Self Service?


Forum|alt.badge.img+14
  • Honored Contributor
  • 351 replies
  • April 23, 2019

@kdean Did you find a solution to this?


ThijsX
Forum|alt.badge.img+19
  • Employee
  • 369 replies
  • Answer
  • April 23, 2019

@kdean on your own mac do the following, it is pretty easy.

  • Create your correct krb5.conf config file
  • copy/replace the new krb5.conf file to /etc/
  • Start in this case Composer.app
  • Drag and drop the /etc/krb5.conf file to composer
  • Make sure to set correct permissions in composer
  • Create PKG and test and distribute to your fleet
  • Roll out the PKG via Self Service, or the way you prefer.

This can be done on various ways, scripts that pulls down the file from a public share oi. Packages with copy/replace scripts

Cheers


Forum|alt.badge.img+2
  • New Contributor
  • 8 replies
  • April 23, 2019

I do exactly what you are looking do. I use the steps @txhaflaire describes to deploy mine. Works great.


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 30 replies
  • April 29, 2019

@txhaflaire thank you for this. This makes more since to me now. I was trying to upload the script directly to Jamf Admin before putting it through Composer. That makes sense now. I really didn't understand why we were doing that in Jamf training. It seems sometimes I can put a script directly into Admin and then run a policy and it works. So I am assuming that if it involves machine settings it has to be run through Composer then Admin and then assign to policy etc? I probably didn't say that the most eloquently lol


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 30 replies
  • April 29, 2019

@txhaflaire also, what permissions would you assign to the krb5.conf file? I am thinking 755 or 777 but I am not sure.


Forum|alt.badge.img+12
  • Valued Contributor
  • 359 replies
  • April 30, 2019

644 is the correct mode for krb5.conf. Group and Others should not have write access, nobody need execution permissions.


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 30 replies
  • April 30, 2019

Forum|alt.badge.img+6
  • New Contributor
  • 9 replies
  • April 2, 2025
ThijsX wrote:

@kdean on your own mac do the following, it is pretty easy.

  • Create your correct krb5.conf config file
  • copy/replace the new krb5.conf file to /etc/
  • Start in this case Composer.app
  • Drag and drop the /etc/krb5.conf file to composer
  • Make sure to set correct permissions in composer
  • Create PKG and test and distribute to your fleet
  • Roll out the PKG via Self Service, or the way you prefer.

This can be done on various ways, scripts that pulls down the file from a public share oi. Packages with copy/replace scripts

Cheers


works perfectly, no need to re-invent the wheel :)


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings