Komodo Edit with SSH Access

From CSE330 Wiki
Jump to navigationJump to search

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.

  1. Open the Komodo Edit Preferences. In Windows, this is Edit -> Preferences; in Mac OS X, this is Komodo -> Preferences.
  2. In the menu on the left, choose Servers.
  3. For Server Type, select SFTP. (Since you have an SSH server running, you will be able to connect to your instance via SFTP.)
  4. Name it something like CSE 330 Cloud Instance.
  5. 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.
  6. Your default path will be where you want to save the files you upload. Generally, this should be the root of your web server.
    Workflow-3.png
  7. Press Add to save the server information, and then press OK.
  8. 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.
    1. In the Komodo Edit Preferences, choose Environment.
    2. 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;
    3. 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.
    4. Press OK to save your changes.
  9. 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.

  1. In Komodo, go to Tools -> Addons.
  2. Search for the add-on named Uploader.
  3. Download and install it, and restart Komodo.
  4. 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.
  5. 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:

  1. In Komodo preferences, choose Editor -> Key Bindings.
  2. 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.
  3. 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

  1. 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.
  2. You can now use the Upload extension you installed earlier to upload files from your working directory to your EC2 instance.