Foreman 3.10.0 Remote execution fails after connection to target

When using remote execution with Foreman it fails with:

Authentication method ‘publickey’ failed with:
‘true’ is not recognized as an internal or external command,
operable program or batch file.

It happens on every possible run. No matter if i try to run puppet agent from the Foreman gui or if i send a script with “echo ‘hello world’” or any other template.

Expected outcome:
Remote Execution runs without error
Foreman and Proxy versions:

Foreman and Proxy plugin versions:
foreman_remote_execution 13.0.0

Distribution and version:

Other relevant data:

The lgos show that the ssh command ends with ‘true’ which is sent to the target shell and creates the error message.

Running: ssh -o User=foreman-proxy -o Port=22 -o IdentityFile=/var/lib/foreman-proxy/ssh/id_rsa_forem an_proxy -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new -o LogLevel=error -o ControlMaster=auto -o ControlPath=/var /tmp/219f76dc-45da-4810-b97f-45eb9377a9ee -o ControlPersist=yes -o ProxyCommand=none -o ServerAliveInterval=15 -o ServerAliveC ountMax=3 -o PreferredAuthentications=publickey -o NumberOfPasswordPrompts=0 true
2024-05-21T13:16:07 [D] ‘true’ is not recognized as an internal or external command,
2024-05-21T13:16:07 [D] operable program or batch file.

Is there a way to edit the string myself?

Thank you all for your help!

Forgot to input the Distro.
I’m running on AlmaLinux 9.4

I tested around a little and found that the problem only exists if the target is a Windows machine. On Linux true gets interpreted correctly and everything runs.

To be honest I don’t think we ever tested remote execution against windows machines. Ansible might get you better results, but ymmv

Thanks for your reply. I guess I am the only one trying to work with Windows Servers :smiley:

I tested some approaches with cygwin and msys2. They do work in a way, but it is a mess to configure everything around them.
Right now i’m trying Puppet Bolt as a way, since I still don’t really understand how Ansible works.

Is there any plan to include a way for making remote execution work on windows servers? I guess it could be really easy to set up using openssh on the targets. The only thing neccessary would be to change the folders for temp file creation to a Windows based path, if i’m not mistaken.

No, I’m afraid not, or at least I’m not aware of any. On the other hand, we wouldn’t say no to a patch that would make this work.

Maybe I’m just being pessimistic, but there would probably be more.

Yeah, there is always more i’m afraid. I would love to understand your codebase more and try to help implementing this feature.
I looked into the git repo and was a little overwhelmed. Is there a technical documentation or something to read into for better understanding?

Sadly no, but if you would join us on theforeman-dev on matrix I’d be more than happy to answer any questions you might have.

I admit it might be daunting at first, but once you get your bearing and wrap your heard around some of the concepts used there it shouldn’t be that bad.