Not sure if I am doing this right, still testing, have Foreman server running all seems OK.
added a Cent OS 7 client all good.
Tried to schedule a job to update all packages, I can only get work if SSH port is 22
and PermitRootLogin is set to yes, unfortunately, we run SSH on a different port and
PermitRootLogin is set to no, I have tried setting the effective user in advanced section
of the job, but I still get the error “Error initializing command: Net::SSH::AuthenticationFailed - Authentication failed for user - root”
Can anyone point me in the right direction, to change the SSH port and the default SSH user?
OK found the port settings have changed the port and default user, but still got the error
“You need to be root to perform this command.” we don’t allow remote access by root?
Thanks found the settings, getting a bit further down the line, do you know where I can set
the root password, have tried setting in the Advanced fields on Job invocation page, but
I am getting error “Password: su: Authentication failure”, I know password is correct as I
can SSH from server to client ans su on the client?
Thanks, but something is not right,
I am running the job template Update all packages (yum update -y)
Have set the user and pass as effective user.
I can run the cmd with no problem when I SSH from the server to the client as the effective user.
but when I schedule the job in foreman I get this error?
What are you really trying to acomplish? In what you just posted you are setting both the remote user and effective user to foreman. Why would you need to do anything with sudo then?
I am running a Job that runs the cmd remotely “yum update -y” it will only run as root or as sudo,
it looks like the cmd is running but it is not getting the password.