Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm new to ssh and linux in general. I've got putty set up and I can connect to my server and list files and everything. I'm wondering how I can edit a file using notepad++ (or another editor). Is there a way to have it automatically download and upload through ssh? How else do you edit a file?

Thanks

share|improve this question

migrated from serverfault.com Apr 26 '10 at 2:45

This question came from our site for professional system and network administrators.

7 Answers 7

up vote 4 down vote accepted

If you really need a GUI editor another alternative is to install on one on the server and run it via SSH.

To do this you need:

  • An X11 server on your guest that is running. (Xming works well - http://sourceforge.net/projects/xming/)
  • To permit X11 forwarding on the server adjust your /etc/ssh/sshd_config so this is set X11Forwarding yes. Restart ssh if you had to change.
  • To enable X11 forwarding through putty. (link)
  • To install a GUI editor on the server. I really like SciTE
  • With all the pieces in places, just open the file with editor filename and the GUI from the remote system will be displayed on your local machine.
share|improve this answer

You can use WinSCP and use sftp to edit your files. Just right click > edit. However, you'll have to login as root or a root level user to edit most system files which may be bad security practices.

The best thing for you to do is to use nano or a similar command line text editor and enable the color coding extensions, which is probably the point to use notepad++

share|improve this answer
    
use scp (instead of sftp) if you dont have ftp running –  Yash Agarwal Oct 4 '13 at 7:23
    
SFTP doesn't use FTP. It handles it over SSH. It is default in most systems when installing OpenSSH. The only thing that needs to be enabled otherwise is the subsystem. –  David Rickman Oct 21 '13 at 12:55

There are a few options. On the Windows-friendly side of things, you could use Komodo Edit, which is free and has options to edit via SSH.

(I would recommend against using anything which only supports upload via FTP, since you're sending your credentials across the 'net in clear for anyone who wants to grab 'em.)

As others have indicated you could try out full-screen text editors like vi, Emacs, joe, or others to edit directly on the *ix system.

A final option would be to install Xming and use Unix GUI editors such as gedit remotely.

share|improve this answer

The easiest thing to do is use a text editor that supports ssh/sftp directly such as EditPlus or gedit.

share|improve this answer

Notepad++ has an FTP plugin. It might not come by default, I don't remember, but if it doesn't then it was easy to find on the Notepad++ website.

If you plan on using ssh to edit files often, I would recommend becoming familiar with an editor you can often find on Linux. Vi comes with all versions of Linux (VIM, Vi Improved, is frequently installed). Emacs is also common, and a lot of people use nano if they want something simple. These text editors, especially Vi, have a bit of a learning curve, but are worth it IMO if you plan on using them often, especially for programming.

share|improve this answer

ssh is a terminal service, that means that you just send characters to the server that then interpret those into something useful like "edit a file".

That means that all programs execute on the computer where you are loged in.

So if you would like to use a local editor you must:

  1. copy the file home.
  2. Edit it with your editor
  3. Send it back.

A better way is to learn a powerful editor like vim/emacs and edit in place.

share|improve this answer

I'd be lost without vim. Learn vi or vim and you will find it faster and more powerful for editing text files than most GUI editors.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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