# How can I connect to a server by SSH connection?

**URL:** https://discourse.nodered.org/t/how-can-i-connect-to-a-server-by-ssh-connection/64181
**Category:** General
**Created:** [20 June 2022 18:09 UTC](https://discourse.nodered.org/t/how-can-i-connect-to-a-server-by-ssh-connection/64181 "2022-06-20T18:09:40Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![HuOliveiraWork](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/huoliveirawork/32/62521_2.png) [@HuOliveiraWork](https://discourse.nodered.org/u/HuOliveiraWork)
#### Post date: [20 June 2022 18:09 UTC](https://discourse.nodered.org/t/how-can-i-connect-to-a-server-by-ssh-connection/64181/1 "2022-06-20T18:09:40Z")

</div>

Hello everyone!

I am a bit lost on the tools I can use to make a connection to a server in node-red. My idea is to shutdown a server from the platform, for that I was thinking to make an ssh connection with the server and run a command on the server's machine. Is this possible to do? If so, how?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [20 June 2022 18:27 UTC](https://discourse.nodered.org/t/how-can-i-connect-to-a-server-by-ssh-connection/64181/2 "2022-06-20T18:27:41Z")

</div>

try the **node-red-contrib-bigssh** node  
havent used it myself but it says in its description

> Big SSH is an input node for node-red to execute command over ssh to a remote host Command can be set as a property of the node. Payload can be used to add arguments to the command and now, the command can be a javascript template string and payload the variables

> **[node-red-contrib-bigssh](https://flows.nodered.org/node/node-red-contrib-bigssh)**
>
> A Big SSH

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [20 June 2022 20:04 UTC](https://discourse.nodered.org/t/how-can-i-connect-to-a-server-by-ssh-connection/64181/3 "2022-06-20T20:04:23Z")

</div>

You can use the exec node to run a remote command over SSH. Look up how to do a command line SSH connection and automatically run a command.

Best done if you set up certificate based access to the server so you don't have to faff with ids and passwords. Also, if you need to run a remote command requiring `sudo`, you might want to mess with the servers `sudoers` entries so that you don't need to enter an additional sudo password (which won't work via exec).

---

<div class="post-metadata">

### Author: ![HuOliveiraWork](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/huoliveirawork/32/62521_2.png) [@HuOliveiraWork](https://discourse.nodered.org/u/HuOliveiraWork)
#### Post date: [21 June 2022 09:41 UTC](https://discourse.nodered.org/t/how-can-i-connect-to-a-server-by-ssh-connection/64181/4 "2022-06-21T09:41:22Z")

</div>

Thanks, that's just what I was looking for. I think I can work with that from now on

---

<div class="post-metadata">

### Author: ![HuOliveiraWork](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/huoliveirawork/32/62521_2.png) [@HuOliveiraWork](https://discourse.nodered.org/u/HuOliveiraWork)
#### Post date: [21 June 2022 09:42 UTC](https://discourse.nodered.org/t/how-can-i-connect-to-a-server-by-ssh-connection/64181/5 "2022-06-21T09:42:31Z")

</div>

Ah yes, that makes sense. Thanks for the tip

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [5 July 2022 09:42 UTC](https://discourse.nodered.org/t/how-can-i-connect-to-a-server-by-ssh-connection/64181/6 "2022-07-05T09:42:51Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
