OS: Ubuntu 12.04

I was wondering if there are programs which let you edit a file on a remote server through ssh. Basically what I'm looking for is the following:

There is a remote AIX server that contains a certain file (a perl script i.e.) and I want to edit it from my native machine (my Ubuntu). Is there a program which lets me edit the file (by first giving the IP and password of the remote server) and save the file on the server?

Ofcourse I could just edit the file on the remote server, but I was wondering if there exists something like the NppFTP plugin for Notepad++ on Windows. It doesn't matter if it is terminal (nano i.e.) or gui.

Solution 1:

ssh -X user@server gedit file.txt

This doesn't work because gedit is not installed on the remote server

  • gedit can do that. How to: thecodecentral.com/2010/04/02/… Mind you: most of these ftp/ssh editing methods do not work if you do not have permissions to edit (ie. need sudo). – Rinzwind Jul 24 '14 at 10:16
  • But that's 8.04, I get stuck with step 1 – Noosrep Jul 24 '14 at 10:24
  • Step 1 looks like Nautilus (file-> connect to server). – Rinzwind Jul 24 '14 at 10:27
  • Uhu, that does the trick! – Noosrep Jul 24 '14 at 10:30
  • Also look at this – c0rp Jul 24 '14 at 10:43

You can try

vim scp://remoteuser@server.tld//path/to/document

More info and examples

| improve this answer | |
  • This opens a file called /tmp/vxTuIQp/0.pl and not my specified file? – Noosrep Jul 24 '14 at 10:49
  • When you save your work that local copy is sending to remote server and you will see something like :!scp -q '/tmp/vxTuIQp/0.pl' 'remoteuser@server.tld//path/to/document' – tuxar Jul 24 '14 at 11:18

You can also install sshfs

Running the following commands:

sudo apt-get install sshfs
sudo modprobe fuse
sudo addgroup yourlocalusername fuse
mkdir servermountfolder
sshfs yourusername@server:/path/to/file/  servermountfolder

Will mount the remote server into the servermountfolder on your desktop pc. Where you can easily edit the file directly with any editor of your liking.

| improve this answer | |
  • Yes, c0rp has already given that answer :) – Noosrep Jul 24 '14 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.