우리는 3개의 서버를 가지고 있습니다:
- NFS 서버: 1.2.3.4(rhel 6.8)
- 좋은 NFS 클라이언트: SERVER5G(rhel6.8)
- 잘못된 NFS 클라이언트: SERVER6B(rhel6.3)
SERVER6B(잘못된 nfs 클라이언트)의 문제점은 동일한 NFS 마운트의 사용자/그룹을 "nobody"로 표시한다는 것입니다.
NFSv4, RHEL 6 머신.
[root@SERVER5G ~]# ls -la /var/FOODump/
total 55205372
drwxrwxr-x 18 foouser root 4096 Jul 11 17:40 .
drwxr-xr-x. 31 root root 4096 Mar 18 12:51 ..
-rw------- 1 foouser foouser 1117958 Mar 23 10:41 bar.7z
[root@SERVER5G ~]#
[root@SERVER5G ~]# stat /var/FOODump/bar.7z
File: `/var/FOODump/bar.7z'
Size: 1117958 Blocks: 2192 IO Block: 1048576 regular file
Device: 16h/22d Inode: 16 Links: 1
Access: (0600/-rw-------) Uid: ( 2826/ foouser) Gid: ( 2826/ foouser)
Access: 2016-03-23 10:41:48.000000000 +0000
Modify: 2016-03-23 10:41:31.000000000 +0000
Change: 2016-03-23 10:41:31.000000000 +0000
[root@SERVER5G ~]#
[root@SERVER5G ~]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)
[root@SERVER5G ~]#
[root@SERVER5G ~]# id foouser
uid=2826(foouser) gid=2826(foouser) groups=2826(foouser)
[root@SERVER5G ~]#
[root@SERVER5G ~]# df -mP /var/FOODump/
Filesystem 1048576-blocks Used Available Capacity Mounted on
1.2.3.4:/var/FOODump 193524 129698 53996 71% /var/FOODump
[root@SERVER5G ~]#
[root@SERVER5G ~]# mount | grep FOODump
1.2.3.4:/var/FOODump on /var/FOODump type nfs (rw,vers=4,addr=1.2.3.4,clientaddr=1.2.3.5)
[root@SERVER5G ~]#
그리고 나쁜 클라이언트:
[root@SERVER6B ~]# ls -la /var/FOODump/
total 55205372
drwxrwxr-x 18 nobody nobody 4096 Jul 11 17:40 .
drwxr-xr-x. 31 root root 4096 Jul 6 06:40 ..
-rw------- 1 nobody nobody 1117958 Mar 23 10:41 bar.7z
[root@SERVER6B ~]#
[root@SERVER6B ~]# stat /var/FOODump/bar.7z
File: `/var/FOODump/bar.7z'
Size: 1117958 Blocks: 2192 IO Block: 1048576 regular file
Device: 18h/24d Inode: 16 Links: 1
Access: (0600/-rw-------) Uid: ( 99/ nobody) Gid: ( 99/ nobody)
Access: 2016-03-23 10:41:48.000000000 +0000
Modify: 2016-03-23 10:41:31.000000000 +0000
Change: 2016-03-23 10:41:31.000000000 +0000
[root@SERVER6B ~]#
[root@SERVER6B ~]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)
[root@SERVER6B ~]#
[root@SERVER6B ~]# id foouser
uid=2826(foouser) gid=2826(foouser) groups=2826(foouser)
[root@SERVER6B ~]#
[root@SERVER6B ~]# df -mP /var/FOODump/
Filesystem 1048576-blocks Used Available Capacity Mounted on
1.2.3.4:/var/FOODump 193524 129698 53996 71% /var/FOODump
[root@SERVER6B ~]#
[root@SERVER6B ~]# mount | grep FOODump
1.2.3.4:/var/FOODump on /var/FOODump type nfs (rw,vers=4,addr=1.2.3.4,clientaddr=1.2.3.6)
[root@SERVER6B ~]#
우리는 모든 NFS 커널 모듈을 제거하고 rmmoding하고 SERVER6B에 /var/FOODump를 마운트하려고 시도했지만 도움이 되지 않았습니다.
SERVER6B에서 "su - foouser"를 실행하면 "테스트 파일을 터치"할 수 있습니다.
- SERVER6B에는 아무도 표시되지 않습니다.
- SERVER5G에 foouser로 표시됨
질문:SERVER6B가 NFS를 통해 "nobody" 사용자를 표시하는 이유는 무엇입니까?
답변1
[root@SERVER6B ~]# umount /var/FOODump
[root@SERVER6B ~]# nfsidmap -c
[root@SERVER6B ~]# mount /var/FOODump
문제를 해결했습니다..