ITADN

Issue automating remote unlock

#114Closedfishd72 创建于 2025-12-20
F
fishd72commented
I'm looking to allow for the unlocking of a remote device from a users workstation via a small script / function that looks up passwords from a password manager. The remote box is running Fedora 43, if that makes any difference. I've found that if I manually add `ForceCommand systemd-tty-ask-password-agent` to `/usr/lib/dracut/modules.d/46sshd/sshd_config` that after running `dracut -f -v` and rebooting, the command is executed automatically on boot, and my scripts work. However, updating the device causes this file to be overwritten, so I lose my auto-unlock function. I've tried adding a file `/etc/sysconfig/dracut-sshd` (and running `dracut -f -v` etc) but I'm unsure as to the correct contents and I'd appreciate some guidance. I've tried the following, all as single lines within an otherwise empty file: 1. `Force Command systemd-tty-ask-password-agent` - this does not apply to the resulting SSHD config but I can still SSH into the box and run the command manually 2. `SSHD_OPTS="ForceCommand systemd-tty-ask-password-agent"` - does not apply to the resulting SSHD config but I can still SSH into the box and run the command manually 3. `OPTIONS="ForceCommand systemd-tty-ask-password-agent"` - tried this after looking at `/etc/sysconfig/sshd` but this causes SSHD to fail to launch during boot Thanks.
关闭于 2025-12-21 2 条评论