Foothill College home page
CTIS - UNIX Help, Documentation & FAQ Pages
Using Mac SFTP to Upload Your Files (Mac OS X)

Because OS X is unix based, SFTP is free and built into the operating system. Unfortunately to use it you must open Terminal and use a command-line interface. So if you are a UNIX person and enjoy the command-line interface, then by all means investigate that option.

This page is trying to present information about SFTP programs that have a GUI interface.

This page offers Fugu, a free SFTP program for OS X produced by the Research Systems Unix Group at The University of Michigan. It can be downloaded at this location:

http://rsug.itd.umich.edu/software/fugu/

Fugu is pretty easy to use but it lacks some features that Mac users are accustomed to. This page shows how to create a connection and follows that with a some known issues/limitations/bugs with the program.

 

How to Connect with Fugu

  1. Open the Fugu Program by double-clicking on the application.

    Fugu opening window screenshot

    The initial window has a pane on the left displaying the files on your local hard drive. The first time you start the program it will probably list your user folder, but in the Application Menu/Preferences you can specify what the default folder on your hard drive will be.

    The right side of the window allows you to enter in the information for the host you want to connect to.

  2. Fill in the connection information and click the Connect button to initiate the connection.

    Connect to: - This is the name of the machine in our unix lab that you want to connect to. This example shows losaltos.fhda.edu, but you really can use any of the hosts listed below. It really doesn't matter which host you connect to, it only matters that the machine is turned on and ready to communicate :)

    If you are unable to connect to losaltos.fhda.edu, try one of the following:

    losaltos.fhda.edu
    kyoto.fhda.edu
    paris.fhda.edu
    london.fhda.edu

    Username - Replace smithbob with YOUR username that you obtained from the accounts server... remember that it is case sensitive!

    Port: - You can leave this blank as we are running SFTP on the standard port.

    Directory: - For most FTP programs we would recommend that you leave this blank which would put you into your home directory (where you want to go). But Fugu seems to sometimes hang if you do not specify the directory.

    So, you should specify the path to your home directory. An example might look like this:

    /home/coin061.02/smithbob

    The home folder contains a folder for each class. The folder for each class is similar (but slightly different) than what you typically call the class. In the example above, Bob Smith's folder is inside a folder named coin061.02. Officially the class would be called COIN 061-02. The directory names are slightly different.

    Inside a class directory is a folder for each enrolled student, and that folder name will equate to the username you obtained from the accounts server.

    Until you know exactly what your class directory is, you can specify the following:

    /home/

    Then you can click your way to your home directory, noting the path so that next time you can enter it more accurately. And once you have the complete path it makes sense to make a bookmark of the connection so that you do not have to type in all the information.

    If you cannot determine your class directory or the path to it, ask your instructor.

  3. The program is now asking you to input the password you obtained from the accounts server, then click the Authenticate button to proceed.

    Fugu password window screenshot

  4. Assuming that you provided the correct username and password, the following example screen should appear. The pane on the right should display the files in your home directory.

    Window of files listed screenshot

    The first time that you connect you will only see one folder that has been made for you named public_html. All of your web published files should be placed into the public_html folder... that is your default web directory.

  5. So prior to uploading a web file, ensure that you double-click on the folder in the right pane named public_html.

Transferring Files

  1. If you are uploading web published files, remember that they should be uploaded to your public_html web directory.

    In the pane on the right, double-click on the public_html folder to open it. After doing so the folder name above the file listing will then indicate public_html.

  2. Drag and Drop - Fugu supports drag and drop. You can pick up a file and drag it to the other pane. You can also pick up a file from anywhere on your hard drive and drag it to a pane.

Deleting Files and Folders

  1. To delete a file, select the file and click the Delete button in the toolbar. A confirmation dialog will be displayed.

Fugu cannot delete a folder of files IF that folder contains any files. A nuisance, but easy to resolve.

  1. Pull down the SFTP/Show Hidden Files menu command to ensure that ALL files will be displayed.

  2. Double-click the folder you want to delete so its files are displayed.

  3. Select all of the files with CommandKey - A.

  4. Click the Delete button in the toolbar to delete the files.

  5. Go up one level, select the folder, and then click the Delete button in the toolbar to delete the now empty folder.

Folder/File Permissions

In our labs, we've found that any folder that you create or copy to our machines with Fugu Pro seems to have the permissions set such that anyone can write to or delete the folder. SO, you should ensure that the permissions are set correctly for your purpose.

The illustration below shows the permissions as being incorrect for both web and UNIX students.

Permissions window 1 screenshot

Folders that you intend to publish to the web should be located in the public_html folder and must have the permissions set so that others (the server) can read and execute the directory, but not write to it!

Permissions window 2 screenshot

Folders belonging to UNIX students, which are not being published, needed to be locked down so that only the owner can do anything to the folder!

Permissions window 3 screenshot

To set the permissions of a file or folder:

  1. Single-click on the folder.

  2. Click the Info button in the toolbar.

  3. Set the correct permissions.

  4. Click the Apply button in the window.

Accessing Your Web Files via a Web Browser

Either of the following should get you to your web files. The top example uses the tilde character which our web server assumes you mean you want the web directory (public_html) for the specified user. The lower example spells out the complete path to the user's web directory.

Browser URL bar with address screenshot

What can go Wrong?

Do the File Names Match the Links?

Remember all that harping we do in the lecture about file name conventions?? Not following that advice may be coming back to haunt you now. Here are some things to look for:

  • Space and Weird Characters - There should not be any spaces in the names of the files. Sure it worked at home or in the lab, but it won't work once you transfer your HTML files to the UNIX server!

    Truth be told, UNIX does allow spaces in file names, but you don't know how to code your HTML files to tell the server there is a space in the name... so no spaces, ever!

    Delete the files from the server using your FTP tool, change the file names, and change any links in the code to match the new file names, then re-FTP the files back to the server and test.

    There should also be no special characters in the filename. The only acceptable characters are letters, numbers, and the underscore character. If you've got things like " & + = ... then you're going to have trouble because Browsers and Servers use those special characters!

    Same solution as above!

  • Case Sensitivity - UNIX servers are case sensitive (where have you heard that before:) This means that if your code points to a file named foo.html and you upload a file named FOO.HTML... those are not the same to UNIX. Sure it worked on your Mac or PC, but...

    Either change the name of the file to match the link, or change the code to match the filename and then re-FTP the files back and test.

  • Wrong Delimiters - Did you incorrectly use the IBM-PC delimiter of \ This will work on a PC using Internet Explorer, but not in Navigator and certainly not on the UNIX platform! Examples of wrong delimiters are:

    PC Delimiter, a backward slash -      images\logo.gif
    Mac Delimiter, a colon -      images:logo.gif

    When coding HTML you should always use the UNIX delimiter / (yes even on a PC or Mac), so that it looks like images/logo.gif

    Fix the delimiters to / and re-FTP the files and test!