陈清泉 哈工大:ubuntu nfs

来源:百度文库 编辑:九乡新闻网 时间:2024/04/16 23:34:37
sudo apt-get install nfs-kernel-server 安装nfsvim /etc/exports  打开配置文件         # /etc/exports: the access control list for filesystems which may be exporte    d
        2 #       to NFS clients.  See exports(5).
        3 #
        4 # Example for NFSv2 and NFSv3:
        5 # /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_    subtree_check)
        6 #
        7 # Example for NFSv4:
        8 # /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
        9 # /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
       10 
       11 /home/xwp/nfs *(rw,no_root_squash,sync)
修改11行:/home/xwp/nfs  是你自己的文件夹 把你要上传的东西放到此文件夹下                      * 是你要共享给的ip “*”是全部ip  也可以改成 192.168.42.*                      rw是可读写权限 no_root_squash 无根权限可访问  sync 同步 别人可修改并且你能看到sudo service nfs-kernel-server restart(start stop)  重启nfs showmount -e 192.168.42.33  查看你想登陆的ip共享的哪个文件夹 sudo mount 192.168.42.33:/home/xwp/...   ./aa    挂在到192.168.42.33:/home/xwp/...   到 自己的./aa文件夹下 sudo umount ./aa   卸载