Yale University Library

 

Workstation and Technology Services

Quick Links
Using SSH Secure Shell 3.1

(Parts of this guide were created from documentation originally written by Julie Linden of the Social Science Library.)
Moving among Directories | Viewing Files | Changing Permissions | Checking your Work | Disconnecting from Server | UNIX Command | Upload/Download Files

Using the SSH Secure Shell Client to on the library web server : www.library.yale.edu

The FIRST TIME you launch the SSH Secure Shell Client:

  1. Press Enter or the Space bar to connect.
  2. In the Connect to Remote Host dialog box, type:

    Host Name: www.library.yale.edu

    User Name: your user name for the library web server

  3. Click Connect
  4. Enter your password
  5. Once you are connected, you should save the settings (so that you don't have to type in Host Name and User Name every time). You can save the session in your profiles list by clicking Profiles, selecting Add Profile and naming your session, (For example Library Web Server) then clicking Add The Current Connection.

Commands to use during an SSH Secure Shell.

Creating a Directory

You will need to create a directory called public_html for files and subdirectories that will be viewable on the WWW.
At the prompt type mkdir public_html
Files you put in this directory will be the Web pages and graphics people see when they type http://www.library.yale.edu/~[userid]/[filename] in to a Web browser like Netscape.
For example, if my userid is "jsmith" and I have a Web page called "home.html" people will look at this page by typing http://www.library.yale.edu/~jsmith/home.html.

Moving among Directories

Use the command cd [directory name] to change directories.
To add or view files in your public_html directory you will have to move from your home directory to public_html. You can do this by typing cd public_html at the prompt.

You will see something like the following:

/home/jsmith> CD public_html
/home/jsmith/public_html>

To go back to your home directory just type CD>
/home/jsmith/public_html> CD
/home/jsmith>

Viewing Files

You can look at the files in a directory by typing ls
You will see something like this:
/home/jsmith> ls
aa.gif             birren.html        selectF.html       yale_old.gif
aboutyalesir.html  brb.gif            selectFx.html      yale_sky.gif
anss1.html         eselect.html       suggestF.html      yale_tea.gif
athletic.gif       public_html        yale_mag.gif
/home/jsmith>
To see more detailed information about the files in a directory, including size and date, type ls -la
You will see something like this:
/home/jsmith> ls -la
total 2344
drwxr-xr-x   3 jsmith   mosaic      1024 May 14 16:38 .
drwxr-xr-x  75 bin      bin         1536 May  8 10:17 ..
-rwxr-xr-x   1 jsmith   mosaic   1059272 Apr 25 09:53 home.html
-rw-r--r--   1 jsmith   mosaic     12719 Jun 20 1995  picture.gif
drwxr-xr-x   5 jsmith   mosaic      1536 May 14 16:38 public_html
-rw-r--r--   1 jsmith   mosaic      6203 Jul  7 1995  yale.gif
/home/jsmith>

Changing Permissions for Files and Directories

As the "owner" of a file or directory, you are authorized to set access permissions for three classes of people: the owner, a select group, and everyone. For someone to read your web pages, the access permission for everyone must be set properly. If access permissions are not set properly, readers attempting to connect to your web pages will be denied access.

We typically use the Octal method of setting permissions. That method involves setting the permission with numbers. Each number has a meaning as outlined below:

Read = 4
Write= 2
Execute= 1
No permission = 0

The permissions are cumulative: I add 4+2 (read +write) and get 6. Any combination is legal.

This chart shows the relation between the permissions and each class of people.

  Read (4) Write (2) Execute(1)
Owner      
Group      
Everyone      

Use the command chmod 644 [filename] to give the owner (you) permission to read the file's contents and edit its contents and to give everyone else permission read the file's contents, but not edit its contents.

Use the command chmod 755 [foldername] to give the owner (you) full access to the folder. On a folder everyone needs execute permission to open it. So the group members and everyone else can actually open the folder to view files within it.

Checking your Work

Use the "List" command Ls -la to check that you have properly set the access permissions.
You will see something like this:
/usr/web/cataloging> CD authorities
/usr/web/cataloging/authorities> Ls -la
total 336
drwxrwxr-x   2 mbeacom  catalog      512 May 12 18:30 .
drwxrwxr-x   6 mbeacom  catalog      512 Apr 26 11:07 ..
-rw-r--r--   1 mtheroux catalog     6882 May 13 08:36 acpcpage.htm
-rw-r--r--   1 mtheroux catalog     5113 May 12 18:27 changrep.htm
-rw-r--r--   1 mtheroux catalog     2737 Apr 17 22:23 djlmemo.htm
-rw-r--r--   1 mtheroux catalog     1960 Apr 17 22:24 staff.htm
-rw-r--r--   1 mtheroux catalog    14846 Apr 17 22:24 training.htm
-rw-r--r--   1 mtheroux catalog    10454 Apr 17 22:24 travel.htm
-rw-r--r--   1 mtheroux catalog     8273 Apr 16 13:52 workflow.htm
/usr/web/cataloging/authorities>
Files for public viewing and group editing should begin with this code:  
              
-rw-rw-r--

What this code means: "r" stands for read and "w" stands for write (edit). 
In the example above the owner has permission to read and edit the 
file, the group has permission to read and edit the file, but everyone 
else has permission only to read the file.  

Use your WWW browser to view the files you have put on the Library web server. If you have not set your access permissions correctly you may get an "access denied" message. By viewing your files with the WWW browser, you will also be able to check your links and make sure your Web page displays as you intended.

Disconnecting from the Library Web Server

Type exit.

UNIX Command Summary

Command Example Explanation
Ls
Ls
Ls -la
Ls -la |more
List the names of files and subdirectories within a directory.
Leave a space and type -la to display the contents of a directory in full format.
Add a space and |more to display files one screen at a time (Useful if your directory contains many files).
CD
CD public_html
CD
CD /usr/web/colldev
Change directory
Move to a subdirectory in your current directory (in this case public_html).
Type the command by itself to return to the home directory.
Move to a directory in a different section of the server (in this case /usr/web/colldev).
mv mv oldname.html newname.html Rename a file or move a file to a different location oldname.html will now be newname.html.
cp cp oldname.html newname.html Copy a file.(You will end up with two files)
The contents of oldname.html will be copied to newname.html.
rm rm unwanted.html Remove or delete the file unwanted.html.
mkdir mkdir public_html Creates a new directory called public_html within the current directory.
rmdir rmdir GIF Removes or deletes the directory GIF.
(The directory must be empty)
passwd passwd Change your account password. You will be prompted to type in your current password and then a new one.
chmod chmod 644 home.html Changes the access permissions on files (like home.html).
Use chmod 644 <file name>.
chgrp chgrp groupname home.html Changes the group who owns the file.
find find /home/joe -name "*foo*" Locates a file or files.
exit exit Ends your session.

Using the SSH Secure File Transfer Client to upload/download files on the library web server : www.library.yale.edu

 The FIRST TIME you launch the SSH Secure File Transfer Client:

  1. Press Enter or the Space bar to connect.
  2. In the Connect to Remote Host dialog box, type:

    Host Name: www.library.yale.edu

    User Name: your user name for the library web server

  3. Click Connect
  4. Enter your password
  5. Once you are connected, you should save the settings (so that you don't have to type in Host Name and User Name every time). You can save the session in your profiles list by clicking Profiles, selecting Add Profile and naming your session, (For example S-FTP Library) then clicking Add The Current Connection.

General Instructions

When you connect to the library web server, you see your personal "home" directory, which is usually yourusername/public_html. Most often, you will want to work in a different directory.

  • To see the shared "public" directories, press Ctrl + G (for “Go to Folder")
  • Type: /usr/web to see a list of all the available directories
  • If you know the name of the directory you need, you can go directly to it: press Ctrl + G and type /usr/web/govdocs or /usr/web/socsci

In the left pane, the folder you selected should be highlighted. The contents of that folder appear in the right pane.

To upload a file (put it on the library web server):

  1. From the Operation menu, choose Upload...
  2. In the dialog box, navigate to the file you want to upload.
  3. Double-click on it to upload.

To set the permissions on a file:

  1. Once it is uploaded, click the right mouse button on the file and choose Properties.
  2. Make sure that Owner, Group, and Other all have Read permissions checked.
  3. If appropriate, make sure that Owner and Group have Write permissions checked.

To download a file (take it from the library web server and put it on your computer or a disk):

  1. From the Operation menu, choose Download...
  2. In the dialog box, navigate to the folder where you want to put the file. Click the Download button.

When you are finished, from the File menu, choose Disconnect.