NFS掛載

  

配置NFS導出共享目錄

  1. 在Server0上,要求共享目錄/nfstest,僅允許example.com域主機能以只讀的方式訪問目標服務器

  2. 在Server0上,共享目錄/nfsprivate,僅允許example.com域可以訪問,域內主機擁有讀寫功能,並且使用Kerboers安全認證。驗證所用文件使用

http://cla***oom.example.com/pub/keytabs/server0.keytab

 

NFS Kerberos安全掛接

  1. Desktop0上使用krb5p來對Server0上NFS共享/nfsprivate目錄的共享進行安全認證,驗證所用文件使用http://cla***oom.example.com/pub/keytabs/desktopX.keytab

  2. 要求每次開機都能自動掛載

 

 

NFS客戶端掛載

  1. 在Desktop0上,要求將Server0上共享的/nfstest目錄掛接在本地/nfstest

  2. 要求每次開機都能自動掛載


一、要求把Server0上共享的/nfstest目錄掛載在本地/nfstest上


Server0上:

 

         mkdir  /nfstest   #創建掛載目錄

         mkdir  /nfsprivate  #創建掛載目錄

         lab nfskrb5 setup  #設置nfs運行環境

         vim  /etc/exports #編輯nfs掛載

                 /nfstest                172.25.0.0/16(ro)#僅允許example.com域主機以只讀的方式訪問目標服務器

         systemctl enable nfs-server #設置nfs-server服務開機自啓

         systemctl start nfs-server #啓動nfs-server服務

         firewall-cmd --permanent --add-service=nfs #防火牆開啓nfs

         firewall-cmd --reload #防火牆重新加載


Desktop0上:

          mkdir /nfstest #創建掛載目錄

           vim /etc/fstab #編輯/etc/fstab使之自動掛載

           server0:/nfstest    /nfstest     nfs   defaults    0  0

           mount -a #掛載全部

           df -h #查看全部的掛載目錄


二、基於Kerboers的身份驗證


Server0上:


                  vim   /etc/exports #編輯nfs掛載文件

                  /nfsprivate    172.25.0.0/16(sec=krb5p,rw)

                  exportfs -r #重新加載下

                  showmount -e localhost #顯示下本地掛載的情況

                  wget -O /etc/krb5.keytab http://cla***oom.example.com/pub/keytabs/server0.keytab #下載基於krb5認證的文件

                  systemctl  start nfs-secure-server #啓動安全認證服務器

                  systemctl enable nfs-secure-server #使安全認證服務器開機自啓動

                 

desktop0上:

                

                   mkdir  /nfsprivate # 創建掛載目錄

                   wget -O /etc/krb5.keytab  http://cla***oom.example.com/pub/keytabs/desktop0.keytab  #下載認證文件

                   systemctl start nfs-secure #啓動nfs 安全認證

                   systemctl enable nfs-secure #設爲開機自啓動服務

                   vim /etc/fstab #編輯/etc/fstab

                        server0:/nfsprivate      /nfsprivate   nfs    defaults,sec=krb5p  0 0#設爲自動掛載

                   mount -a #全部掛載

                   df -h #查看掛載的磁盤







                  


                  

                 

  


           

    


        

        

       




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章