Linux Fixlet Creating

(imported topic written by stephen.c.perez@lmco.com91)

here is what I am trying to…

I need to replace a sudoers.allow file on my linux 5.0 servers using bigfix… OK… so how do I do that?

here is what needs to be done:

Copy the original to /etc/sudoers.old

copy the new one to /etc/sudoers

owner/group should be root:root

permissions should be 440

i dont see anyway to do this…

(imported comment written by BenKus)

Hi Stephen,

I don’t have a Linux system to test on, but this should get you started:

Create a Fixlet with the relevance (so it will become relevant on any computer that hasn’t already copied the file… feel free to add more relevance to further refine the systems):

(name of operating system as lowercase contains “linux”) AND (not exists file “/etc/sudoers.old”)

The actionscript will look like:

// download sudoers file from a server somewhere… look up the BigFix “prefetch” command to allow you to download the file AND verify the sha1 to make sure it wasn’t changed en route
download http://someserver.com/somedir/sudoers

move /etc/sudoers /etc/sudoers.old
move __Download/sudoers /etc/sudoers

// I am not very good with Linux permissions, so you might want to modify these to work appropriately (I am just guessing)
waithidden chown root:root /etc/sudoers
waithidden chmod 440 /etc/sudoers

Ben

1 Like