Feature Request — Automatic Root SSH Authentication for FOS Debug Tasks
-
Hi Tom,
I would like to suggest an improvement to the existing SSH functionality in FOS Debug Mode.
While working on IPv6 PXE, NFS, and multicast troubleshooting, I frequently need remote SSH access to physical computers running FOS Debug tasks.
- Current behavior
I checked the FOS source code and confirmed that OpenSSH Server is already included.
The current sshd_config contains:
PermitRootLogin yes
PasswordAuthentication yesTherefore, there is no need to install or implement another SSH server.
The actual problem is that the root account does not have a known, usable password for remote login.
Currently, after starting a Debug Deploy or Debug Capture task, I have to physically visit the computer, set a password using passwd, and only then connect remotely.
This becomes especially inconvenient when troubleshooting multiple computers.
- Proposed functionality
Could FOG automatically configure root SSH authentication when a FOS Debug task starts?
For example, in my isolated FOG Mobile testing environment, I would like to connect using:
- Username: root
- Password: password (example for a controlled lab)
- SSH port: 22
Immediately after the computer enters Debug Mode, I should be able to connect using:
Or over IPv6:
ssh root@fd71:6a85:f038:1::100
Without needing physical access to the computer.
- Suggested FOG settings
My suggestion is to introduce a small section under:
FOG Configuration → FOG Settings → Debug Settings
For example:
Setting Description
FOG_DEBUG_SSH_ENABLED Enable SSH access for Debug tasks
FOG_DEBUG_SSH_PASSWORD_ENABLED Allow password authentication for root during Debug tasks
FOG_DEBUG_SSH_PASSWORD Administrator-configured Debug password
FOG_DEBUG_SSH_AUTHORIZED_KEYS Optional SSH public keys for key-based authenticationI would suggest keeping password authentication disabled by default and allowing administrators to enable it explicitly.
It would also be useful to allow a per-task override when launching Debug Deploy or Debug Capture.
- Automatic configuration
When a computer starts a Debug task, FOS could:
- Detect that the current task is running in Debug Mode.
- Ensure that the existing OpenSSH service is running.
- Enable the requested root authentication method.
- Set the configured root password, if password authentication is enabled.
- Install the configured SSH public keys, if applicable.
- Display the available IPv4 and IPv6 addresses on the Debug console.
- Keep SSH access available throughout the Debug session.
The administrator would not need to run passwd manually or modify the FOS init image.
- Security considerations
I understand that automatically enabling root SSH access requires appropriate security controls.
My suggestions are:
- Keep the feature disabled unless explicitly configured.
- Enable the configured authentication only for Debug tasks.
- Never hardcode a universal root password into the FOS image.
- Never expose the password in plaintext in PXE URLs, kernel parameters, HTTP logs, or diagnostic output.
- Use a protected credential-delivery mechanism rather than sending the password directly through iPXE.
- Support SSH public-key authentication as the preferred option.
- Optionally support a randomly generated password for each Debug task, visible only to authorized FOG administrators.
- Ensure that Debug SSH credentials do not persist into normal Deploy or Capture environments.
For my isolated laboratory, a configurable shared password would be convenient, but a per-task password or an SSH key would be preferable for production environments.
- Expected workflow
The ideal administrator workflow would be:
- Configure Debug SSH authentication once in FOG Settings.
- Select a computer and launch Debug Deploy or Debug Capture.
- Boot the client through PXE.
- FOS automatically enables the configured root SSH authentication.
- See the client’s IPv4 and IPv6 addresses on the console.
- Connect remotely immediately and begin troubleshooting.
No physical visit and no manual password configuration would be required.
- Why this would be useful
This would be particularly helpful for investigating:
- IPv4/IPv6 network configuration.
- DHCPv6 and DNS resolution.
- PXE, HTTP, and TFTP behavior.
- NFS mounts and storage connectivity.
- Disk detection and RAID controllers.
- UDPcast and multicast sessions.
- Kernel messages and FOS debugging.
It would significantly simplify troubleshooting when testing many physical computers simultaneously.
Final suggestion
My preferred implementation would be:
Reuse the existing OpenSSH server, enable root SSH authentication automatically for Debug tasks, and make the authentication method configurable through FOG Settings.
For an initial implementation, even a simple opt-in setting such as FOG_DEBUG_SSH_PASSWORD_ENABLED, combined with a configurable password delivered securely to FOS, would already be extremely useful.
SSH public keys and automatically generated per-task credentials could provide additional flexibility.
Would you consider adding this feature to FOS and FOG Server?
Thank you again for your continued work on FOG and IPv6 support!
-
@sgennadi Thanks for the detailed write-up. You are right that FOS already runs sshd and allows root login. The only gap is that root has no credential you can use remotely.
I filed this as https://github.com/FOGProject/fogproject/issues/2193 with a key-only design:
- You put one or more SSH public keys in a FOG setting.
- When a debug task starts, FOS fetches the keys and installs them for root.
- FOS shows the IPv4 and IPv6 addresses on the console, so you can connect right away.
- Normal deploy, capture, and registration tasks never install the keys.
A public key is not a secret, so it can reach FOS without any protected delivery. A root password is different. It needs a protected way to reach FOS, and a kernel argument would expose it. So a configured password and a random password for each task are out of scope for now. Each can be its own request after the key version ships.
Until then, the workaround is the one you already use: run
passwdat the debug console, then connect with SSH.