my jenkins is installed on one linux server and my shellscript is present on another linux server can any one suggest me how i can execute my code in this case.
You could use a Jenkins Pipeline sh
step to call ssh other-host.example.com /path/to/your-script
.
is this possible without adding the server details inside manage jenkins>configure-system in the ssh part ,if possible can you provide a example script then it will be helpful
The command I provided is the sample script.
Have you tried it yourself? What did you observe when you tried it? What did you do based on what you observed?
The console output is showing host-key verification failed
build step ‘execute shell’ marked as build failure
i am trying to execute command in the build section>executeshell , first i tried to ssh into the another server then try to run the script but as a result in the console output it is showing host key verification failed and build step ‘execute shell’ marked as build failure’.
@MarkEwaite please message me .i need your help. my email id is “pagebuffer408@gmail.com”.
I intentionally do not provide private coaching. This is a public forum where many can help each other.
See What Does “Host Key Verification Failed” Mean? for a description of that error message.
There are many different ways that you could deliver the known_hosts file to the agent. You could configure the agents with the known_hosts file that includes the host key from the remote host. You could us the config file provider plugin to distribute the known_hosts file to the agent. I’m sure there are other ways.
The remote host will require a private key on the agent with the matching public key listed in the authorized_keys
file of the destination computer.
Private key authentication and remote calls with ssh are all things that you can practice and configure outside Jenkins. Once you understand the steps necessary to configure private key based ssh access to the remote server, you can implement those same steps in Jenkins.