NFS server on OpenBSD
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)
useradd -b /home/faculty/ -s /bin/bash -m admin
passwd adminLet's use the passwordPassword!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=YES
nfs_server=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 nfsd
rcctl set nfsd flags -tun 4Once 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.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 startedrcctl start portmap mountd nfsdand in case you edited the /etc/exports file while the NFS was running, restart the service.rcctl reload mountdMount
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 -ycreate /storage in the root directory
sudo mkdir /storagegive everyone all permissions
chmod 777 /storageedit the fstab to automount the folder - we'll assume the hostname of the OpenBSD server is 'server1'
sudo nano /etc/fstaband add this to the bottom of the file
server1:/home/admin/storage /storage nfs and remount everythingsudo mount -athat's it! You should have full access to the network folder.