How to connect server using sftp node

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
xampp-sftp-02

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

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

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.

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

1 Like

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

[{"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":""}]

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

1 Like

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?

1 Like

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

1 Like

I confirmed and did not have the FileZilla log.

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

I checked using command sftp admin@127.0.0.1.
xampp-sftp-06

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!

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.

1 Like

After installing of OpenSSH at link https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse,
I connected to XAMPP server using node SFTP already.

Thank everyone very much!

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?

1 Like

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