Xiaopei's DokuWiki

These are the good times in your life,
so put on a smile and it'll be alright

User Tools

Site Tools


Table of Contents



$ sudo apt-get install nfs-kernel-server
# You can configure the directories to be exported by adding them to the /etc/exports file. For example:
/ubuntu  *(ro,sync,no_root_squash)
/home    *(rw,sync,no_root_squash)
# You can replace * with one of the hostname formats. Make the hostname declaration as specific as possible
# so unwanted systems cannot access the NFS mount.
#To start the NFS server, you can run the following command at a terminal prompt:
$ sudo service nfs-kernel-server start
$ yum -y install nfs-utils
$ systemctl enable nfs-server.service
$ systemctl start nfs-server.service
$ mkdir /var/nfs
$ chown nfsnobody:nfsnobody /var/nfs
$ chmod 755 /var/nfs
$ vi /etc/exports
/home ,sync,no_root_squash,no_subtree_check)
# Whenever we modify /etc/exports, we must run:
$ exportfs -a


$ sudo aptitude install nfs-common
$ sudo mount  /mnt/nfs
# 如果报这种错,就是没装 nfs-common
mount: wrong fs type, bad option, bad superblock on,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
it/linux/nfs.txt · Last modified: 2017/05/25 11:09 by admin