​https://www.linuxidc.com/Linux/2018-11/155331.htm​

服务端关键命令:

apt install nfs-kernel-server
mkdir -p /mnt/linuxidc
chown nobody:nogroup /mnt/linuxidc
chmod 777 /mnt/linuxidc
vim /etc/exports # /mnt/linuxidc 192.168.182.0/24(rw,sync,no_subtree_check)
exportfs -a
systemctl restart nfs-kernel-server
ufw allow from 192.168.182.0/24 to any port nfs

客户端关键命令:

apt-get install nfs-common
mkdir -p /mnt/linuxidc_client
mount 192.168.182.172:/mnt/linuxidc /mnt/linuxidc_client

实测可以成功

客户端重启自动挂载:

# vi /etc/fstab
172.20.1.11:/opt/odoo12/.local/share/Odoo /mnt/nfs-client/Odoo nfs defaults 0 0

懂得,原来世界如此简单!