Uploading Files with SSH Secure Shell

From Academic Computing

Jump to: navigation, search

Contents

[edit] Purpose

Learn how to use SSH Secure Shell to upload files to the Internet and gain a basic understanding of UNIX file modes.

[edit] Prerequisites

Students should have a University NetID and some basic HTML skills.

[edit] What is Secure Shell?

SSH is similar to FTP in that we can use it to transfer and manipulate files. Secure Shell adds an important feature: encryption. All information, including passwords, are encrypted while traveling between your computer and the server you are accessing. This prevents malicious users from intercepting your information. Using secure login protects your data.

[edit] Connecting to a Remote Server with Secure File Transfer Client

After installation, there will be two items in the “SSH Secure Shell” folder. Secure Shell Client is a text-based interface reserved for experienced users. We will be using the second item, Secure File Transfer Client. This provides a graphical interface for directories.

Secure File Transfer Client allows you to upload files to a web server.
Secure File Transfer Client allows you to upload files to a web server.

Once the File Transfer Client is open, choose Quick Connect from the tool bar or hit the space bar. This will activate the Connect to Remote Host dialog.

Login using your NetID if using a student account.
Login using your NetID if using a student account.
Connect to Remote Host dialog.
Connect to Remote Host dialog.

In the Host Name field, enter your server name. Most students will be using myweb.usf.edu as the host name.

Leave the Port Number set to 22. The Authentication Method should be “Keyboard Interactive” or “Profile” for your USF account. Your user name should be your NetID. Click “connect” to continue. After a short delay you will be prompted for a password. This is your NetID password.

The main screen is divided into three parts.

  • Along the top is a collection of useful tools.
  • The left side is a directory tree which expands to show all files in your account.
  • The right window is the single file view, displaying the contents of a single file.
SSH Secure File Transfer Client is divided into three parts.  The “File Contents” pane allows you to edit individual files.
SSH Secure File Transfer Client is divided into three parts. The “File Contents” pane allows you to edit individual files.

[edit] Uploading Files

To upload files, use the directory tree to navigate to the desired destination for your file. On the tool bar, click the Image:ssh5.jpg icon. The upload dialog box will appear. This displays the contents of your computer. Use this box to find the file you want to upload. Single left click the file you wish to transfer and click “upload.” A progress bar will appear indicating the transfer of your file.

[edit] Understanding UNIX File Modes

There are three classes of access codes associated with files and directories that define read, write, and execute restrictions for the three classes of users: the owner of the file, the group the owner belongs to, and all other users of the system.

Read permission for a file means you can view its contents. Write permission means that you can modify its contents (including deletion). Execute permission means that you can run the file as a program. For directories, read permission allows listing the contents of the directory, write permission allows creating or removing files or directories inside that directory, and execute permission allows moving into that directory.

You can set the permissions of each file you own. Alter the access codes by using numeric values for the triplets representing the owner's permissions, the group's permissions, and other users' permissions. The numeric values for the bits in a triplet are:

  • 4 read permission
  • 2 write permission
  • 1 execute permission

Sum the values of the bits to give the permissions that you desire. For example, the mode “700” sets read (4), write(2), and execute( 1) permissions for the owner only and allows no one else to do anything with the file. “751” sets read (4), write(2), and execute(1) permissions for the owner, read (4), and execute(1) permissions are set for the group, and only execute(1) permission is set for all others.

[edit] Changing File Modes with SSH

To manipulate file modes right click on the file and choose Preferences. The numerical Permission Mask is toward the bottom of the dialog. For public html and image files a mask of “755” is sufficient. After entering the desired number click ok.

A file mode of “755” will make files and directories available to the world.
A file mode of “755” will make files and directories available to the world.

Your file should now be available via a web browser. Keywords:SSH

Personal tools