I am currently working on multiple Kickstart configs for my company to allow for easy VM deployment. I cannot find any documentation showing how to have Kickstart generate a root password. Is it possible? If not, can I pipe in output from python or the likes into the rootpw option?
Asked
Active
Viewed 1,168 times
3
FireFaced
- 33
- 5
1 Answers
0
what I do in this situation is generate a 100char long string and then strip randomly out of it from the beginning and the end and then just grab the first X (15 in my case) chars
[...kickstart...]
%post
HOWLONG=15 ## the number of characters
NEWPW=$(< /dev/urandom tr -dc A-Za-z0-9 | head -c100 | head -c$((20+($RANDOM%20))) | tail -c$((20+($RANDOM%20))) | head -c${HOWLONG});
echo "${NEWPW}" | passwd --stdin root
[... rest of the %post block ...]
%end
[...kickstart...]
MatteoBee
- 116