# How to connect server using sftp node

**URL:** https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488
**Category:** General
**Created:** [6 September 2020 02:27 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488 "2020-09-06T02:27:02Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![minhhn0205](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/minhhn0205/32/29062_2.png) [@minhhn0205](https://discourse.nodered.org/u/minhhn0205)
#### Post date: [6 September 2020 02:27 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/1 "2020-09-06T02:27:02Z")

</div>

I would like to get the file from the server using sftp in Node-RED,  
so I installed XAMPP as the file server.  
After installing XAMPP, I configured FileZilla to port 22 and set the username and password.

![xampp-sftp-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/9/c90884eeec0dfee032977db495f7b3a94e53412a.png)  
 ![xampp-sftp-02](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/b/fb6ccced717fa5a954d9df88b20bbdc08df01d14.png)

I used the **SFTP** node `node-red-contrib-sftp`, but the connection failed:

 ![xampp-sftp-03](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/0713a84d574466b0b8d4818823cc00539a088b05.png)

when using the **FTP** node `node-red-contrib-ftp`, the connection was successful:

 ![xampp-ftp-04](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/789bbde4cf960fea0fe2d9820ae8093f76413969.png)

I don't know why connecting XAMPP using SFTP node failed.  
Any hint will be great.  
Or is there another way to connect to a file server using SFTP. Please tell me!  
Thanks.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [6 September 2020 04:53 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/2 "2020-09-06T04:53:41Z")

</div>

> [@minhhn0205](#):
>
> I used the **SFTP** node `node-red-contrib-sftp` , but the connection failed:

 ![Screenshot 2020-09-06 at 06.52.53](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/935b593077539efd47c89110ce558310219bb587.jpeg)

This is not a server. Remove `admin@` and try again.

---

<div class="post-metadata">

### Author: ![minhhn0205](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/minhhn0205/32/29062_2.png) [@minhhn0205](https://discourse.nodered.org/u/minhhn0205)
#### Post date: [6 September 2020 06:19 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/3 "2020-09-06T06:19:22Z")

</div>

> [@bakman2](#):
>
> This is not a server. Remove `admin@` and try again.

The `Server` value is a combobox that is automatically generated after configure the server connection information and then click the `Update` button ☹

 ![xampp-sftp-05](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/2/924b894dd87aa4df701a378759b71bbec874e56b.png)

```auto
[{"id":"a5c9a53c.a36f58","type":"inject","z":"d6ab8c0.aa95178","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":210,"y":820,"wires":[["b56bedd5.4693a"]]},{"id":"a16276c1.4b53b8","type":"debug","z":"d6ab8c0.aa95178","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":820,"wires":[]},{"id":"b56bedd5.4693a","type":"SFTP-main","z":"d6ab8c0.aa95178","path":"/","method":"list","remoteFilePath":"/xampp/htdocs","localFilePath":"/","remoteDestPath":"/","useCompression":"","encoding":"utf8","mode":"","recursive":"false","server":"c55f3b84.02ae58","x":370,"y":820,"wires":[["a16276c1.4b53b8"]]},{"id":"7b74be47.3420d","type":"inject","z":"d6ab8c0.aa95178","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":210,"y":880,"wires":[["41b1b9b8.c410a8"]]},{"id":"49caeac1.54d7e4","type":"debug","z":"d6ab8c0.aa95178","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":880,"wires":[]},{"id":"41b1b9b8.c410a8","type":"ftp in","z":"d6ab8c0.aa95178","ftp":"65d6732b.da623c","operation":"list","filename":"","localFilename":"","name":"","x":370,"y":880,"wires":[["49caeac1.54d7e4"]]},{"id":"c55f3b84.02ae58","type":"SFTP-credentials","z":"","host":"127.0.0.1","port":"22","username":"admin","password":"12345678"},{"id":"65d6732b.da623c","type":"ftp","z":"","host":"localhost","port":"22","secureOptions":"","user":"admin","connTimeout":"","pasvTimeout":"","keepalive":""}]

```

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [6 September 2020 06:30 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/4 "2020-09-06T06:30:25Z")

</div>

ah ok my bad. then i don't know.

---

<div class="post-metadata">

### Author: ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)
#### Post date: [6 September 2020 07:03 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/5 "2020-09-06T07:03:11Z")

</div>

Does anything show up in the FileZilla logs when you try to connect?

I assume you're only doing testing but if you're only planning to connect locally, maybe the connection does not need to be secure and you could use regular FTP?

---

<div class="post-metadata">

### Author: ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)
#### Post date: [6 September 2020 07:34 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/6 "2020-09-06T07:34:01Z")

</div>

IMHO, filezilla is NOT an SFTP server... So, it won't work.  
To check, can you sftp manually from the command line?  
I suspect it is not a NodeRed issue.  
You would have to install an SFTP server on your xampp box.  
GV

---

<div class="post-metadata">

### Author: ![minhhn0205](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/minhhn0205/32/29062_2.png) [@minhhn0205](https://discourse.nodered.org/u/minhhn0205)
#### Post date: [6 September 2020 07:47 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/7 "2020-09-06T07:47:05Z")

</div>

> [@ristomatti](#):
>
> Does anything show up in the FileZilla logs when you try to connect?

I confirmed and did not have the FileZilla log.

> [@ristomatti](#):
>
> I assume you're only doing testing but if you're only planning to connect locally, maybe the connection does not need to be secure and you could use regular FTP?

Thank you for your idea!  
I am trying to connect using SFTP to connect locally XAMPP...

---

<div class="post-metadata">

### Author: ![minhhn0205](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/minhhn0205/32/29062_2.png) [@minhhn0205](https://discourse.nodered.org/u/minhhn0205)
#### Post date: [6 September 2020 07:58 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/8 "2020-09-06T07:58:58Z")

</div>

> [@greengolfer](#):
>
> IMHO, filezilla is NOT an SFTP server... So, it won't work.  
> To check, can you sftp manually from the command line?

I checked using command `sftp admin@127.0.0.1`.  
 ![xampp-sftp-06](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/b/bb47bc2ad75cd1fe1631d27922a042acdca36244.png)

> [@greengolfer](#):
>
> You would have to install an SFTP server on your xampp box.

Thank you for your hint!  
I will investigate how to install SFTP server for XAMPP.  
If you know how to install or link the installation guide, please tell me!

---

<div class="post-metadata">

### Author: ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)
#### Post date: [6 September 2020 09:02 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/9 "2020-09-06T09:02:43Z")

</div>

> [@minhhn0205](#):
>
> I will investigate how to install SFTP server for XAMPP.

I'm not familiar with XAMPP but usually sftp server comes as part of ssh server package. SFTP is kind of FTP over SSH. There's also SSL-FTP but I would steer away of that.

---

<div class="post-metadata">

### Author: ![minhhn0205](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/minhhn0205/32/29062_2.png) [@minhhn0205](https://discourse.nodered.org/u/minhhn0205)
#### Post date: [6 September 2020 09:33 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/10 "2020-09-06T09:33:07Z")

</div>

After installing of **OpenSSH** at link [https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh\_install\_firstuse](https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse),  
I connected to `XAMPP` server using node `SFTP` already.

 ![xampp-sftp-07](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/c/6c6416a464edb2f70c67a7dfcd0b042746f775a3.png)

Thank everyone very much!

---

<div class="post-metadata">

### Author: ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)
#### Post date: [6 September 2020 10:08 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/11 "2020-09-06T10:08:10Z")

</div>

Make sure your firewall is properly set up that your Windows SSH server is not open to the internet!

P.S. I didn't know Microsoft provides an SSH server these days. Good for them! Do you know if it's part of the new Ubuntu subsystem or just to access plain old CMD prompt?

---

<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: [20 September 2020 10:08 UTC](https://discourse.nodered.org/t/how-to-connect-server-using-sftp-node/32488/12 "2020-09-20T10:08:30Z")

</div>

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