Part 2. Setup Server Access
This section is performed once for each remote server, to add information about
the server to the local desktop. Instructions are provided using Domain Names.
IP addresses would also work, but then the shares would not be accessible both
locally and remotely. When DNS is properly configured, access works whether the
connection is local, bridged, VPN, or public.
Note
Throughout these instructions, replace HOSTSERVER, DOMAIN, and
TLD with the name of the server to be accessed, the domain for the
server, and the top-level domain (.com, .net, etc.). For example,
HOSTSERVER.DOMAIN.TLD might be replaced with officeserver.aaltsys.com
for the office server at AAltSys.
Assign a mount point (a file directory pointer) for the remote server to use:
sudo mkdir /mnt/HOSTSERVER/
The master configuration file, auto.master, provides autofs with mount
names and server configurations for shares. At the terminal, type the command:
sudoedit /etc/auto.master
and add the following line of text, replacing HOSTSERVER with the server name:
/mnt/HOSTSERVER /etc/auto.HOSTSERVER --timeout=30,--ghost
Now create and edit the server configuration file, auto.HOSTSERVER, to
provide server-specific information:
sudoedit /etc/auto.HOSTSERVER
and enter and save the share configuration information, such as:
public -fstype=fuse,rw,nodev,nonempty,noatime,max_read=65536,allow_other,compression=yes,uid=$UID,gid=$GID,StrictHostKeyChecking=no,IdentityFile=$HOME/.ssh/id_rsa,umask=0007 :sshfs\#$USER@HOSTSERVER.DOMAIN.TLD\:/home/samba/shares/public/
* -fstype=fuse,rw,allow_other,nodev,nonempty,noatime,max_read=65536,compression=yes,uid=$UID,gid=$GID,StrictHostKeyChecking=no,IdentityFile=$HOME/.ssh/id_rsa,umask=0077 :sshfs\#$USER@HOSTSERVER.DOMAIN.TLD\:/home/&
Restart the autofs module to load the changed configuration:
sudo /etc/init.d/autofs restart
sudo ssh HOSTSERVER.DOMAIN.TLD
When prompted for the root password of the remote host, press <Ctrl-C>
to exit the command.
Part 3. Provide your ssh key
This section must be performed for each local user who will access the remote
server. Type the following commands to (1) create an ssh private key provided
one does not exist, and (2) copy a user public key to the remote server for
authentication:
if [ ! -f "$HOME/.ssh/id_rsa" ]; then ssh-keygen; fi
ssh-copy-id `id -un`@HOSTSERVER.DOMAIN.TLD
Now verify that the remote folders will mount:
ls -al /mnt/HOSTSERVER
ls /mnt/HOSTSERVER/`id -un`
Bookmark folders in /mnt/HOSTSERVER in the file manager for easy access.