Skip to content

Instantly share code, notes, and snippets.

@c0psrul3
Created September 28, 2016 20:27
Show Gist options
  • Save c0psrul3/2a7837e538b0df0d83529f1392f0ef9e to your computer and use it in GitHub Desktop.
Save c0psrul3/2a7837e538b0df0d83529f1392f0ef9e to your computer and use it in GitHub Desktop.
encrypted root password KNOWN - for distribution (CentOS)

[[https://www.crucial.com.au/blog/2011/06/29/centos-kickstart-files-encrypting-the-root-password/]]

Hiya folks!

Okay so this one is pretty hard to find in google, honestly its a tricky one to work out if you haven’t experienced it before and you aren’t a kickstart wizard or fly like a g6!

But alas! I am here to guide and show you the way of the wizard!

So basically in your kickstart file you might have something like:

——————-

###########SECURITY SETUP#############

authconfig –enableshadow –enablemd5

selinux –disabled

firewall –disabled #–port=22:tcp

rootpw MyAwesomePassword

######################################

However, what happens if someone gets your kickstart? oops they have your root password! (EEP!)

You can encrypt this my friends so it will become:

###########SECURITY SETUP#############

authconfig –enableshadow –enablemd5

selinux –disabled

firewall –disabled #–port=22:tcp

rootpw –iscrypted $1$lYXefgfS$szRod3HzNdS44w385NjRI/

######################################

To do this on CentOS just run the following:

[root@Megatron~]# openssl passwd -1 “MyAwesomePassword”

Tada, you have a created a secure password for your kickstart file 😀

Now back to coding…

Cheerio,

Karl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment