Service - NFS | Ubuntu

Server 服务器端

At a terminal prompt enter the following command to install the NFS Server:

1
sudo apt install nfs-kernel-server

To start the NFS server, you can run the following command at a terminal prompt:

1
sudo systemctl start nfs-kernel-server.service

编辑 /etc/exports,使用 sudo exportfs -a 命令使立即生效

Client 客户端

使用以下命令启用,安装 nfs-common 启用客户端NFS

To enable NFS support on a client system, enter the following command at the terminal prompt:

1
sudo apt install nfs-common

Use the mount command to mount a shared NFS directory from another machine, by typing a command line similar to the following at a terminal prompt:

1
2
sudo mkdir /opt/example
sudo mount example.hostname.com:/srv /opt/example