## Server:192.168.1.211
```
yum -y install nfs-utils
vim /etc/exports
/nfsfile 192.168.1.*(rw,sync,root_squash)
mkdir /nfsfile
chmod -Rf 777 /nfsfile
firewall-cmd --permanent --add-service=nfs
firewall-cmd --permanent --add-service=rpc-bind
firewall-cmd --permanent --add-service=mountd
firewall-cmd --reload
systemctl restart nfs-server
systemctl enable nfs-server
systemctl restart rpcbind
systemctl enable rpcbind
exportfs -arv //開啟對外發布
exportfs -auv //關閉對外發布,關閉后客戶端使用 showmount -e 無法查看
```
## Desktop:192.168.1.210
```
yum -y install nfs-utils
showmount -e 192.168.1.211
mkdir /nfsfile
mount -t nfs 192.168.1.211:/nfsfile /nfsfile //臨時掛載
vim /etc/fstab
192.168.1.211:/nfsfile /nfsfile nfs defaults 0 0//持久掛載需要寫入 fstab 文件
//defaults 可以修改為 rw,tcp,intr
```
## /etc/exports
| 參數 | 作用 |
| --- | --- |
| ro | 制度 |
| rw | 讀寫 |
| root_squash | 當NFS客戶端以root管理員訪問時,映射為NFS服務器的匿名用戶 |
| no_root_squash | 當NFS客戶端以root管理員訪問時,映射為NFS服務器的root管理員 |
| all_squash | 無論NFS客戶端使用什么賬戶訪問,均映射為NFS服務器的匿名用戶 |
| sync | 同時將數據同時寫入內存與硬盤中,保證不丟失數據 |
| async | 優先將數據保存到內存,然后再寫入硬盤;這樣效率高,但可能會丟失數據 |
## NFS 僅能實現 linux 之間的文件共享
- Linux Server
- 實用命令
- services
- Samba
- /etc/samba/smb.conf
- NFS
- Http
- httpd.conf
- lamp
- FTP
- /etc/vsftpd/vsftpd.conf
- ftp實例
- iSCSI
- SElinux
- DNS
- master
- slave
- subdomain
- 相關配置文件
- /etc/hosts
- /etc/resolv.conf
- /etc/named.conf
- /var/named/named.ca
- /var/named/named.localhost&named.loopback
- DHCP
- /etc/dhcp/dhcpd.conf
- mysql
- Redis
- Git
- HAProxy
- haproxy
- openssl
- nodejs