Using SSH secure shell client on a PC to upload files to a web server

The SSH secure shell client program allows you transfer files securely from a local PC to a remote server. As such it is particularly recommended for uploading files onto a web server such as 'eis' or 'sis'.

Use of SSH ensures that your username and password cannot be "sniffed" and captured by malicious people while you are connecting to the remote system (a common way for hackers to find out usernames and passwords that they can use to facilitate misuse of computers).

You must use SSH to connect to centrally-administered Unix systems and, when using other systems, you are strongly recommended to use SSH for connecting interactively and for file transfer whenever possible.

Installing SSH secure shell client

You can download the latest version of SSH secure shell client from ftp://ftp.bristol.ac.uk/pub/ibmpc/ssh/. (Off-site users will need to use the Off-site Proxy to do this.)

Please read the README file for information about the licensing conditions and instructions on installing the software.

This document describes how to use the recommended version (3.2.9) of the SSH client to transfer files to a centrally administered web server.

Back to top

Connecting

Starting a new session

To start SSH secure shell:

  • Click on the SSH Secure File Transfer Client desktop icon SSH File Transfer Client icon

Alternatively:

  • From the Start menu, select Programs / SSH Secure Shell / Secure File Transfer Client

A file transfer window is opened as shown below:

SSH Secure File Transfer Client window

Establishing a connection to seis

  • Click on Quick Connect (circled in red in the above screen shot) to display the Connect to Remote Host dialog box shown below:
    Connect to Remote Host dialog box
  • Type seis.bris.ac.uk in the Host Name field and your UoB username (for example, ccpxb) in the User Name field. Leave the Port Number field as it is (it should already be set to 22). In the Authentication Method field, select Keyboard Interactive from the drop-down box.
  • Click on Connect
  • Type in your password when prompted and click on OK, and OK again if prompted to 'Enter your authentication response'.

You are now connected to your personal directory on the staff and students mail server (seis), whose content is displayed in the right frame, as illustrated below:

part of SSH Secure File Transfer window showing the remote server frame active

Inside your personal mail space, there is a folder called public_html. This is where you must store your personal HTML files (web pages) and related files (e.g. images, style sheets, etc.) to make them publicly available on the World Wide Web.

Note some departments have their own web servers, in which case you should contact your departmental network administrator to register on that system, find out the Host Name and check that the appropriate server software has been implemented to allow secure connections.

Back to top

Navigating to your department's web folder

The first time you log into info using SSH Secure Shell you will need to specify the path to your department's folder - since the default directory is your personal mail directory. The path to your department's directory was sent to you, together with a username and password, when you first registered to become a departmental web information provider. A typical path looks like:

/info/www/Depts/MyDepartment/

where MyDepartment is the name of the folder allocated to your department (for example, Economics for the Department of Economics, ArtHistory for the History of Art Department).

  • Click on the Settings icon Settings toolbar icon in the toolbar (alternatively, from the Edit menu, select Settings)
  • Select Profile Settings / File Transfer (click on the + sign to expand these menus if necessary)
  • Select Remote Favorites
  • From the Remote Favorites dialog box (below), add a new favourite by clicking on the New (Insert) icon (see illustration below) and type in the path to your department's directory (that is, /info/www/Depts/MyDepartment/)
    Remote Favorites window
  • Click on OK

To access your department's directory:

  • Use the Remote Favorites drop-down list box located above the right pane (the pane where you view your remote files) as illustrated below:
    2 ways of accessing a departmental folder on the remote server

Clicking on the Home button will take you back to your personal folder.

Back to top

Using Profiles

Profiles are particularly useful when you need to connect to different web folders, for example your personal web space and your department's web folder.

Saving your default connection settings as a Profile

Either:

  • Click in the Profile Name text box on the Add Profile dialogue box that pops up when you first log in, and enter a profile name for your personal web space (for example Personal web space), then click on the Add to Profiles button.

    Add Profile dialogue box

...or, if the Add Profile dialogue box proves too elusive:

  • Click on the Profiles button in the toolbar and select Add Profile from the drop-down menu:

    Profiles drop-down menu
    and follow the steps described above.
  • Go to File / Save Settings to save your new profile

Now that the connection to your personal web space has been set as a profile, you may want to create one for your department's web folder.

Creating a Profile for your department folder

  • Create a new Profile as described in the previous section, giving it a different name (for example Department website)
  • Click on the Profiles button in the toolbar again and this time select Edit Profiles
  • In the Profiles dialogue box (shown below):
    1. select the name you gave to your department website from the list in the left pane
    2. select the Favorite Folders tab from the tab list on the right
    3. in the Home folder text field at the bottom, type in the path to your department web folder (i.e. /info/www/Depts/MyDepartment/) and click on OK
    Edit Profile dialogue box
  • Go to File / Save Settings to save your new profile

Connecting to a Profile

The next time you use SSH Secure Shell, you can connect directly to your preferred profile.

  • Click on the Profiles button and select the profile you want to connect to from the list:
    Profile button drop-down options
  • Enter your password when prompted and click OK (twice if necessary)

Back to top

Transferring files

The File Transfer window is divided into three panes (as in the diagram below):

  • The left-hand pane represents the Local View and lists the contents on your local PC
  • The right-hand pane represents the Remote View and lists the contents of department's allocated space on the remote server (for example, info)
  • The bottom horizontal pane represents the Transfer View and lists the files and folders that have been transferred.

Transfering files from Local folder to Remote folder

By default, SSH Secure Shell is set to select the file transfer mode (either ASCII or Binary) automatically (Auto Select), and to transfer text-style extensions (for example, .txt, .htm, .html) as ASCII and other files as Binary. Although there is no need for you to change these settings, you can if you wish explicitly choose the file transfer mode. To do this:

  • From the Operation menu, select File Transfer Mode (or use the command buttons on the toolbar (ASCII, Binary or Auto Select)

Uploading a file from a PC to a web directory

To upload a file from your PC to your department's web directory:

  • In the right-hand pane, navigate to the directory on the remote server that you want to transfer the file(s) to
  • In the left-hand pane, navigate to the folder on your PC containing the file(s) you want to transfer
  • Select the file(s) in the left-hand pane and drag and drop to the right-hand pane

Alternatively, you can use the Upload Dialog facility:

  • In the right-hand pane, navigate to the directory on the remote server that you want to transfer the file(s) to
  • Click on the Upload Dialog icon Upload toolbar button on the toolbar to open the Upload - Select Files window (you will also find Upload Dialog under Operation in the menu bar)
  • In the Upload - Select Files window, navigate to the folder on your PC containing the file(s) you want to transfer
  • Select the file(s) and click on Upload

Downloading a file from info to a PC

To download a file from the remote host (in this case info) to your PC:

  • Using the left-hand pane, navigate to the folder on your PC that you want to transfer the file(s) to
  • Using the right-hand pane, navigate to the directory on the remote host containing the file(s) you want to transfer
  • Select the file(s) in the right-hand pane and drag and drop into the left-hand pane

An alternative method is to use the Download Dialog facility:

  • Using the left-hand pane, navigate to the folder on your PC that you want to transfer the file(s) to
  • Click on the Download Dialog icon Download toolbar button on the toolbar to open the Download - Select Folder window (you will also find Download Dialog under Operation in the menu bar)
  • In the Download - Select Folder window, navigate to the directory on the remote server containing the file(s) you want to transfer
  • Select the file(s) and click on Download

Back to top

Setting file permissions for uploaded files

Once you have uploaded your files and folders to the info server, you need to set the permissions to determine the level of access for three different categories of users: Owner (yourself), Group (for example, other web publishers in your department) and Other (the rest of the world).

Each of these users can be granted different levels of access, from no access at all to Read (the right to view the file or directory), Write (the right to modify the content of the file or directory) and Execute (the right to execute any programme contained in a directory) permissions, or any combination.

These permissions are usually expressed as a numeric value: 4 for Read, 2 for Write, 1 for Execute and 0 for none. These values are then added together to determine the level of access of each user. For example, a file given a permission mode of 640 means that Owner has Read and Write (4 + 2) permissions, Group has Read (4) only permission and Other cannot access the file at all (0).

In the case of files (and directories) destined to be stored on a web server - and therefore viewed other the web - the relevant permission settings are as follows:

  • 755 for directories (Owner has Read, Write and Execute access, Group and Other have Read and Execute access)
  • 644 for files (Owner has Read and Write access, Group and Other have Read only access)

Note that if you want other people in your department to modify folders and files, you need to give Group the permission to Write as well, in which case the permissions mode will be 775 for a directory and 664 for a file.

By default SSH Secure Shell File Transfer Client should be configured with these settings, however the first time you upload files it is worth checking that the file permissions match the settings described above (that is, 755 for directories and 644 for files). To do this:

  • Click on the Settings icon Settings toolbar icon in the toolbar (alternatively, from the Edit menu, select Settings)
  • Select Global Settings / File Transfer (click on the + sign to expand these menus if necessary)
    Settings dialogue box, Advanced File Transfer options
  • You may want to uncheck the following options:
    • Preserve original file time - so that the transferred files are stamped with the date and time of the transfer instead of the date and time of their creation
  • Leave the other settings as they are and click on OK to exit the Settings window

Thereafter, you may want to check or change the permissions of uploaded files and directories. To do this:

  • In the remote view (right-hand pane), select the file(s) or directories whose permissions you want to change (press the Ctrl key to select multiple files or directories)
  • Go to Operation / Properties and change the permissions - for example, to 664 as in the diagram below, by checking and/or unchecking the corresponding boxes

    File Properties dialogue box

    Notice how the Permission mode changes as you check/uncheck boxes.
  • Click on OK to exit the File Properties window.

Back to top

Disconnecting

When you have finished the session remember to disconnect from the remote system and return to the PC operating system:

  • From the File menu, select Disconnect (or click on the Disconnect icon Disconnect toolbar icon in the toolbar)

To close the program:

  • From the File menu, select Exit (or click on the Close icon Close programme icon in the top right corner of the programme window)

Back to top

Additional information

For more information on the SSH Secure Shell client see Using SSH secure shell client on a PC to connect to a remote site (document ssh-3r).

Back to top