Home > database >  How to edit a file on a remote Raspberry Pi from Windows
How to edit a file on a remote Raspberry Pi from Windows

Time:10-12

I am using Cygwin on Windows 10 to remotely connect to a Raspberry Pi. On the RPi I have scripts that I need to maintain. Currently, I connect with SSH and just use the native VI on the Pi. Needless to say this is a painful experience once you are used to using gVim. Alternatively, I edit locally and then copy the edited files over to the Pi. But this is cumbersome when done a lot of times.

How can I make the RPi file(s) available for editing on my Windows environment?

CodePudding user response:

You can use open source software such as WinSCP. Then create a SFTP session. After that, you can browser in the filesystem of your server, localize the file you want to edit. You can do right click and open the file in your Windows environment with the editor of your choice.

At least is what I use in my work environment dealing with Linux servers and Windows as a main host.

CodePudding user response:

Visual Studio Code can do this. Raspberrypi.com have an article about this

CodePudding user response:

Found WinSCP, which seems to do the trick very nicely!


Update:

One thing to note is, that WinSCP does not really edit the file remotely. It transparently copies it to a local temp directory and edits the copy. When changes are saved, it copies the edited file back on the remote source.

This works fine, unless the connection to the remote host is interrupted. Then, an orphan copy of the file is left in the temp local folder, and possibly the user editing the file has no way to know. When the connection is restored, the copy is no longer linked to the remote file.

  • Related