Install SSH in init.gz?
-
We’re still on Fog 0.32 and want to have units automatically approved in PacketFence when we register a system.
I have found how to do this via their pfcmd script and was able to successfully run tests via ssh from the standard Ubuntu shell on the Fog Server. Now, I need to figure out how to “install” ssh capabilities in the init.gz file. I know how to extract the contents and repackage them, that’s not an issue. My issue is that I simply don’t know (nor can I Google-find) which files, from where, should go where.
I tried copying “/usr/bin/ssh” to “initmountdir/usr/bin/ssh” as well as a few /etc/ssh, /lib, and /lib64 files and their symlinks. But, alas, I still get error messages as if there’s some prerequisite missing. Here’s the error message at the time of this writing:
So… does anyone know how properly inject ssh into init.gz?
TIA
-
I’m almost certain that SSH is built into newer versions of FOG already. Have you considered upgrading? .32 is aging and will support fewer and fewer systems as time passes.
-
@Wayne-Workman “almost certain” can be changed to IT IS CERTAIN! I use it all the time now especially when I need to test updated code, but without having to recompile the init’s every time I want to test the updates.
-
@Tom-Elliott said:
@Wayne-Workman “almost certain” can be changed to IT IS CERTAIN! I use it all the time now especially when I need to test updated code, but without having to recompile the init’s every time I want to test the updates.
Lol… I wasn’t sure if it was just in the dev version or if it was in 1.2.0 too.
-
@Wayne-Workman Ah, no it is not in 1.2.0.
-
@TreyBentley Ok then Mr. Bently, for this to be done for you, please first export your DB as a backup (or snapshot it if it’s a VM).
Examples for how to do this via CLI can be found here. https://wiki.fogproject.org/wiki/index.php/Troubleshoot_MySQL
Then install 1.2.0 and get that working soundly.
Export your DB again like this:
FOG Configuration -> Configuration Save -> Export
Host Management -> Export Hosts -> ExportNow, to move to trunk - you may or may not need to upgrade to a newer operating system… You haven’t told us what you are using.
But instructions on upgrading to FOG Trunk can be found here: https://wiki.fogproject.org/wiki/index.php/Upgrade_to_trunk -
I realized after I posted that a recommendation would probably be to update. However, due to some other rather heavy modifications to the PXE menu, other host reg questions, and even a handful or two of the php files, it would be counter-productive to take away so much automation that I’ve built up over the years. Our techs would be thrown back into manual processes until I could modify the new build to be similar to the current.
Anyway, I gave up on trying to inject ssh into the init.gz file, and instead made a wget call after host reg with post-data to a php file that could then in turn run the ssh commands I needed. ^_^ Go me.
Thanks for the time y’all took to reply, though! I appreciate it!
-
@TreyBentley If you would like help to figure out what customizations you will still need to do to get to trunk, we are available.
There is a LOT of differences between 1.2 and trunk, and that much more so between 0.32 and trunk.
Many of the things people have been requesting, and I’m guessing some of your own customizational needs, have been addressed. Of course I can’t do everything for everybody but don’t think we won’t try to help you out.
-
I’m solving this thread as installing ssh in the init.gz is possible, but would require the user to rebuild a custom init.gz. Just inserting the needed files isn’t enough as components of the programs capabilities need to be built specifically to the init environment. It is not a simple copypasta operation.
-
@Tom-Elliott wouldn’t it be possible, however, to download the latest trunk with SSH installed already, decompress, replace the new fog scripts with the versions from 0.32, and re-compress?
-
@Junkhacker Technically yes.