HOWTO Use sshfs to mount AFS/DFS home

From RHLUG

Jump to: navigation, search

Rose has two separate remotely accessible file systems, one that uses AFS, and one that uses DFS. This will show you how to mount both using sshfs.

Contents

[edit] Install FUSE and sshfs

This differs based on your distribution. Under Gentoo execute:

emerge -av sshfs-fuse

Under Ubuntu:

sudo apt-get install sshfs

This will install both sshfs and FUSE.

Gentoo users will also need to edit the FUSE configuration so users other than root can use FUSE.

File: /etc/fuse.conf
user_allow_other

[edit] About sshfs

sshfs allows you to mount remote directories over SSH. This is useful for accessing remote files securely. For example, to mount the remote directory /home/user on example.com to a local directory ./remote

sshfs example.com:/home/user ./remote

To unmount this:

fusermount -u ./remote

[edit] AFS

The traditional way of mounting AFS is by using Kerberos and OpenAFS, as detailed in the AFS article. However, this is a bit of a pain.

[edit] Manually

To mount your home directory, first create a directory somewhere to mount it to, for example the directory "rose-afs-home" in your home directory:

mkdir ~/rose-afs-home

Then, use sshfs to mount the remote directory to that mount point.

sshfs <USERNAME>@addiator.rose-hulman.edu: ~/rose-afs-home

Where <USERNAME> is your Kerberos username.

[edit] Using /etc/fstab

Typing this command is a bit tedious. A much easier way to to add an entry to your /etc/fstab.

File: /etc/fstab
sshfs#<USERNAME>@addiator.rose-hulman.edu: /home/<USERNAME>/rose-afs-home fuse user,noauto 0 0

Now you can mount your AFS home directory by typing:

mount ~/rose-afs-home

At which point you'll be prompted for your password (or not if you use public key login)

[edit] DFS

The DFS server is new for this year. It is hosted on a Windows server using a proprietary SSH server. IAIT does not currently have this server set up to support public-key login, so typing a password is necessary each time you connect.

[edit] Manually

The process for mounting the DFS home is similar to above, however the location of the directory on the server is different. Create a mount point and then issue the following command:

sshfs <USERNAME>@dfs.rose-hulman.edu:/Users/<INITIAL>/<USERNAME> ~/rose-dfs-home

Where <USERNAME> is your Kerberos username and <INITIAL> is the capitalized first letter of your username. For example, this is the command I would use to mount my DFS home directory:

sshfs auchtemm@dfs.rose-hulman.edu:/Users/A/auchtemm ~/rose-dfs-home

[edit] Using /etc/fstab

File: /etc/fstab
sshfs#<USERNAME>@dfs.rose-hulman.edu:/Users/<INITIAL>/<USERNAME> /home/<USERNAME>/rose-dfs-home fuse user,noauto 0 0

Now you can mount your DFS home directory by typing:

mount ~/rose-dfs-home

[edit] See also

Personal tools