Configuring sftp with notepad++

Introduction

In my time as a student, and through the transition to teaching I have found a very useful tool for scripting that some of you may or may not be familiar with.  While many people who script in Windows on a regular basis are familiar with Notepad++ and it’s vastly superior usefulness over notepad; you may be unfamiliar that it also has a built-in sftp plugin.  This allows seemless connection to files on a remote server, all integrated within the Notepad++ environment.  You can open the files on the server (where a copy is downloaded locally behind the scenes) and automatically opened in Notepad++ for you.  Then once you’ve made your changes to the local copy, any time you press save it is automatically uploaded back to the server (provided you still have an active network connection).

Before you get too excited about this new found functionality, there are some fairly common sense pitfalls you should be aware of (but may not be aware of).

  1. When connecting to any remote server, you should select sftp over ftp if the functionality is available on the server you’re connecting to (and if it isn’t, talk to your admin!).  With ftp your credentials are sent in clear text.  This is very bad.  With an sftp connection, there is at least a layer of encryption built into the process, thus limiting the chance your data or credentials are compromised.
  2. You only need to enter your username, server information and password once (unless it changes).  After that, it is a simple act of connect/disconnect with a single button.  This leads to pitfall number two.  For fairly obvious reasons, this is undesirable in a shared environment.  If you decide however to set this up in a shared environment, be careful to remove your credentials at the end of the session; you don’t want someone else being able to log onto a computer and access your files!

Configuration steps

Now that we have the introduction out of the way, lets talk about the setup. For simplicity I’m going to assume you’ve already downloaded and installed Notepad++ (if you haven’t, a download link can be found here).

  • Open Notepad++ and go to Plugins > NppFTP > Show NppFTP Window
  • Click on the cog wheel/gear > Profile Settings
  • Click Add New
  • Enter in your hostname, port number, username and password (you can select Ask for password if you wish)
  • Switch the connection type to SFTP
  • Close the window

Note:  You can also specify the path to an initial directory to enter on the server upon login.

Connecting/Disconnecting

To connect, simply click the icon in the NppFTP window that looks like a cable, and select the profile you’ve just configured from the drop down menu.  That’s it!  To disconnect, click the same icon.  No more having to remember your credentials (unless you’re setting this up every time).  You have a nice, graphical interface in windows in which to perform all of your server scripting needs, be it HTML, JavaScript, PHP, Perl, Python or any number of other possible languages.  I hope you’ve found this brief tutorial useful.

Note:  You can create, move, rename and delete files through the directory tree listed in the NppFTP window.

Advertisements

About jasoncarman

I'm a graduate of Computer Systems Technology (CTY) from Seneca College @ York University. I currently teach at Seneca@York..

Posted on January 17, 2015, in Bash Scripting, Power Shell, Python Scripting, System Administration. Bookmark the permalink. 2 Comments.

  1. Hello, Matthew here. I downloaded the latest version of notepad++ but when i go to the plugins dropdown from the menubar, I get >NppExport, but after that, no option for “Show NppFTP Window”. I read somewhere there may be some bug about the NppFTP window being invisible, but I’m not sure if that is even my problem. The NppExport sub menu only gives 5 choices. They are: “export to RTF, Export to HTML, Copy RTF to clipboard, Copy HTML to clipboard, and copy all formats to clipboard”. Are you able to speak to why your suggested option is missing? I am using version 7.5.8. Thank-you!

    • Sorry for the very delayed reply (and I hope you were able to resolve your issue), but I’ve noticed after installing the plugin you have to close and relaunch notepad++ for it to work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: