100% found this document useful (1 vote)
63 views32 pages

Understanding NFS

Uploaded by

Aung Aung
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
63 views32 pages

Understanding NFS

Uploaded by

Aung Aung
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Understanding NFS

အခု Article ကတ ော့ RHCSA/CE objective မ တ ပါ၀င် ော့ NFS Server


အတ က င််းပဖြစ်ပါ ယ်။ NFS, Network File System Protocol Service အလုပ်လုပ်ပုကတ ော့
Unix/Linux Enviornment မ File Sharing Service ကု လုပ်တ င်တပ်းပါ ယ်။ သတ အ ်းဖြင ော့်
NFS Server ကတေ share တပ်းချင််း ော့ directory ကု export လုပ်လက
ု ် ယ် Linux Client ကတေ
၄င််း directory ကု Mount လုပ်ဖခင််း ဖြင ်ော့ access လုပ်ပါ ယ်။ RHEL 7 မ တ ော့ NFS Version 3
and 4 ကု support လုပ်ပါ ယ်။ NFS Server ကတေ mount လုပ် အ
ော့ ခါ Manually mount
လုပ်ပပ်း access လုပ် ရသလု Auto Mount method ေလည်
ော့ ်း အသ်းု ဖပြုနင
ု ပ
် ါ ယ်။

NFS Server ကု NFS client ကတေ access လုပ် မ အသ်းု ဖပြု ော့ Security Method
စ်ချြုျို့ကုတဖပ ချင်ပါ ယ်။

1) None: NFS Server ကု anonymously access လုပ်နင


ု ပ
် ါ ယ်

2) sys: NFS မ sharing တပ်းထ ်းတသ file မျ ်းကု access လုပ် မ standard linux permission
တ ွေဖြစ် ော့ UID,GID permission န
ု ော့ င ်ော့ ကေသ
် ော့ ်ပပ်းအသ်းု ဖပြုဖခင််းဖြစ်ပါ ယ်။

3)Krb5: krb5 method နငအ


ော့် သ်းု ဖပြု အ
ော့ ခါ client တ ွေသည် nfs server ကု access လုပ် ွေင ်
Kerberos authentication Kerberos Version (5) နင ော့် standard file permission ကုအသ်းု ဖပြုပပ်း
access ဖပြုလုပ် မ ဖြစ်ပါ ယ်။

4)Krb5i: Krb5i method ကျတ ော့ Kerberos Version 5 authentication နငအ


ော့် ူ Checksum
Method ကုပါအ ူ ွေသ်းု ပပ်း အသ်းု ဖပြု ော့ Method ဖြစ်ပါ ယ်။

5) Krb5p: Krb5p ကျတ ော့ NFS Server ေ NFS


ော့ Client က ်းမ အလုပ်လုပ်တေတသ connection
တ ွေအ ်းလု်းကု လု်း၀ encrypted ပုစလုပ်လက
ု ် ဖြစ်ပပ်း performance impact issue
ရနင
ု ပ
် ါ ယ်။

အထက်မ တ ်းသ ်းခော့ ော့ Security Method တ ွေကု အသ်းု ဖပြု မ nfs config ထမ “sec=mode”
ပုစမျြု်း တ ်းသ ်း ပါ ယ်။
အခု article မ တ ော့ Kerberos Server မလုပ်ထ ်း အ
ော့ ွေက် krb5 security method နင ော့်
အသ်းု ဖပြုလမ
ု ော့ ြူ်းဖြစ်သွေ ်းပါ ယ်။ Using Simple NFS server and Client အတ က င််းကုပ
တြ ်ဖပထ ်းပါ ယ်။

Configure NFS Server

Installing NFS-Utils Package

အ င် ု်း NFS Server အတေေအသ


ော့ ်းု ဖပြုမယော့် စက်မ “nfs-utils” package ရမရ #rpm –qa |
grep –i nfs-utils” နင ော့် check ပါမယ်။ မရခော့ င် ထ်းု စအ ုင်း် #yum –y install nfs-utils” ုပပ်း nfs
package ကု install လုပ်ပါ။

Enable and Start NFS Service


Installation ပပ်း င်တ ော့ nfs service Enable and Start လုပ်မယ် တေ က် firewall on
ထ ်းခော့ င် firewall-cmd နင ော့် rule တ ်းပပ်း NFS ကု allow တပ်းပါမယ်။
Creating Shared Directory
Services အပုင်း် တ ွေ ဖပင် င်ပပ်း င်တ ော့ NFS Client တ ွေကု shared တပ်းြအ
ု ော့ က
ွေ ်
“Share Directory” စ်ခု ည်တ က်ပါမယ်။ ထတေ
ု ော့ က် ၄င််း share directory ကု NFS export
ထမ သွေ ်းတ ်းပပ်း share ဖပြုလုပ်တပ်း မ ဖြစ်ပါ ယ်။ NFS Export ထမ တ ်းသ ်း င
ွေ ် Client
တ ွေအ ွေက် Client Options တ ရ
ွေ ပါ ယ်။ ဥပမ အထက်မ တဖပ ခော့ ော့ Security Method
တ ွေအဖပင် client ကု “rw” ReadWrite တပ်းမ လ ်း “ro” ReadOnly ပတပ်းချင် လ ်း သမဟု
ု ော့ ်
“root_squash” client မ rootaccess ဖြင ော့် ုက်ရု က် access လုပ်ခွေငမ
ော့် တပ်းမ လ ်း (or)
“no_root_squash” တပ်းတစချင်လ ်း စသညော့ဖ် ြငသ
ော့် ်မ ်နင
ု ပ
် ါ ယ်။ Client Options တ ွေကု
#man 5 exports မ တလော့လ နင
ု ပ
် ါ ယ်။ အ ်းလု်းသ ်မ ်ပပ်းပပ ု င်တ ော့ #exportfs –r ဖြင ော့်
share ကု export ဖပြုလုပ်ပါ ယ်။
Configuring NFS Client

Installing NFS-Utils Package


NFS Client ြက်မ လ Server ြက်ဖခမ််းလုပ “nfs-utils” package ကု install
လုပ်ြလ
ု ော့ ုအပ်ပါ ယ်။
#yum –y install nfs-utils

Accessing the NFS Share


NFS Server မ export လုပ်ထ ်းတသ NFS directory ကု access လုပ် ေ် “mount”
command ကုအသ်းု ဖပြု မ ဖြစ်ပါ ယ်။
#mount –t nfs –o rw 192.168.199.224:/nfsdir /opt

ဒတေ မ စ်ြက် server ော့ address 192.168.199.224 မ share ထ ်းတသ “nfsdir” ကု nfs
ip
client စက်ထရ “opt” directory ထသု Mount
ော့ လက
ု ်ဖခင််းဖြစ်ပါ ယ်။ NFS share ကု permanent
ထ ်းချင် င်တ ော့ /etc/fstab မ တ ်းထ ်းနင
ု ပ
် ါ ယ်။

Permission Error
ပုမ ဖပထ ်းသညော့အ
် ုင်း် client သည် /opt directory ထမ file စ်ခု ည်တ က်ချေ်
Server ြက်ဖခမ််း “/etc/exports” ထမ “rw” access တပ်းထ ်းတသ ်လည််း “permission denied”
ဖြစ်တေသည်ကုတ ွေျို့ ပါ ယ်။ issue client ကတေ access လုပ် အ
ော့ ခါ root account ေ ော့ ုက်ရု က်
access လုပ် ဖြစ်တသ တ က င ော့် default အ ်းဖြင ော့် root ဖြင ော့် ုလျှင ် permission denied ဖြစ်ပပ်း
access တပ်းချင်ပါက client option မ (rw,no_root_squash) ုပပ်း သ ်မ ် မ ဖြစ်ပါ ယ်။
ထမ
ု သ root အတေေ Read/Write
ော့ access မ ဖြစ်ပါ ယ်။ Security အ တ ော့ recommend
မတပ်းထ ်းပါ ်းူ
AutoFS in NFS
AutoFS Server

အခုရယ်ချင် ော့ အတ က င််းအ တလ်းကတ ော့ NFS အ


ော့ က်ဖြစ် ော့ Autofs server အတ က င််းတလ်း
ဖြစ်ပါ ယ်။ RHCE subject ထကတ ော့ မဟု ်တပမယော့် NFS ေ ော့ က်စပ်ပပ်း သထ ်းသင ော့် ော့ topic
တလ်း စ်ခုဖြစ်လု မသ
ော့ ်းု ဖြစ် င်တ င် ဗဟုသု အတေေ သ
ော့ ထ ်းသင ော့် ယ်လု ထင်
ော့ ပါ ယ်။
ဝေ်ခ င် ကယ
ု ် ုငလ
် ည််း ဒစ ကု တ ်းခုင်း် တ မ
ော့ တလော့လ ဖြစ် မု က
ော့ ုယ်အ
ော့ ွေက်လည််း အမျ ်းကက်း
အကျြု်းရခော့ပါ ယ်။
Autofs ု automounter utility စ်ခုဖြစ်ပပ်းတ ော့ users programs တ ွေကတေ access လုပ်ြု ော့
NFS mount point တပေါ်မ a file or directory စ်ခု request လုြုပ် အ
ော့ ချေ်မ automatically mount
လုပ်တပ်းလုက် ော့ facility စ်ခုဖြစ်ပါ ယ်။

Autofs က ု င် လုအပ်ချက်အ automatically mount လုပ်တပ်းသလု ကကြုပပ်း သ ်မ ်ထ ်း ော့


အချေ် စ်ခုအ ွေင်း် မ ပ ဖပေ်ပပ်း automatically unmount လုပ်သွေ ်းမ ဖြစ်ပါ ယ်။

/etc/fstab ထမ mount လုပ် ေ autofs


ော့ ကွေ
ော့ ဖခ ်းချက်က လ ုတ ော့ autofs က boot
ဖပေ် က် ော့ အချေ် င
ု ်း် မ ပ mount ဖပေ်လုပ်တေ မဟု ်ပါ ်းူ ။ /etc/fstab ထမ ဝင်တ ်းပပ်း auto
mount လုပ်ထ ်း ဟ ု င် boot က် င
ု ်း် မ ဖပေ်စစ် တေမ ဖြစ်လု အတ
ော့ က င််း စ်ခုခုတ က င ော့်
mount point ဟ access လုပ်လမ
ု ော့ ော့ အတဖခအတေမျြု်း ဖြစ်ခော့ င် system startup မ လည််း delay
ဖြစ်တစနင
ု ပ
် ါ ယ်။

Advantages of AutoFS
• AutoFS အကျ
ော့ ြု်းတကျ်းဇူ်းတ ွေကတ ော့ user စ်တယ က်က ြင
ု တ
် ွေ folder တ ွေကု access လုပ်ြု ော့
ကကြု်းစ ်း ော့ အချေ်မ Share ထ ်း ော့ remote folder ေ ော့ file တ ွေကု သ ်မ ်ထ ်း ော့ mount point
တအ က်မ အလုတလျ က် mount လုပ်တပ်းလုက် ဖြစ်ပါ ယ်။

• System Boot က် အ
ော့ ချေ်မ mount လုပ် မဟု ် အ
ော့ ွေက် Booting time ကုလည််း
သသသ သ တလျှ ခ
ော့ ျတပ်းပါ ယ်။
• Active mount point အတ အ ွေက် တလျ ေ
ော့ ည််းသွေ ်း အ
ော့ ွေက် Network access ေ efficiency
ော့ လည််း
ု်း က်လ ပါ ယ်။

• Servers အမျ ်းကက်းကု filesystem source အတေေ ော့သ ်မ ်ထ ်းလု ော့ ော့ အ ွေက် failed mount
request တ ွေကုလည််း တလျှ ခ
ော့ ျနင
ု ပ
် ါ ယ်။

ဒတခါင််းစဉ်မ NFS Share ကုသ်းု ပပ်းတ ော့ Autofs Configuration


ယ်လုလုပ် မလည််း ု တလော့လ မ ဖြစ်ပါ ယ်။
NFS server အပုင်း် ကု ဒ တလ မ
ော့ တ ်းထ ်းပပ်းဖြစ်တေလု ော့
ဒတခါင််းစဉ်တအ က်မ ထပ်မထညော့တ
် ပ
ော့ ါ ်းူ တေ ်။
ပထမပုင်း် မ ဖပေ်တလော့လ လု ော့ ပါ ယ်။

Environment
Here are my demo nodes detail, I have both NFS server and client in RHEL 7.2 OS.
Operating System: Red Hat Enterprise Linux 7.x or CentOS 7.x
NFS Server Hostname: nfsserver.example.com
NFS Server IP Address: 10.5.7.12
Share Path: /nfsfileshare

NFS Client Hostname: nfsclient.example.com


NFS Client IP Address: 10.5.7.11
Autofs mount path: /mnt/nfsfileshare

Prerequisites
You need to have a working NFS server.

Autofs ကု nfsclient က်မ install လုပ် မ မု hostname


ော့ ေ ော့IP ကု အ င် စစ်ပါမယ်။

Required Packages Installation


Package name: autofs
လုအပ် ော့ autofs package ရမရကုအ င်စစ်ပါမယ်။
# rpm –qa | grep -i autofs
Autofs package မရ အ
ော့ ွေက် install လုပ်ပါမယ်။
Autofs master map file Configuration
/etc/auto.master file ဟ autofs master
ော့ map အတေေ အလု
ော့ ပ်လုပ်မ ဖြစ်လု သူ
ော့ ထ
ော့ မ
ဝင်ဖပင်ပါမယ်။

# vim /etc/auto.master

Shift + g ေ ြ
ော့ ုင ် တအ
ော့ က် ု်းကု သွေ ်းပပ်း mount point info ကုသွေ ်းတ ်းပါမယ်။
/mnt /etc/auto.fs --timeout=90
ပပ်း င် ြုငက
် ု ဖပေ် save ခော့ပါမယ်။
/etc/auto.nfs file ကုသွေ ်းမတ ်းခင်မ nfs server ကတေ share ထ ်း ော့ mount point ကု အ င်
စစ်ပါမယ်။
# showmount –e 10.5.7.12

ပပ်း င်တ ော့ /etc/auto.nfs file ထမ ဝင်တ ်းပါမယ်။ ဒြုငက


် မရ ော့ အ ွေက် create
လုပ်တပ်း မ ဖြစ်ပါ ယ်။
ဒတေ မ /etc/auto.nfs file ထမ တ ်း မယော့်ထက mount point က မရတသ်း ်းူ ု င် အဒ
ော့ folder
ကုအ င် create လုပ်တပ်း ပါမယ်။
Auto.master file ထမ /mnt တအ က်မ လု ညွှ
ော့ ေ်း် ခော့ အ
ော့ ွေက် nfsfileshare ု ော့ folder
ကု /mnt တအ က်မ တ က်တပ်းပါမယ်။

Nfsfileshare folder လည််းတ က်ပပ်းပပဖြစ်လု ော့ /etc/auto.nfs ထမ ဝင်တ ်းပါမယ်။

Save and exit the file.


Where,
♣ nfsfileshare is a mount point.
♣ -fstype=nfs is the file system type & ‘rw,soft,intr’ are mount options.
♣ ’10.5.7.12:/nfsfileshare’ is nfs share location.

Autofs service ကု enable လုပ်ခပော့ ပ်း start လုပ်ပါမယ်။ status ေဖပေ်


ော့ ကညော့လ
် ု ော့ ပါ ယ်။
# systemctl enable autofs.service
# systemctl start autofs.service

# systemctl status autofs –l


Autofs service start လုပ်ပပ်းဖြစ်လု mount
ော့ point တအ က်မ ရယ်ထ ်း ော့ တေ ကု ဝင်ပပ်း access
လုပ် ကညော့ပ
် ါမယ်။
# cd /mnt/nfsfileshare ; ls

# df –hT
Command ေ mount
ော့ point ကု ဖပေ် ကညော့ပ
် ါမယ်။

Debugging and Troubleshooting AutoFS


# vim /etc/sysconfig/autofs
File ထမ တအ က်မ တပ်းထ ်း အ ော့ ုင်း် ဝင်တ ်းပါမယ်။
LOGGING=”debug”
Autofs service ကု restart လုပ်ပပ်း ဖပေ် ကညော့လ
် ုက်မယ် ု င် /var/log/messages တအ က်မ
automount ေပက်
ော့ သက် ော့ detail log တ ွေကု ဖမင် ပါလမော့်မယ်။
Understanding Kerberos Authentication
အခုတဖပ မယော့် အတ က င််းအ ကတ ော့ Kerberos authentication အတ က င််းဖြစ်ပါ ယ်။
RHCE objective တ ွေထက စ်ခုအတေေလည်
ော့ ်းပါ၀င်ပါ ယ်။ Kerberos အလု
ော့ ပ်လုပ်ပုက Client ေ ော့
Server က ်း က်သယ
ွေ ်မှုကု network အတပေါ်မ password-based authentication
အတေေမဟု
ော့ ်ပ symmetric-key cryptography based authentication
ပုစဖြငအ
်ော့ လုပ်လုပ်ပါ ယ်။
စ်ေည််းအ ်းဖြင ော့် Kerberos KDC "Key Distribution Center" က Client and Server
က ်း ွေင ် authentication server အတေေလု
ော့ ပ်တ င်တပ်းပါ ယ်။ KDC မ service နစ်ခုပါရပါ ယ်
Authentication Server (AS) နင ော့် TGS (Ticket Granting Server) service ုပပ်းနစ်မျ ်း
ပါရပါ ယ်။ User က AS ကု authentication request လုပ် အ
ော့ ခါမ unique identity လတခေါ်
ု ော့ ော့
စ်ေည််းအ ်းဖြင ော့် user principle ID ေ KDC
ော့ က identify ဖပြုလုပ်ပါ ယ်။ ထတေ
ု ော့ က် လ ော့
principle id ကု ticket ဖပေ်လည်ထု ်တပ်းြအ
ု ော့ ွေက် TGS Database ထမ request လုပ်ထ ်း ော့
principle ID ကု ရမရစစ်တ ်းပပ်း ID match ဖြစ် အ
ော့ ခါမ Ticket ကု generate လုပ် encrypt
လုပ်ပပ်း user ကုဖပေ်လည် တပ်းပပါ
ု ော့ ယ်။ ထတေ
ု ော့ က်မ user က ရလ ော့ ticket ကု
Kerberos authentication အသ်းု ဖပြုထ ်း ော့ services ကု authenticate လုပ်ပပ်း အသ်းု ဖပြုပါ ယ်။

Installing Required Packages


အ င် ု်း Kerberos Server စ်ခု setup လုပ်ြု ော့ ေ်အ ွေက် လုအပ်တသ packages မျ ်းကု install
ဖပြုလုပ်မ ဖြစ်ပါ ယ်။
Configuring Kerberos Server
Packages install လုပ်ပပ်းသွေ ်းပပ ု င်တ ော့ configuration လုပ်ြု ော့ ေ်အ ွေက် အ င် ု်း
/var/kerberos တအ က်မ ရ ော့ krb5 and krb5dc directory နစ်ခုကု changes
တ ွေဖပြုလုပ် မ ဖြစ်ပါ ယ်။ အ င် ု်း krb5dc directory ထမ ရ ော့ kdc.conf file ထမ
မမသ ်မ ်ထ ်း ော့ Domain Name ကုတဖပ င််းတပ်း မ ဖြစ်ပါ ယ်။ Default ကတ ော့
EXAMPLE.COM ဖြစ်ပါ ယ်။

ထတေ
ု ော့ က် တေ က်ထပ် config file စ်ခုဖြစ် ော့ kadm5.acl file ထမ လည််း DOMAIN NAME
ကုတဖပ င််းတပ်း မ ဖြစ်ပါ ယ်။
တေ က် စ် ငအ
ော့် တေေ /etc/krb5.conf
ော့ ကုဖပင် မ ဖြစ်ပါ ယ်။ Domain Name တ ွေကု မမ ော့
kerberos domain name တဖပ င််းတပ်း မ ပါ။ kdc ေ admin_server
ော့ မ တ ော့ လက်ရ kerberos
server အတေေအသ
ော့ ်းု ဖပြုမယော့် node ော့ FQDN name အဖပညော့အ
် စုထညော့တ
် ပ်း မ ဖြစ်ပါ ယ်။ config
file တ ွေထကု ၀င်ဖပင် ော့အခါ case sensitive ရပါ ယ် အကက်းအတသ်း သ ထ ်းပပ်း ဖြညော့တ
် ပ်းပါ။
Creating a Kerberos Database
တေ က် စ် ငအ
ော့် တေေကတ
ော့ ော့ kerberos database စ်ခု ည်တ က်ဖခင််း ဖြစ်ပါ ယ်။
#kdb5_util ကုအသ်းု ဖပြုပပ်း database ည်တ က် မ ဖြစ်ပါ ယ်။

Enabling Kerberos Services


ပပ်းသွေ ်း င်တ ော့ kerberos services တ ွေကု start and enable လုပ်တပ်း ပါမယ်။

Adding Principle for admin and users


အခုတေ က် စ် ငအ
်ော့ တေေ Kerberos
ော့ authentication လုပ်ြု ော့ ေ် principle
မျ ်းကုထညော့သ
် င ွေ ်း် မ ဖြစ်ပါ ယ်။ Local admin အ ွေက် ယ် တေ က် user account
စ်ခုအ ွေက် ယ် principle ထညော့သ
် င ွေ ်း် မ ဖြစ်ပါ ယ်။ user account ကု kerberos principle
မ ည်တ က်ပပ်း င် အဖပင်မ လ #useradd command ဖြင ော့် ည်တ က်တပ်း ပါမယ်။
Adding KDC Host Principle

တေ က် စ်ခုအတေေ user
ော့ က authenticate လမ််းလုပ်ြု ော့ ေ်အ က
ွေ ် KDC host principle ကု add
တပ်း ပါမယ်။ ဒတေ မ user က စ်ဖခ ်း node eg.node02.private.com ကတေလမ််း၀င်ပပ်း
authenticate လုပ်မယ် ု င်လ စ်ဖခ ်း node ော့ FQDN name ဖြင ော့် host principle
စ်ခုတ က်တပ်း မ ဖြစ်ပါ ယ်။

Creating a Keytab file


အထက်မ create လုပ်ခော့ ော့ ဟ တ ွေအ ်းလု်းကု local copy အတေေ keytab
ော့ file စ်ခု create
လုပ်ပပ်း /etc တအ က်မ သွေ ်းသမ််းထ ်းမ ဖြစ်ပါ ယ်။
Enable Kerberos Servers at Firewall
Kerberos configuration တ ွေပပ်းပပ ု င်တ ော့ Kerberos services တ ွေအ ွေက် firewall မ allow
လုပ်တပ်း မ ဖြစ်ပါ ယ်။

Setup Kerberos Client


ဒ Article ကတေ က်ပုင်း် မ Kerberos NFS setup ပုင်း် ေ ော့ က်စပ်မ ဖြစ်ပပ်း
အခုတလ တလ ယ်ကတ ော့ NFS မပါတသ်း ssh ေ Kerberos
ော့ authentication
ဖပြုလုပ်ဖပသွေ ်းဖြစ်ပါ ယ်။

Install Required Packages


အ င် ု်း လုအပ်တသ packages မျ ်းကု client စက်တပေါ်မ installation အ င် ု်းဖပြုလုပ်ပါမယ်။
Change DOMAIN Name at /etc/krb5.conf
/etc/krb5.conf config file ထမ မမသ ်မ ်ထ ်း ော့ DOMAIN NAME
ကုတဖပ င််းတပ်း မ ဖြစ်ပါ ယ်။

Create Kerberos User account and Create keytab file


Kerberos server မ create လုပ်ခော့ ော့ same user account ကု ssh ၀င်ြု ော့ ေ် client
စက်တပေါ်မ ည်တ က်တပ်း ပါမယ်။

Change SSH Configuration for Kerberos Authentication


တေ က် စ်ခုအတေေ ssh
ော့ config file /etc/ssh/ssh_config ထမ kerberos authentication
သ်းု ြအ
ု ော့ ွေက် GSSAPIAuthentication and GSSAPIDelegateCredentials နစ်ခုကု edit
လုပ်တပ်း ပါမယ်။
Edit လုပ်ပပ်း င်တ ော့ #systemctl restart sshd ဖပြုလုပ်တပ်းပါ။
ထတေ
ု ော့ က် #authconfig command ကုသ်းု ပပ်း Kerberos authentication ကု update
ဖပြုလုပ်ပါမယ်။

Testing user1 to authenticate Kerberos via SSH


Configuration ပုင်း် တ ွေပပ်း င် အခု Kerberos server ကု authentication ဖပြုလုပ်
စမ််းသပ်မ ဖြစ်ပါ ယ်။ အ င် ု်း Kerberos server ြက်မ principle create လုပ်ထ ်း ော့ user1
account ဖြင ော့် login ၀င် ကညော့ပ
် ါ ပပ်း င် #kinit (Kerberos initialize) command ဖြင ော့် Kerberos
initialize အစဖပြုပါ password မ Kerberos server ြက်မ တပ်းခော့ ော့ password ဖြင ော့် login
၀င် မ ဖြစ်ပါ ယ်။ ပပ်း င် #klist command ဖြင ်ော့ လက်ရ login ၀င်ထ ်း ော့ user1 အ ွေက် login
session expire time တ ွေကု check လုပ်နင
ု ပ
် ါ ယ်။ ပပ်း င်တ ော့ #ssh node01.private.com ဖြင ော့်
၀င် ကညော့လ
် ျှင ် password authentication ကုအသ်းု ဖပြုဖခင််းမဟု ်ပ Kerberos based
authentication ကု အသ်းု ဖပြုပပ်း ၀င်လု ော့ နင
ု သ
် ည်ကု တ ွေျို့ မ ဖြစ်ပါ ယ်။
အခု ု င် SSH ကု Password Authentication အစ ်း Kerberos authentication ကုအသ်းု ဖပြုပပ်း
remote login ဖပြုလုပ်ဖပ ဖြစ်ပါ ယ်။ တေ က် article မပ RHCE objective ဖြစ် ော့ NFS server
Kerberos authentication အသ်းု ဖပြုပပ်း ချ ် က်ပုကုဖပတပ်းပါမယ်။
NFS with Kerberos Authentication
on March 13, 2019 in Linux with 3 comments
အခု article ကတ ော့ NFS server ကု Kerberos authentication ဖြင ်ော့
ချ ် က်အသ်းု ဖပြုဖပမ ဖြစ်ပါ ယ်။ အ င် ု်း ကုယ်ော့ မ NFS Server ေ Kerberos
ော့ Server setup
လုပ်ထ ်းြလ
ု ော့ ုပါ ယ်။
Lab Setup
-----------
node01.private.com = Kerberos Server
node02.private.com = NFS Client
node03.private.com = NFS Server

Install Required Packages on NFS Server


အ င် ု်း Kerberos authentication အ ွေက်လုအပ် ော့ packages တ ွေကု nfs Server မ
installation ဖပြုလုပ်ပါမယ်။

Edit /etc/krb5.conf
ထတေ
ု ော့ က် /etc/krb5.conf မ Kerberos server DOMAIN
ော့ NAME ကုသွေ ်းဖပင်တပ်း ပါမယ်။
Add nfs principle and Export keytab file
ထတေ
ု ော့ က်မ တ ော့ nfs server ကု kerberos နင ော့် authenticate လုပ်ြု ော့ ေ်အ က
ွေ ် principle add
လုပ်တပ်း ပါမယ်။ ဒတေ မ #kadmin လအသ
ု ော့ ်းု ဖပြုဖခင််းသည် Kerberos server ကု NFS server
တပေါ်ကတေ လမ််း၀င်အသ်းု ဖပြု ဖြစ်ပါ ယ်။ Kerberor server တပေါ်မ သ်းု မယ် ု င်တ ော့
#kadmin.local ုပပ်းအသ်းု ဖပြု ပါ ယ်။
Create NFS Share Dir via Exports
ထတေ
ု ော့ က်မ တ ော့ /etc/exports ထ ွေင ် nfs share directory စ်ခု ည်တ က် ဖြစ်ပပ်း
Kerberos authentication method ကုအသ်းု ဖပြုမည်ဖြစ်တသ တ က င ော့် "sec=krb5" ုပပ်း
ထညော့သ
် င ွေ ်း် မည်ဖြစ်ပါ ယ်။ ထတေ
ု ော့ က် #exportfs -avr and showmount -e ုဖြင
ော့ ော့် မမ create
လုပ်ထ ်းတသ nfs share directory ကု ကညော့န
် င ု ပ
် ါ ယ်။

Add NFS client Principle


NFS Server ြက်ဖခမ််းမ ဖပင် င်စ ရ တ ွေပပ်းသွေ ်း င်တ ော့ nfs client ြက်မ လထ်းု စအ ုင်း် ပ
principle add လုပ်တပ်း ပပ်း keytab file စ်ခု export လုပ်တပ်း မ ပါ။ ထတေ
ု ော့ က် #authconfig
ဖြင ော့် kerberos ကု update ဖပြုလုပ်တပ်း ပါမယ်။

Mount NFS Share Directory


ထတေ
ု ော့ က် nfs.client.target service ကု start လုပ်တပ်းပပ်း NFS Server မ export ထု ်တပ်းထ ်း ော့
share directory ကု mount လုပ်ပါမယ်။ mount လုပ် ွေငလ
် ည််း Kerberos ဖြင ော့်
အသ်းု ဖပြုမ ဖြစ်သညော့အ
် ွေက် "sec=krb5" ဖြင ော့် mount လုပ် ပါမယ်။

Accessing the NFS Share Directory


အတပေါ်က အ ငတ ော့် ွေပပ်းသွေ ်း င်တ ော့ kerberos user ဖြစ် ော့ user1 ဖြင ော့် login ၀င် ကညော့ပ
် ါ share
directory ထကု ၀င်ပပ်း file create and access ကု kerberos authentication
ဖြငအ
ော့် သ်းု ဖပြုနင
ု ပ် ပ်းဖြစ်ပါ ယ်။
Thank You and Enjoy Reading!!! :)
Please also Like and Follow Root Of Info Page

You might also like