nfs

################nfs################vim

##################################ide

1.nfs準備測試

systemctl start nfs-serverui

systemctl enable nfs-serverspa

systemctl stop firewalldorm

firewalld-cmd --permanent --add-service=nfsserver

firewalld-cmd --permanent --add-service=rpc-bindblog

firewalld-cmd --permanent --add-service=mountdci

2.共享目錄rpc

systemctl start nfs-server

mkdir /public

chmod 777 /publc

 

 

vim /etc/exportfs

/public         *(sync)      ###public共享給全部人並數據同步

 wKioL1lBDyrCkSBMAAAwUxWq-cQ840.png-wh_50

 

/public         172.25.254.1(sync)  ###public只共享給172.25/254.1 主機

 wKioL1lBD5rAbxAGAAB0L8fR5vg268.jpg-wh_50

 wKioL1lBEDbAOrjBAADxLFIYtwY102.png-wh_50

/public         *.example.com(sync) ###public之共享給example.com這個域

測試時先在102主機作解析

 wKioL1lBEFSxKUy7AACMJtCzRMg089.png-wh_50

/public         172.25.254.101(ro,sync)   172.25.254.1(rw,sync)###public共享給101只能夠讀,共享給1主機能夠讀寫

 

wKiom1lBEG7Bg6ATAAEtAw6hRfQ894.png-wh_50

wKioL1lBEG7wAFwqAACxIdY6ZEQ287.png-wh_50


 

/public         *(sync,no_root_squash)   ###public共享給全部人,當客戶端使用root掛載時不轉換用戶身份

 wKiom1lBELWgN2LIAAA3okemQ18379.png-wh_50

 

/public         *(sync,anonuid=1001,anongid=1000) ###public共享給全部人以1001爲uid,1000爲gid

 wKiom1lBENmg-Xu5AABWIbzScCs942.png-wh_50

 

 

3.利用kerberos保護nfs輸出

 

server上

 

開啓kerberos認證,獲得ldap用戶

 

wget ://172.25.254.254/pub/keytabs/server1.kettab -O /etc/krb5.keytab

ktutil

ktutil:   rkt /etc/krb5.keytab

ktutil:   list

 

 

systemctl start nfs-secure-srever

systemctl enable nfs-secure-server

 

vim /etc/exports

/public                    *(rw,sec=krb5p)

 

exports -rv

 

desktop上

 

開啓kerberos認證,獲得ldap用戶

 

wget  httpd://172.25.254.254/pub/keytabs/desktop1.kettab  -O /etc/krb5.keytab

 

ktutil

ktutil:   rkt /etc/krb5.keytab

ktutil:   list

 

systemctl start nfs-secure

systemctl enable nfs-secure

 

mount 172.25.254.102:/public      /mnt   -o sec=krb5p

 

 

su-student

cd /mnt        ### 沒有進行kerberos認證,權力受限

su-ldapuser1

klist

 

ls /mnt      ###進行了kerberos認證,能夠查看

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息