# 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 and test connectivity in this case

**URL:** <https://community.jenkins.io/t/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-and-test-connectivity-in-this-case/949>\
**Category:** Using Jenkins\
**Tags:** question\
**Created:** [December 4, 2021, 3:56pm UTC](https://community.jenkins.io/t/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-and-test-connectivity-in-this-case/949 "2021-12-04T15:56:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![radhe](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@radhe](https://community.jenkins.io/u/radhe)\
**Post date:** [December 4, 2021, 3:56pm UTC](https://community.jenkins.io/t/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-and-test-connectivity-in-this-case/949/1 "2021-12-04T15:56:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [December 4, 2021, 8:19pm UTC](https://community.jenkins.io/t/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-and-test-connectivity-in-this-case/949/2 "2021-12-04T20:19:32Z")

</div>

You could use a Jenkins Pipeline `sh` step to call `ssh other-host.example.com /path/to/your-script`.

---

<div class="post-metadata">

**Author:** ![radhe](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@radhe](https://community.jenkins.io/u/radhe)\
**Post date:** [December 5, 2021, 1:47pm UTC](https://community.jenkins.io/t/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-and-test-connectivity-in-this-case/949/3 "2021-12-05T13:47:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [December 5, 2021, 4:01pm UTC](https://community.jenkins.io/t/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-and-test-connectivity-in-this-case/949/4 "2021-12-05T16:01:33Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![radhe](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@radhe](https://community.jenkins.io/u/radhe)\
**Post date:** [December 5, 2021, 4:26pm UTC](https://community.jenkins.io/t/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-and-test-connectivity-in-this-case/949/5 "2021-12-05T16:26:46Z")

</div>

The console output is showing host-key verification failed  
build step ‘execute shell’ marked as build failure

---

<div class="post-metadata">

**Author:** ![radhe](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@radhe](https://community.jenkins.io/u/radhe)\
**Post date:** [December 5, 2021, 4:33pm UTC](https://community.jenkins.io/t/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-and-test-connectivity-in-this-case/949/6 "2021-12-05T16:33:55Z")

</div>

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’.

---

<div class="post-metadata">

**Author:** ![radhe](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@radhe](https://community.jenkins.io/u/radhe)\
**Post date:** [December 5, 2021, 4:37pm UTC](https://community.jenkins.io/t/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-and-test-connectivity-in-this-case/949/7 "2021-12-05T16:37:21Z")

</div>

@MarkEwaite please message me .i need your help. my email id is “[pagebuffer408@gmail.com](mailto:pagebuffer408@gmail.com)”.

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [December 5, 2021, 5:08pm UTC](https://community.jenkins.io/t/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-and-test-connectivity-in-this-case/949/8 "2021-12-05T17:08:32Z")

</div>

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?](https://linuxhint.com/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](https://plugins.jenkins.io/config-file-provider/) 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.
