Note: if having trouble with the vi text editor, I listed a few simple commands elsewhere on the blog. For now, a few quick reminders:
i --> enters Insert mode (where you can enter text)
[ESC] --> enters command mode
:w --> saves the file (have to be in command mode)
:q --> exits the file (have to be in command mode)
Let's call the shared folder 'storage'. We'll put it in the home directory of the user 'admin'. We have to create the user, and the folder.
useradd -b /home/faculty/ -s /bin/bash -m adminLet's use the password
Password!since this is a local machine, and I'm assuming that the folks on the LAN are friendly.
Next, make sure the new user owns their home directory.
chown -R admin: adminAnd then create the shared directory inside /home/admin,
mkdir /home/admin/storageand make sure that everyone can read/write to that spot.
chmod -R 777 /home/admin/storageI think nfs can be activated by adding the following to rc.conf.local. (src; might not be updated, and I can't see more than the first bit)
vi /etc/rc.conf.localadd to the end of the file:
portmap=YESOR, I can run these two commands. There's this thing about multiple server instances, so that I can handle concurrent requests, that I can control with the following commands...I just don't know if the services will be enabled after a reboot.
rcctl enable portmap mountd nfsdOnce the services are started, the /etc/exports file needs an entry. This is how the machine knows to share the folder - and who to share it to.
rcctl set nfsd flags -tun 4
vi /etc/exportsadd to the bottom (this gives everyone accessing the folder root access),
/home/admin/storage -alldirs -mapall=rootNow the nfs service can be started
rcctl start portmap mountd nfsdand in case you edited the /etc/exports file while the NFS was running, restart the service.
rcctl reload mountd
to mount the new network folder, you have to create your own location for the folder to present itself, and then set the folder to automount.
Also, don't forget to install the nfs software. It came default on OpenBSD, but not so much on Linux Mint.
sudo apt-get install nfs-server -y
create /storage in the root directory
sudo mkdir /storage
give everyone all permissions
chmod 777 /storage
edit the fstab to automount the folder - we'll assume the hostname of the OpenBSD server is 'server1'
sudo nano /etc/fstab
and add this to the bottom of the file
server1:/home/admin/storage /storage nfsand remount everything
sudo mount -athat's it! You should have full access to the network folder.