프로그램 사용/nfs2010. 2. 5. 15:29
Ubuntu 9.10 Desktop Edition 에서 nfs를 사용해서 target 보드를 사용할때 발생하는 문제이다.

1. 우분투 설치시 기본으로 추가하는 계정은
    sudo user로서 admin 그룹에 추가되어 있고, gid/uid=1000 이다.
2. FC6 에서 생성되는 녀석은 gid/uid=500 부터이다.
3. FC6의 유저와 타겟을 우분투로 옮기면 nfs rootfs를 붙이고는 서버가 응답이 없다고 나온다.
IP-Config: Complete:
      device=eth0, addr=192.168.10.198, mask=255.255.255.0, gw=192.168.10.1,
     host=hmp_7109, domain=, nis-domain=(none),
     bootserver=255.255.255.255, rootserver=192.168.10.91, rootpath=
Looking up port of RPC 100003/2 on 192.168.10.91
PHY: 0:03 - Link is Up - 100/Full
Looking up port of RPC 100005/1 on 192.168.10.91
VFS: Mounted root (nfs filesystem) readonly.
Freeing unused kernel memory: 104k freed
nfs: server 192.168.10.91 not responding, still trying
4. 물론, mount -t nfs 서버:/경로 로 붙이면 붙는다.
5. 혹시나 해서 유저를 admin 그룹에 추가하고, uid를 1000번 대로 이동시켰다.(확인 필요)

이런 경우에는 우분투의 nfs-kernel-server의 기본설정이 gid를 확인하도록 해놨기 때문이다.
이러한 보안 설정은 /etc/default/nfs-kernel-server 파일에 들어 있으며, 아래의 내용이 기본으로 들어 있다.
물론 이 파일은 기본 포맷으로 /usr/share/nfs-kernel-server/conffiles/nfs-kernel-server.default 에 존재한다.

$ cat /etc/default/nfs-kernel-server
# Number of servers to start up
RPCNFSDCOUNT=8

# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0

# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information,
# see rpc.mountd(8) or http://wiki.debian.org/?SecuringNFS
RPCMOUNTDOPTS=--manage-gids

# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=

# Options for rpc.svcgssd.
RPCSVCGSSDOPTS=

아무튼, 아래 내용을 번역하기 귀찮아서.. 대충 떄려잡기만 했는데,
결과론적으로, gid를 무시하고 접속을 하도록 하는것 같다.(ACL을 무시하는 듯)

장담은 못하겠지만, FC11에서도 동일한 현상으로 NFS 접속이 되지 않았는데(uboot에서)
FC11에서도 gid를 확인하도록 하기 때문이 아닐까 생각된다.

엄밀하게는 gid를 맞추어 주면 해결이 될듯 하지만.. 일단, 작동이 되니 여기까지 하는 구차니즘.. OTL

2010/02/05 - [Linux/Ubuntu] - 우분투 nfs 서버 접속불가
2010/02/04 - [Linux/Ubuntu] - ubuntu에 NFS 서버 설치


$ man mountd

NAME
       rpc.mountd - NFS mount daemon

OPTIONS
       -g  or  --manage-gids
              Accept requests from the kernel to map user id numbers into  lists of group id numbers for use in access  control.   An
              NFS  request  will normally (except when using Kerberos or other cryptographic authentication) contains a user-id and a
              list of group-ids.  Due to a limitation in the NFS protocol, at most 16 groups ids can be listed.  If you  use  the  -g
              flag,  then  the  list  of  group ids received from the client will be replaced by a list of group ids determined by an
              appropriate lookup on the server. Note that the 'primary' group id is not affected so a newgroup command on the  client
              will still be effective.  This function requires a Linux Kernel with version at least 2.6.21.

[링크 : http://linux.die.net/man/8/rpc.mountd]

2010.02.06 추가
막상 구서버를 옮기고 나서 다시 테스트 하는데 안된다 ㄱ- 뭥미?

----
다른 연관글 확인요망
Atheros LAN 드라이버의 버그로 인해 NFS/TCP의 전송에 대한 문제가 있었다.

'프로그램 사용 > nfs' 카테고리의 다른 글

nfsstat  (0) 2010.02.07
우분투에서 nfs로 uboot 부팅이 안돼요 2  (0) 2010.02.06
우분투 nfs 서버 접속불가  (2) 2010.02.05
ubuntu에 NFS 서버 설치  (0) 2010.02.04
NFS 마운트 하기 - how mount nfs filesystem  (0) 2010.01.11
Posted by 구차니