SSH/SCP/SFTP: Replacements for Telnet and FTP

Overview

SSH (Secure Shell) is a program for securely logging onto a remote machine and then executing commands over an encrypted channel. It is intended to replace a number of standard utilities such as rlogin, rsh and telnet. By using encryption SSH prevents others from seeing the commands that are being sent between the user and the remote machine. It also uses public and private keys to validate that the host and client machines are who they say they are.

SSH not only provides a mechanism for securely sending remote commands, it also offers a way of securely copying files between two machines. There are two SSH utilities that provide these services: SCP and SFTP.

All three services (SSH, SCP and SFTP) are available at CSLab and they are one of the main ways to communicate with CSLab machines remotely.

SSH Client for Java

The Mindterm SSH java application/applet works from within a Java-equipped web browser, or can run as a local Java application. At CSLab, it's available at http://www.cs.toronto.edu/cslab/java/mindterm.cgi/cslab. Anyone with a java-enabled web browser (on any platform) can use it to connect directly to CSLab via SSH without having to install SSH client software.

SSH/SCP/SFTP Clients for Windows

In order to use SSH/SCP/SFTP on a Windows machine, it is necessary to first install an SSH client. There are a number of freely available SSH clients on the Internet, and here are a few that we have had good results with.

  • Putty: http://www.chiark.greenend.org.uk/~sgtatham/putty/

    If you download the "full Putty installer", you will be able to use Putty's built-in SFTP and SCP command line utilities, as well as its GUI-based SSH utility. The GUI-based SSH utility is very nice but the command line SCP and SFTP utilities are a bit awkward. Consider downloading WinSCP along with Putty instead.

  • WinSCP: winscp.net

    Very nice GUI'zed SCP utility. This along with Putty makes a very useful combination of tools.

  • Cygwin: Cygwin is a Linux-like environment for Windows and it comes with a number of Linux tools such as openssh's version of SSH. The install is pretty painless but make sure you install openssh when first setting it up. More information about Cygwin is available on its website.

    SSH on Linux: Command Line SSH, SCP and SFTP

    Most Linux distributions come with SSH/SCP/SFTP installed. If not the OpenSSH website has excellent instructions on how to install it.

    To SSH to one of the CSLab machines, use the syntax:

    ssh -l username cs.toronto.edu

    To invoke the SFTP client use the command:

    sftp username@cs.toronto.edu

    After logging in, use the "?" to see a list of SFTP commands.

    To copy a file using SCP from your home directory to another machine and place it in the directory called "scarlet", use the syntax:

    scp filename myusername@anothermachine:/scarlet/

    To copy the file "begonias" from another machine to your current location, use the syntax:

    scp myusername@anothermachine:/scarlet/begonias .

    Please note the use of the '.' in the above command. It refers to your current directory so that the scp command literally means secure copy the file 'begonias' to my current location

    SSH on Mac OS X

    The Mac OS X comes with an SSH client installed already available for use. Simply open up a shell and use the commands detailed above in the Linux section.