ubuntu-12 NFS服务器搭建

NFS服务器搭建

安装软件包

$ sudo apt-get install portmap nfs-kernel-server nfs-common

配置 /etc/exports 文件

$ ubuntu@ubuntu-virtual-machine:~$ cat /etc/exports 
/usr/share 192.168.1.1/255.255.255.0(rw,sync,no_root_squash)

注意:在主机和权限之间不能有空格

启动服务器

$ sudo /etc/init.d/portmap restart
$ sudo /etc/init.d/nfs-kernel-server restart

ubuntu14需要命令

sudo exportfs -a

查看共享

$ showmount -e localhost

挂载

$ sudo mkdir /mnt/nfs
$ mount -t nfs 192.168.1.117:/usr/share /mnt/nfs

ok, 挂载完成,可以共享文件了。

ubuntu14参考下面连接:

https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04

猜你喜欢

转载自blog.csdn.net/hnhkj/article/details/52033258