Lugaru's Epsilon

Epsilon User's Manual and Reference
   Commands by Topic
      Buffers and Files
         . . .
         File Variables
            Directory-wide File Variables
            Vi/Vim File Variables
         Internet Support
            Secure Shell and SCP Support
            URL Syntax
         Unicode Features
         . . .

Previous   Up    Next
Internet Support  Commands by Topic   URL Syntax

Epsilon User's Manual and Reference > Commands by Topic > Buffers and Files > Internet Support >

Secure Shell and SCP Support

Besides recognizing ftp:// URLs as described in the previous section, Epsilon also recognizes scp:// URLs, which may be used for secure file transfers. With scp support, you can read or write files using an scp:// URL, navigate the remote system's directory tree using dired, mark files for copying between the local and remote systems, use grep or file-query-replace to search and replace on multiple remote files, and use file name completion.

Epsilon also recognizes ssh:// URLs to connect securely to a command shell on a remote computer, providing a secure alternative to the telnet command. Epsilon's ssh command works similarly to the ssh:// URL. Use the syntax username@hostname to connect as a user other than the default one. The ssh-interpret-output variable controls how Epsilon interprets ANSI escape sequences and similar in an ssh buffer.

The scp and ssh features work by running certain external programs which must be installed. Epsilon's ssh command depends on an external ssh program, while its scp features run a program named sftp. On Mac OS these are normally preinstalled. For Linux or FreeBSD, you may need to install the appropriate ssh package for your distribution. For Windows, the Cygwin system contains appropriate clients. Run the Cygwin installer from the Cygwin website and install Cygwin's openssh package from the net section. Also ensure Cygwin's bin directory is on your PATH. (On Windows, it's also possible to use alternative clients like PuTTY instead of Cygwin programs. See "Windows-specific Configuration" below for more on PuTTY.)

With scp/ssh support, Epsilon doesn't remember your password or passphrase. Epsilon will ask for it each time it must start a new sftp helper program (for instance, when you begin a second file operation before the first has completed). If you prefer to type your secure passphrase once and have multiple connections use it, you can set up an ssh-agent program, along with public key authentication. The agent will remember your credentials and provide them as required to any sftp or ssh instance. You can even set your credentials to expire after a certain period of time if you wish. Refer to the manual page for the ssh-agent program to set this up. Windows users should also see the section below on Windows-specific configuration.

Customization Options for Alternative Clients

If you're not using the usual external ssh and sftp programs, you'll need to set various variables to tell Epsilon how to run your alternative programs.

The variable ssh-template tells Epsilon how to build a command line for invoking the external ssh program when a specific user name appears before the host name. If no user name was specified, it uses ssh-no-user-template. See the descriptions of these variables for their format. There are also numerous variables whose names start with sftp- that may be used to configure Epsilon to work with alternatives to the sftp program.

Some very old sftp programs use a different command syntax for listing files; if you have trouble, try setting the scp-client-style variable to 2 to make Epsilon use old-style sftp commands. You may have to modify scp-list-flags too.

Windows-specific Configuration Options

As explained above, using an ssh-agent program along with public key authentication lets you type your secure passphrase once and have multiple connections use it. The agent must provide some settings that are passed on to the sftp or ssh clients it runs via environment variables. For Windows users running Cygwin, one option is to start Cygwin's bash shell, run the command eval `ssh-agent`, run the ssh-add command, and then run Epsilon from that same shell. Or you can use the run-ssh-agent.bat file included in Epsilon's bin subdirectory to run an ssh agent. The comments in that file explain how to run ssh-agent through it, so it creates a load-ssh-agent batch file that loads agent settings into the environment, and how to set Epsilon variables so Epsilon invokes load-ssh-agent when starting ssh or scp sessions.

To make Epsilon work with the Windows ssh client PuTTY instead of the recommended Cygwin clients, use these settings:

 scp-windows-sftp-command  psftp
 ssh-template  plink -l %u %h
 ssh-no-user-template  plink %h
 scp-client-style  2

Be sure to install PuTTY's psftp and plink programs along with the base PuTTY installation. With PuTTY, certain features like file name completion won't be available.

Per-System Settings

It's possible to set up Epsilon to use one set of variables for one remote system and a different one for others. To enable this, before checking for a variable such as scp-run-helper-template, Epsilon constructs a new variable name by adding the host name of the remote system to its end. For instance, if you try to access, Epsilon first looks for a variable named scp-run-helper-template-www-example-com; if there's a variable by that name, Epsilon uses it instead of the usual one. (Epsilon constructs the variable name from a host name by replacing each non-alphanumeric character with a -.) It does this for each of its scp and ssh variables.

Using Ancient Hosts

If you must use a very old version of ssh that lacks an sftp program, or connect to a system that doesn't support sftp, or you want to use an ssh replacement that lacks sftp, it's possible to set up Epsilon to run its own helper program on the remote system.

To do this, copy the C language source code file epsilon-xfer-helper.c included in Epsilon's source directory to the remote system, compile it with "make epsilon-xfer-helper" or similar, and install in an accessible location. It may be compiled on most Unix systems, or, for Windows, using the Cygwin environment. Next, check that you can run the helper program remotely, with a command line like

ssh -l username hostname epsilon-xfer-helper

It should print a greeting line and await a command. Type ^C or press <Enter> to make it exit. You may need to edit the Epsilon variable scp-run-helper-template to include the path to the helper program, or if you use a different ssh program. For instance, if you use an ssh client "oldssh" that lacks an sftp program, set it to "oldssh %u@%h /path/to/epsilon-xfer-helper" or similar. (Epsilon uses the above variable when the scp:// url includes a user name, and the scp-run-helper-no-user-template variable when it does not.)

To tell Epsilon to use epsilon-xfer-helper commands, not sftp commands, set the scp-client-style variable to 1. Using the helper program enables a few minor features that the sftp program doesn't currently support, like using ~ to indicate home directories, or copying a remote file to a different location on the remote system (sftp can rename remote files but not copy them).

When you don't use sftp, Epsilon must run a separate program for each file transfer. By default it uses the scp program. The variable scp-read-file-template tells Epsilon how to transfer a file from the remote system to a local file, and scp-write-file-template does the opposite. There are separate versions of these variables for when no user name is included, named scp-read-file-no-user-template and scp-write-file-no-user-template. Change these variables to use a different program for copying files when you don't use sftp.

Standard bindings:

 Ssh mode only: Alt-n  process-next-cmd
 Ssh mode only: Alt-p  process-previous-cmd

Previous   Up    Next
Internet Support  Commands by Topic   URL Syntax

Lugaru Copyright (C) 1984, 2020 by Lugaru Software Ltd. All rights reserved.