This is a handful of tips for managing files on CAEN effectively using command line tools. Alternatives include MFile, using an SFTP client, or using an SFTP plugin for your editor.

If you’re using Sublime Text, many students use an SFTP plugin to automatically upload files to CAEN. However, I don’t have any experience with it and thus cannot offer any configuration advice.

At the end of this article, there’s a guide to mounting a directory on CAEN as if it were on your local computer, but it only works in OS X and Linux. You may prefer to use this to avoid having to manually keep things in sync.

Stop typing login.engin.umich.edu by using SSH aliases

You probably don’t like typing the verbose ssh you@login.engin.umich.edu all the time. Fortunately, ssh has a built-in method for setting up aliases for hosts. Edit the file ~/.ssh/config and add these lines (changing you to your uniqname):

Host caen
  HostName login.engin.umich.edu
  User you

This sets up a new alias, so now you can type ssh caen instead to log into CAEN.

Uploading files to CAEN

You can use the scp command (secure copy) to copy files to and from CAEN. scp’s syntax is the same as cp’s, except that either the source or destination should be on a remote host.

For example, to copy my-file.cpp to the project-1 directory CAEN, you could do this:

$ scp my-file.cpp you@login.engin.umich.edu:project-1

Of course, you don’t want to type out the whole you@login.engin.umich.edu bit every time, so we can use the SSH alias you just set up:

$ scp my-file.cpp caen:project-1

If you want to copy a whole directory, then you need to pass the -r (recursive) flag, just like with cp. To copy my-directory into your project-1 directory:

$ scp -r my-directory caen:project-1

Downloading files from CAEN

Just put the arguments to scp in the reverse order to download from CAEN:

$ scp -r caen:project-1/my-directory my-directory

Mounting CAEN as if it were a local drive

You can use sshfs (“SSH filesystem”) to access files over SSH as if they were on your local computer.

Linux users: just apt-get install sshfs or whatever it is you usually do.

OS X users:

  1. Ensure you have Homebrew installed. You can get it from brew.sh.

  2. Make sure Homebrew is up-to-date. Run brew update in your terminal.

  3. Install osxfuse by running this command in your terminal: brew install osxfuse. Homebrew should install it for you and give you output like this:

    The new osxfuse file system bundle needs to be installed by the root user:
    
      sudo /bin/cp -RfX something...
      sudo chmod +s something...
    
  4. The output from brew contained two commands, as seen above. Copy and paste them each of them into your terminal and run them.

  5. Install sshfs by running brew install homebrew/fuse/sshfs.

Now you can use sshfs. Open up the terminal and navigate to the place where you want to make the virtual folder show up. For example:

$ cd ~/Desktop

Make a new folder to hold the contents of your CAEN directory. (You can use any empty folder, so feel free to reuse this folder between uses, or use a differently-named folder.)

$ mkdir caen-drive

Then mount CAEN using this command. This will prompt you for your CAEN password.

$ sshfs caen: caen-drive

Now you should be able to browse that folder and see the contents of your CAEN home directory. When you’re done, you can disconnect with this command:

$ umount caen-drive

Caveats