As students at UC we each have up to 1GB of space on The University of Cincinnati's XServe servers. This How-To will walk you through the process of setting up your Mac so that UC FileSpace will automatically show up in Finder, every time you start your computer. It is possible to mount your UCFS folder using "Connect to server" IF you are connected via their SSL or Cisco VPN client, but this requires a series of steps, and results in ALL of your traffic being routed through UC. This Howto will show you how to set up your computer so that you always have access to your UCFS folder, alongside your hard drives, optical disks, etc, no matter where you are connecting from, securely, without the burden of the VPN. When we're done, your desktop will look something like this:
*** Disclaimer: The software used in this Howto is still in development and may not be entirely stable. I am not responsible for any computer malfunction that may occur as a result of following these instructions. ***
You will need three things before we get started:
- The latest version of MacFUSE: http://code.google.com/p/macfuse/downloads/list.
- The sshfs for MacFUSE binary: http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS. Download the appropriate binary for your OS, either sshfs-static-tiger.gz or sshfs-static-leopard.gz. You may need to right-click and "Save Target As" for this to work. Download the file to your home directory.
- My UC icon bundle: uc.icns.
- Install MacFUSE. A restart will be required.
- Navigate to your home directory with Finder and double-click the sshfs file that you downloaded. This will extract the binary.
- Open /Applications/Utilities/Terminal.
- Leopard users copy and paste the following command. Enter your administrator password when prompted for "Password:".
sudo mv ~/sshfs-static-leopard /usr/local/bin/sshfs
Tiger users copy and paste this code instead, and enter your administrator password when prompted:
sudo mv ~/sshfs-static-tiger /usr/local/bin/sshfs
- Copy and paste the following command, replacing <username> with your UC username. When prompted, enter your password.
mkdir /Volumes/UC\ Filespace && /usr/local/bin/sshfs <username>@ucfilespace.uc.edu: /Volumes/UC\ Filespace/ -o reconnect,volname=UC\ Filespace
- Still in Terminal, type:
ssh-keygen -t rsa
When prompted where to save the resulting file, press enter to accept the default, and enter twice more to create a blank passphrase. We're sacrificing just a little bit of security for convenience here. Using a blank passphrase means that we can rely on just the certificate to authenticate our login, but that also means that if anybody else gets ahold of your private key somehow, they would be able to gain access to your UCFS account.
---UPDATE 1/2/2012---
I strongly recommend you use a non-empty passphrase. You can still avoid having to type it in every time the connection is made by typing "ssh-add" in the terminal and then entering your password when prompted. In Linux, this is accomplished with the ssh-agent program which is started by the display manager when you log in to your desktop locally. In OS X, ssh-agent is integrated with the Keychain application, which will save your passphrase along with saved passwords used by other programs such as chat clients, email applications, etc.
- Copy the public key to UC's server by copying and pasting the following command:
mkdir /Volumes/UC\ Filespace/.ssh && cat ~/.ssh/id_rsa.pub >> /Volumes/UC\ Filespace/.ssh/authorized_keys && umount /Volumes/UC\ Filespace
- Open /Applications/Script Editor.
- Copy and paste the following into the top field, replacing <username> with your UC username:
try
do shell script "mkdir /Volumes/UC\\ Filespace &> /dev/null"
end try
do shell script "/usr/local/bin/sshfs <username>@ucfilespace.uc.edu: /Volumes/UC\\ Filespace/ -o reconnect,volname=UC\\ Filespace &> /dev/null"
- Hit ⇧⌘S to save as, type "UCFileSpaceConnect", navigate to the Applications folder, select "application" where it says "File Format:", make sure "Run Only" is selected under Options, and click "Save".
- Open System Preferences and click "Accounts" under "System".
- Click on the "Login Items" panel and add an item by clicking the "+" button at the bottom of the list.
- Find the application we just saved and click "Add". This will ensure that UC FileSpace shows up on your desktop every time you log in.
- Click anywhere on your desktop and hit ⌘, or go to Finder → Preferences.
- Click "Connected servers" under "Show these items on the Desktop" if it isn't already selected.
- Open our UCFileSpaceConnect application. An item named "UC Filespace" should appear on your desktop.
- Click on UC Filepace and hit ⌘I or go to File → Get Info
- Navigate to your downloaded uc.icns file and bring up its Info window as well.
- Click on the little UC icon in the upper left corner of the Get Info window of the uc.icns file. A blue outline will appear around the icon. Hit ⌘C or go to Edit → Copy.
- Click on the icon in the upper left corner of the Get Info window of UC Filespace and paste the UC logo with ⌘V or Edit → Paste.
At this point, we are already connected to UC FileSpace, and depending on how your Finder preferences are set, it may even be on your desktop. If you like, you can skip the rest of this Howto and type in this command every time you want to connect. However, this wouldn't be too convenient, and it would probably be easier to just use an SFTP program to upload and download files. The rest of this Howto will help you set up your Mac so that UC FileSpace always connects when you login to Finder, and shows up on your desktop with a pretty little UC icon.
Now we need to create a public/private key pair, so that your Mac and UC's server will recognize each other without the need to ask you for a password.
You should now be able to connect to UC FileSpace via SSH without having to enter a password. Try it!
And we're done! You can now access your UC FileSpace files and website right from the desktop on your Mac. Enjoy.
Note: I have been using UC FileSpace from my Desktop for several months and have not suffered any adverse consequences. This may be because I learned early on that if your internet goes down or your computer otherwise fails to reconnect to UC's server, DO NOT select "Try again" when you get the Connect Failed dialog box. Always "Force Eject" and run the connect application again once you have a steady internet connection. In my experience, "Try again" often causes Finder to crash, requiring a hard reset of your computer. Then again, this may have been fixed in later releases of MacFUSE.
No comments:
Post a Comment