티스토리 뷰

NFS(Network File System)

- 네트워크를 통해 파티션을 공유한다.

- 유닉스 계열의 거의 모든 시스템에서 공유가 가능하다.

- 시스템의 리소스를 직접 제공하는 서비스이므로 보안에 주의한다.



서버 - 192.168.10.227

클라이언트 - 192.168.10.228


1. 서버/ 클라이언트에 nfs, portmap 설치되어 있는지 확인

[st01@DNS a2]$ yum list nfs*

Loaded plugins: fastestmirror

Installed Packages

nfs-utils.x86_64                     1:1.0.9-47.SUL2                   installed

nfs-utils-lib.x86_64                 1.0.8-7.2.z2.SUL2                 installed

Available Packages

nfs-utils.x86_64                     1:1.0.9-66.SUL2                   update

nfs-utils-lib.x86_64                 1.0.8-7.9.el5                     update

[st01@DNS a2]$ yum list portmap

Loaded plugins: fastestmirror

Installed Packages

portmap.x86_64                      4.0-65.2.2.1                       installed



2. 서버 /etc/exports에 설정

[st01@apache a2]$ cat /etc/exports

/home/a1 192.168.10.228(rw,no_root_squash)

/home/a2 192.168.10.228(rw,all_squash)

/home/a3 192.168.10.228(rw,no_all_squash)

/home/a4 192.168.10.228(rw,all_squash,root_squash)

/home/a5 192.168.10.228(rw,all_squash,no_root_squash)

/home/a6 192.168.10.228(rw,no_all_squash,root_squash)

/home/a7 192.168.10.228(rw,no_all_squash,no_root_squash)


3. client에만 있는 유저 생성

[root@DNS ~]# useradd -g 600 -u 602 st02


4. 마운트 - 클라이언트에서 실행(a1~a7까지)

[root@DNS a2]#  mount -t nfs 192.168.10.227:/home/a2 /home/a2



5. 클라이언트 루트 계정/클라이언트에만 있는 계정/서버 루트 계정/서버와 클라이언트 공통으로 있는 루트 계정 각각 파일 생성

/home/a2 192.168.10.228(rw,all_squash)

[st01@DNS home]$ ls -l a2
합계 0
-rw-r--r-- 1 65534 65534 0  4월  4 13:54 client_root
-rw-r--r-- 1 65534 65534 0  4월  4 14:05 client_st01
-rw-r--r-- 1 65534 65534 0  4월  4 14:04 client_st02
-rw-r--r-- 1 root  root  0  4월  4 14:09 server_root
-rw-r--r-- 1 st01  st    0  4월  4 14:10 server_st01

/home/a3 192.168.10.228(rw,no_all_squash)
[st01@DNS home]$ ls -l a3
합계 0
-rw-r--r-- 1 65534 65534 0  4월  4 14:03 client_root
-rw-r--r-- 1 st01  st    0  4월  4 14:05 client_st01
-rw-r--r-- 1 st02  st    0  4월  4 14:04 client_st02
-rw-r--r-- 1 root  root  0  4월  4 14:09 server_root
-rw-r--r-- 1 st01  st    0  4월  4 14:10 server_st01

/home/a4 192.168.10.228(rw,all_squash,root_squash)
[st01@DNS home]$ ls -l a4
합계 0
-rw-r--r-- 1 65534 65534 0  4월  4 14:03 client_root
-rw-r--r-- 1 65534 65534 0  4월  4 14:05 client_st01
-rw-r--r-- 1 65534 65534 0  4월  4 14:04 client_st02
-rw-r--r-- 1 root  root  0  4월  4 14:09 server_root
-rw-r--r-- 1 st01  st    0  4월  4 14:10 server_st01

/home/a5 192.168.10.228(rw,all_squash,no_root_squash)
[st01@DNS home]$ ls -l a5
합계 0
-rw-r--r-- 1 root  root  0  4월  3 15:00 1
-rw-r--r-- 1 65534 65534 0  4월  4 14:03 client_root
-rw-r--r-- 1 65534 65534 0  4월  4 14:05 client_st01
-rw-r--r-- 1 65534 65534 0  4월  4 14:04 client_st02
-rw-r--r-- 1 root  root  0  4월  4 14:09 server_root
-rw-r--r-- 1 st01  st    0  4월  4 14:10 server_st01

/home/a6 192.168.10.228(rw,no_all_squash,root_squash)
[st01@DNS home]$ ls -l a6
합계 0
-rw-r--r-- 1 65534 65534 0  4월  4 14:03 client_root
-rw-r--r-- 1 st01  st    0  4월  4 14:05 client_st01
-rw-r--r-- 1 st02  st    0  4월  4 14:04 client_st02
-rw-r--r-- 1 root  root  0  4월  4 14:09 server_root
-rw-r--r-- 1 st01  st    0  4월  4 14:10 server_st01

/home/a7 192.168.10.228(rw,no_all_squash,no_root_squash)
[st01@DNS home]$ ls -l a7
합계 0
-rw-r--r-- 1 root root 0  4월  4 14:03 client_root
-rw-r--r-- 1 st01 st   0  4월  4 14:05 client_st01
-rw-r--r-- 1 st02 st   0  4월  4 14:04 client_st02
-rw-r--r-- 1 root root 0  4월  4 14:09 server_root
-rw-r--r-- 1 st01 st   0  4월  4 14:10 server_st01





댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함