NFS實現共享

2021-10-01 08:36:53 字數 1247 閱讀 3396

101建立資料夾使其102能夠進行訪問

[192.168.41.101]

1.安裝nfs包

yum install nfs-utils -y

service rpcbind start

service nfs start (centos6)

systemctl start nfs-server (centos7)

chkconfig nfs on 開機自啟動 (centos6)

systemctl enable nfs-server 開機自啟動(centos7)

chkconfig --add netfs

chkconfig netfs on

netfs 需要開機自啟

[192.168.41.101]

2.建立共享的資料夾

mkdir /data/nfs1

touch f1

[192.168.41.101]

3.編輯配置檔案實現共享的目錄和許可權

vim /etc/exports

/data/nfs1 *(rw)

#/data/nfs1 192.168.41.102(rw) #只允許102掛

#/data/nfs1 192.168.41.0/24(rw) 172.16.0.0/16(rw) 不同網段許可權不同

#/data/nfs1 *(rw,no_all_squash) 你登入是什麼就是誰建立的。

#/data/nfs1*(rw,no_root_squash,all_squash,anonuid=1000,anongid=1000) 指定規定使用者建立

exportfs -r #使其生效

exportfs -v #檢視已經共享的列表

[root@centos7 ~]#setfacl -m u:nfsnobody:rwx /data/nfs1

[192.168.41.102]

4.測試

[root@centos7 ~]#showmount -e 192.168.41.101

export list for 192.168.41.101:

/data/nfs1 *

[192.168.41.102]

5.實現掛載到本地

[root@centos7 ~]#mkdir /mnt/nfs1

[root@centos7 ~]#mount 192.168.41.101:/data/nfs1 /mnt/nfs1

NFS掛載 實現檔案共享

nfs,是由sun公司研製的檔案傳輸協議 nfs主要是採用遠端過程呼叫rpc機制實現檔案傳輸 安裝 yum install y nfs utils rpcbind 建立www data共享資料夾 cd usr local mkdir data cd data mkdir www data cd ww...

NFS實現資料夾共享

基於nfs實現網路對映 場景 假設10.147.136.48上有乙個目錄 home work,10.147.136.49需要對其進行訪問並能進行讀寫操作。原理 nfs 網路檔案系統 1.以root使用者登陸 48 2.檢查是否安裝nfs ipt4 home rpm q nfs utils nfs u...

NFS 實現網路共享的

nfs 實現網路共享的,用於unix like 類unix 系統間的共享 埠號是2049,基於rpc 遠端過程呼叫,埠號111 服務。nfs只提供了共享功能,底層資料傳輸交給rpc服務。唯讀共享 node1作為服務端 1 安裝軟體包 root node1 yum install y nfs util...