nfs 파일공유 rw 권한 갖는 방법
※ root권한으로 rw권한 갖기
<서버세팅>
1.root@sunny # df -k
/dev/dsk/c0t1d0s3 10328404 7742729 2482391 76% /mnt <–임시공유
2.root@sunny # vi /etc/dfs/dfstab
share -F nfs -o root=kingdom1:kingdom2 -d “test dir” /mnt
3.root@sunny # shareall
4.root@sunny # share
– /mnt root=kingdom1:kingdom2 “test dir”
5.root@sunny # vi /etc/hosts
59.150.255.144 kingdom1
59.150.255.143 kingdom2
6. root@sunny # svcs -a | grep nfs
online 11월_28 svc:/network/nfs/cbd:default
online 11월_28 svc:/network/nfs/mapid:default
online 11월_28 svc:/network/nfs/status:default
online 11월_28 svc:/network/nfs/nlockmgr:default
online 11월_28 svc:/network/nfs/client:default
online 11월_28 svc:/network/nfs/rquota:default
online 1월_09 svc:/network/nfs/server:default <–server가 온라인상태임을 확인
<클라이언트세팅>
1.root@kingdom1 # vi /etc/hosts
59.150.255.98 sunny
2.root@kingdom1 # ping sunny
sunny is alive
3.root@kingdom1 # vi /etc/vfstab
sunny:/mnt – /a nfs – yes soft,bg
4.root@kingdom1 # mount /a
또는
root@kingdom1 # mount -F nfs sunny:/mnt /a
5.root@kingdom1 # cd /a
6.root@kingdom1 # touch 1 2 3 <– 빈파일 씌여지면 성공
※ 특정 유저로 rw권한갖기
<서버세팅>
ex> oracle 유저로의 권한 (실제 사이트에서는 권한 gid/uid 확인필요)
1.root@sunny # grouadd -g 100 dba
2.root@sunny # useradd -u 102 -g 100 -d /datadisk/oracle -m -s /usr/bin/ksh oracle
3.root@sunny # df -k
/dev/dsk/c0t1d0s3 10328404 7742729 2482391 76% /mnt <–임시공유
4.root@sunny # ls -adl /mnt
drwxr-xr-x 9 root root 512 1월 10일 12:53 /mnt
5.root@sunny # chown -R oracle:dba /mnt
drwxr-xr-x 9 oracle dba 512 1월 10일 12:53 /mnt
6.root@sunny # cat /etc/passwd
oracle:x:102:100::/datadisk/oracle:/usr/bin/ksh
7.root@sunny # vi /etc/dfs/dfstab
share -F nfs -o rw=kingdom1:kingdom2 -d “test dir” /mnt
8.root@sunny # shareall
9.root@sunny # share
– /mnt rw=kingdom1:kingdom2 “test dir”
10.root@sunny # vi /etc/hosts
59.150.255.144 kingdom1
59.150.255.143 kingdom2
11. root@sunny # svcs -a | grep nfs
online 11월_28 svc:/network/nfs/cbd:default
online 11월_28 svc:/network/nfs/mapid:default
online 11월_28 svc:/network/nfs/status:default
online 11월_28 svc:/network/nfs/nlockmgr:default
online 11월_28 svc:/network/nfs/client:default
online 11월_28 svc:/network/nfs/rquota:default
online 1월_09 svc:/network/nfs/server:default <–server가 온라인상태임을 확인
<클라이언트세팅>
1.root@kingdom1 # vi /etc/hosts
59.150.255.98 sunny
2.root@kingdom1 # ping sunny
sunny is alive
3.root@kingdom1 # vi /etc/vfstab
sunny:/mnt – /a nfs – yes soft,bg
4.root@kingdom1 # mount /a
또는
root@kingdom1 # mount -F nfs sunny:/mnt /a
5.root@kingdom1 # ls -adl /a
drwxr-xr-x+ 9 oracle dba 512 1월 10일 13:12 /a
6.root@kingdom1 # cat /etc/passwd
oracle:x:102:100::/oracle/inst/oracle:/bin/ksh
7.root@kingdom1 # su – oracle <—oracle user로 switch
8. $ cd /a
9. $ touch 1 2 3 <—빈파일 1 2 3 씌여지면 성공