I'd like to make an universal automated install script using Kickstart, which would be placed on a CD and used in conjunction with standard DVD installer, i.e. the user of this script would need to append inst.ks=cdrom
to boot options and then it'd install e.g. Fedora on the machine asking only for passwords.
It seems that standard practice is to generate Kickstart scripts with passwords (or password hashes) in them, which doesn't seem ideal if you intend to distribute the script to third parties. I also want to enable sshd service in the Kickstart script, which would make it possible for anyone on LAN with knowledge of default passwords to log in into the machine. Of course I can just disable password authentication in sshd but now it's getting messy, i.e. I'm trying to workaround public knowledge of default passwords (and I may very well be forgetting something).
I'm new to Kickstart, I'd like to make the install script to ask/prompt/input for site-specific passwords, and so far I figured out two options:
- Ask for passwords in
%pre
section and then generate e.g.accounts.ks
withrootpw
anduser
commands which will be included from main command section. - Use static default passwords and run interactive script on first boot that'll force user to change default passwords. (Or possibly use
chage
in%post
.)
My worry is that, based on my Google searches, no one is doing that, no one is even asking for that. :-) Everyone seem to be placing final passwords/hashes directly into Kickstart scripts. So this leaves me with making my own interactive script for both options, which, I fear, will end up bad. Or perhaps, I'm getting the whole concept of (semi-) automated installs with Kickstart wrong.
What is the standard practice for creating universal Kickstart scripts for scenarios like this, where you need to distribute the script and not force users to edit it?
If you do not provide an answer for something that is required, Anaconda will prompt the user for it.
I've verified this commenting out my user and rootpw lines in the Kickstart file. Upon installation everything else is pre-populated, but I am asked to create a root password and user. (user is optional)
In text mode, the installation will wait for user input before continuing. In graphical mode the installation will proceed while it allows for you to supply a password during package installation. Lastly, cmdline mode does not support user interaction and will halt.
Ex:
The previous Anaconda screens were skipped and installation went directly to package installation. At the end of installation, Anaconda waits for a root password to be selected and optionally, a user created.
(This might be a little late, and maybe a bit long, but this is exactly what I've done, which has taken me months/years to perfect).
All of the install information (eg, boot media/install tree, packages, scripts) are on a main server. The kickstart file is also there. BTW: I am using Fedora, but I don't think that makes any real difference for this method. See this link for more info on how to use pxe to boot and install for how fedora does it; it also includes very useful links for each step.
Without going into too much detail this is my process:
NB: you can access the boot command line via the file
/proc/cmdline
, so you could put extra information for the%pre
(such as hostname). These are ignored by the installer.NB (also): be aware that even though network access is available, the resolver isn't, so you'll have to use only ip addresses.
I hope this helps somebody to make this process very simple, and perhaps useful.