Editing & Exporting LEDE config files in Ubuntu

Does anyone recommend a good app to SSH into Ubuntu so you can edit and/or export config files? Something like WinSCP but for Ubuntu? Much appreciated.

** adding more clarity to my questions: I'm trying to export vpn client files, and looking for GUI alternative to vi editor in ubuntu. thanks

Ubuntu already has ssh functionality -- just open a terminal window.

ssh root@<IP_ADDRESS>

where <IP_ADDRESS> is the address of your LEDE device.

but then you're still stuck with VI editor. I'm hoping for a more user friendly interface. I'm trying to export my vpn client files to the PC. thank you nonetheless for your response.

Well, vi is the standard editor that is installed within LEDE, so when using SSH, that's what you get. There are some other editors that you can install (such as nano or joe), assuming that you're looking at it from the perspective of ssh'ing into your LEDE device.

That said, I see your edit for clarity that you're looking for exporting and editing via a GUI. One simple way to handle this is to use standard terminal based scp (also part of essentially every linux distro) to copy the files to your workstation. Then open and edit the files in a text editor (maybe gedit or a GUI version of Emacs, etc.), then just scp the files back again when you're done.

Finally, while obviously not ideal for large amounts of editing, learning enough vi to be able to edit on the LEDE device via ssh can be really helpful in the long run.

1 Like

thank you psherman!

You should install a more modern editor to the router. Nano and Joe are rather small and introduce no extra dependencies.

opkg update
opkg install nano

There is no reason to torture yourself with vi

And from purely file transfer perspective, scp is the easy approach like already said above.

PS.
I have also edited C files with ed, the line based predecessor of vi, so I am familiar with antique editors...

1 Like

Torture is right! thank you for your note. I'm old enough to remember writing batch files in DOS with those editing tools--and will embrace the easier path any day of the week. Love it if LEDE can support gedit. I've been scp,ing to my Ubuntu tmp directory then editing from there.

thanks again--

This is really overboard, but you could make the router an NFS server and mount its filesystem on your PC. Then edit with any editor and they are immediately changed on the router.

Not SSH, but you might try FileZilla...

https://filezilla-project.org/download.php?platform=linux

Use your choice of file editors on your client computer...

https://www.linuxtechi.com/top-10-text-editors-for-linux-desktop/

1 Like

Not overboard at all mk24, but I do the opposite, I connect to my NFS share on my computer from the LEDE router, copy the files to my computer, edit files on my computer and copy them back to the router. I would not want to copy files to or edit files directly on the router without backing them up first though.
It's a good method for backing up the config files too.

1 Like

There's a high probability LEDE will never support gedit. The packages for an X or Wayland server and the Gnome dependencies that are required for gedit would take up a lot more storage than most routers have. Not to mention the RAM of having those running would exceed that of most routers. Plus, it would be a lot more hassle than it's worth to connect remotely graphically just to use a graphical text editor.

Nano is a great choice though for an easy to use text editor. I used to use vi quite a bit in the past, but prefer nano ever since I tried it. I'm like you though if I'm in a graphical desktop environment I do like gedit.

1 Like

Another way would be to use sshfs and mount the router filesystem into the one of the pc. Then it is possible to use gedit oder leafpad or any other editor.

1 Like