Komodo Edit with SSH Access
With a little time spent on configurations and installing a plugin, Komodo Edit enables you to edit files on your desktop and then upload those files directly to your remote instance.
Since the Komodo Edit server configuration can rightfully be a royal headache that will cause you problems both today and through the rest of the course if you are not careful, you do not need to follow these steps unless you are a brave soul.
Configure your Server Settings in Komodo
Once you have your public key in your SSH agent (if applicable), follow these steps to tell Komodo how to connect to your remote instance.
- Open the Komodo Edit Preferences. In Windows, this is Edit -> Preferences; in Mac OS X, this is Komodo -> Preferences.
- In the menu on the left, choose Servers.
- For Server Type, select SFTP. (Since you have an SSH server running, you will be able to connect to your instance via SFTP.)
- Name it something like CSE 330 Cloud Instance.
- Enter the details of your instance, including your hostname and username.
- If you are using Public Key Authentication, leave your password empty.
- Unless you explicitly changed your SSH port, your port will be 22.
- Your default path will be where you want to save the files you upload. Generally, this should be the root of your web server.
- Press Add to save the server information, and then press OK.
- Mac OS X Users Only: You need to perform these additional steps in order to make Komodo use your private key when connecting to your server.
- In the Komodo Edit Preferences, choose Environment.
- Find the information about your SSH environment by entering the command ssh-agent in Terminal. You should see output similar to:
SSH_AUTH_SOCK=/tmp/ssh-xxxxx/agent.xxxxx; export SSH_AUTH_SOCK;
- SSH_AGENT_PID=xxxxx; export SSH_AGENT_PID;
- echo Agent pid xxxxx;
- Add the following environment variables in Komodo:
- Name: SSH_AUTH_SOCK
- Name: SSH_AGENT_PID
- The values for these environment variables should be what you learned earlier in step 2.
- Press OK to save your changes.
- To test whether Komodo is able to successfully connect to your server, choose File -> Open -> Remote File. Select CSE 330 Cloud Instance from the drop-down menu. You should be able to see a list of files in your public_html directory.
Installing Upload Extension
Strangely, Komodo Edit does not come built-in with a mechanism to upload files from your computer to the server. Fortunately, the community has released an add-on that gives us this feature.
- In Komodo, go to Tools -> Addons.
- Search for the add-on named Uploader.
- Download and install it, and restart Komodo.
- In your Server preferences, create a new server (or rename an existing one) to be identical to your project name, but starting with a star. For example, in my project named FileShare, I would name the server *FileShare. The default path will be the location to which Komodo will upload your files. Note: The path should be absolute.
- You can now select a file and go to File -> Upload to upload it to your server.
Tip: To make things quicker, you can bind a keyboard shortcut like ctrl/cmd+D to the Upload feature by following these steps:
- In Komodo preferences, choose Editor -> Key Bindings.
- Find the "Upload" command under "General". Press in the "New Key Sequence" box, and press ctrl/cmd+D. Proceed through the on-screen instructions; you can name your new scheme Custom.
- Save the preferences and restart Komodo. You will now be able to upload files by simply pressing ctrl/cmd+D.
Uploading Project using Komodo and the Upload Extension
- When you are ready to upload, go into Komodo Edit preferences and add a new SFTP server. Name the server *ProjectName — that is, name it the same as your project, but prepend an asterisk (*). For example, for our FileShare.komodoproject project, we would name the server *FileShare.
- You can now use the Upload extension you installed earlier to upload files from your working directory to your EC2 instance.