I am recieving the below error when trying to perform a command on a remote server. this is a fresh install of foreman
Error initializing command: RuntimeError - Unable to create directory on remote system /var/tmp/foreman-ssh-cmd-xxxxx: exit code: 255
2:
root@{redacted}: Permission denied (publickey,password).
this is running the latest build of katello running on centos streams.
I have confirmed the /var/tmp directory is accessible and performed a verbose scp from the foreman server to the remote server using the svc account that i have created on the client side. the scp test was successful
I have these plugins
foreman-tasks foreman_ansible foreman_discovery Foreman_host_reports foreman_monitoring foreman_puppet foreman_remote_execution Foreman_snapshot_management foreman_templates katello
So there is your problem. Read the tooltip on the “Effective user” when setting up the job invocation:
A user to be used for executing the script. If it differs from the SSH user, su or sudo is used to switch the accounts.
Unless you change the ssh user in Administer - Settings - Remote Execution the default SSH user is root, i.e. it uses root to connect to the remote host and then does sudo or su do change to the effective user.
There was a field that had set effective user Method. the options where sudo, su, and dzdu
I set this to sudo, i also found there was two fields for passwords. effective user and ssh user.
I had set one but not the other.
upon setting these options and removing the sudo from my command i was executing it was able to complete successfully