From 205aa310301386d03eb4b570f0cee53f324d2b37 Mon Sep 17 00:00:00 2001 From: gaoyang3513 Date: Sat, 14 Oct 2023 15:29:05 +0000 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=20Ubuntu=20nfs=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=80=9A=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReadMe.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 5784c75..d89c50c 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -100,9 +100,11 @@ Even if neither end of the connection supports nfs v4, adding nfsver=3 is still Installation of NFS Utilities Before you compile the program, ensure that the nobody user and nogroup group have been created as done in the current LFS book. You can add them by running the following commands as the root user: +```shell groupadd -g 99 nogroup && useradd -c "Unprivileged Nobody" -d /dev/null -g nogroup \ -s /bin/false -u 99 nobody +``` [Note] Note The classic uid and gid values are 65534 which is also -2 when interpreted as a signed 16-bit number. These values impact other files on some filesystems that do not have support for sparse files. The nobody and nogroup values are relatively arbitrary. The impact on a server is nil if the exports file is configured correctly. If it is misconfigured, an ls -l or ps listing will show a uid or gid number of 65534 instead of a name. The client uses nobody only as the user running rpc.statd. @@ -125,9 +127,25 @@ chown nobody.nogroup /var/lib/nfs ```shell -./configure --prefix=${PWD}/../_install \ - --sbindir=/sbin \ - --disable-nfsv4 \ - --disable-gss && +./configure --prefix=${PWD}/../_install --disable-nfsv4 --disable-gss --disable-uuid --disable-mount --sbindir=${PWD}/../_install/sbin/ --with-statedir=${PWD}/../_install/var/lig/nfs/ + +# install-data-hook目标错误,修改Makefile,屏蔽chown,/var/lib/nfs + +# make ``` + + +## 启动 + +https://blog.csdn.net/qq_26601681/article/details/104940430 +http://www.cnitblog.com/gouzhuang/archive/2010/03/23/nfs_utils.html + + +```shell +sudo mount -t nfsd nfsd /proc/fs/nfsd + +./../_install/sbin/rpc.statd +./../_install/sbin/rpc.nfsd +./../_install/sbin/rpc.mountd +``` \ No newline at end of file