T-110.5200 Laboratory Works on Information Security (4 cr)

Lab 2: Network Filesystems


Description of Exercise

In this exercise you will setup various network filesystems. You have to compare network filesystems shortly using internet (orbook) sources and your own experiments.

Material

 
You are required to include the typed commands and their outputs as usual. See lab instructions. 

1. Preparation

Log on to two virtual computers (Machine 1 and Machine 2). Add IPv4
aliases (lab1 and lab2) on both the computers to /etc/hosts (see "man
hosts").

Add static addresses to both Lab 1's and Lab 2's eth1 interfaces.

Create two new users (e.g. "testuser1" and "testuser2") with adduser to both the computers. Ensure that users have same UID on both computers (eg. testuser1 UIDis 1001 on lab1 and lab2, testuser2 is 1002). Easiest way is to create both users on same order to both computers.

2. Installing software

Using yum (8) install unfs3, samba, portmap, nfs-utils and
samba-client if they are not already installed.

3. Configuring and testing nfs

NFS is an acronym for "network filesystem". NFS is implemented for nearly allunix variations and even for windows.

Export /home via exports (see "man exports"). Reload nfs daemon.Mount lab1:/home to lab2:/home. You can change user with su, e.g. "su - testuser1". Now both computers have same home folders. 

3.1 What are the problems with NFSv3 'default' installations and firewalls? Use (trusted) internet sources AND tell what sources you used. 2 p
3.2 What are the security problems with NFSv3 so-called authentication? Are there any alternatives for securing NFSv3? (hint: kerberos and NFS)  2 p
3.3 Explain shortly booting diskless linux from network (via tftp and nfs)  2 p
3.4 Is it possible to encrypt all NFS traffic? How? Without (quite heavy) full VPN? How about SSH (without TUN VPN)?  2 p
3.5 What happens if testuser1 UID is 1001 in lab1, 1002 in lab2 and testuser2 is 1002 in lab1, 1001 in lab2? Try or think (and check from documentation).  2 p

4. Configuring and testing samba

Samba is unix/linux implementation for normal Windows network shares(netbios and CIFS (common internet filesystem)). You can configure samba via /etc/samba/smb.conf. You can access samba with command smbclient or by mounting via mount.

Share /home with read and write permissions (/home shares are already at smb.conf but needs little bit of tweaking) and reload samba. Try to mount //lab1/homes to lab2:/mnt/testuser1 with username testuser1 and testuser1's password. You have to run smbpasswd with correct parameters on lab1 first. Check that necessary services and ports are open. 

4.1 Only root can use mount. What is the problem with home folders? Can this be overridden? 1 p
4.2 When and why may samba be good choice (hint: interoperability with one specific operating system)?  1 p

5. Configuring and testing sshfs

sshfs is filesystem for FUSE (filesystem in userspace).

Since the virtual machines have quite little space, we need to make some room. First umount the samba share on lab2. Then uninstall samba by "yum remove samba*".

Now lets update the kernel and install required files:

input: yum update kernel-xen
input: yum install kernel-xen-devel
input: yum install dkms dkms-fuse

Lets reboot with the new kernel:

input: shutdown -r now

You have to wait for a minute or two while the machine boots up again. Log back in to the machine after a while. (The connection will refuse until the machine is ready)

Check that that fuse is installed with:

input: modprobe fuse

It should return you straigth to the prompt. Otherwise see troubleshooting below.

Now mount lab1:/home/testuser1 to lab2:/mnt/testuser1 using sshfs.

Include the commands and outputs in your report that show that the mount works.

5.1 When is sshfs a good solution? 1 p
5.2 What are the advantages of FUSE?  1 p
5.3 Why doesn't everyone use encrypted channels for all network filesystems?  1 p

Troubleshooting:

If you get "FATAL: Module fuse not found." when trying "modprobe fuse", check that you have the same version of kernel-xen and kernel-xen-devel (yum list kernel*) and follow the instructions from the beginning.


6 Final questions

6.1 Describe briefly few use cases for samba, nfs and sshfs. Where, why, weaknesses? 3 p
6.2 There are many other alternatives. Choose a couple of them and
compare them with the previous.
3 p

7 Finishing your work

When finishing your work, copy your related files from the lab computers to a safe place (e.g. your home directory in Niksula or the Computer Center). Copy your report to /home/answers on Lab machine 1 and make sure it is accessible there at assignment deadline.