[AIX 네트워크 관리 35] NFS (4) NFS 구성 점검표, 서버·클라이언트 구성, ID 매핑, 내보내기, RPCSEC-GSS(Kerberos) 구성

핵심 정리

  • krb5, krb5i, krb5p 보안을 쓰려면 먼저 CLiC(CryptoLite in C) 커널 라이브러리를 설치합니다. NFS 데몬은 설치 때 시작되지 않으므로 wsm, smit mknfs, mknfs로 inittab에 /etc/rc.nfs를 넣습니다.
  • 서버: /etc/exports 만들기, Kerberos면 서버를 Kerberos 클라이언트로, v4면 chnfsdom으로 도메인, 필요하면 /etc/nfs/realm.map, Kerberos 인증은 chnfs -S -B(gssd)로 켭니다. 클라이언트: 빈 마운트 지점(automount면 불필요), config.krb5와 사용자 주체, 클라이언트 주체가 없으면 slim, 있으면 full 클라이언트.
  • ID 매핑은 LDAP 기반 EIM으로, chnfsim -c -a -t 종류 -h EIM서버 -e 도메인으로 구성하고 chnfsim -a -u(사용자), -r(realm과 도메인)로 데이터를 넣은 뒤 nfsrgyd를 다시 시작합니다.
  • 내보내기: smit mknfsexp나 /etc/exports 편집 뒤 exportfs -a, 임시는 exportfs -i, 취소는 smit rmnfsexp나 exportfs -u(v4 상태 때문에 실패하면 -F), 변경은 취소 → 수정 → exportfs 다시 실행.
  • RPCSEC-GSS: KDC에서 config.krb5 -S, kadmin.local로 사용자와 nfs/호스트 주체, 각 호스트에서 config.krb5 -C, 서버마다 ktadd와 nfshostkey -p … -f keytab, chnfs -S -B, chnfsdom과 realm.map. 다른 이름의 링크는 nfshostmap -a로 매핑합니다. root는 기본으로 nobody가 되며 -root=호스트로 허용합니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (두 판의 내용이 같음)
원문 Networks and communication management — 5.3판 407414쪽, 6.1판 514521쪽
파일 /etc/exports, /etc/inittab, /etc/rc.nfs, /etc/nfs/realm.map, /etc/krb5/krb5.keytab
관련 명령어 mknfs, chnfs, chnfsdom, chnfsim, exportfs, config.krb5, kadmin, kinit, nfshostkey, nfshostmap, lssrc

시스템에 NFS 소프트웨어를 설치하면 NFS를 구성할 준비가 된 것입니다. 다음 단계를 따라 NFS를 구성합니다.

다음 보안 종류를 쓰도록 NFS를 구성하기 전에 CLiC(CryptoLite in C) 커널 라이브러리를 설치해야 합니다.

  • krb5
  • krb5i
  • krb5p

각 단계는 아래에서 더 자세히 설명합니다.

  1. 네트워크의 어느 시스템이 서버이고 어느 시스템이 클라이언트인지 정합니다(한 시스템을 서버이자 클라이언트로 구성할 수 있습니다).
  2. 쓸 NFS 버전을 정합니다.
  3. RPCSEC-GSS 보안을 쓸지 정합니다. 쓴다면 RPCSEC-GSS용 네트워크 설정의 고려 사항을 봅니다.
  4. 각 시스템(클라이언트든 서버든)에서 시스템 시작 때 NFS 데몬 시작의 지시를 따릅니다.
  5. 각 NFS 서버에서 NFS 서버 구성의 지시를 따릅니다.
  6. 각 NFS 클라이언트에서 NFS 클라이언트 구성의 지시를 따릅니다.
  7. 네트워크의 개인용 컴퓨터가 (파일 시스템 마운트를 넘어) NFS 서버에 접근하게 하려면 PC-NFS의 지시에 따라 PC-NFS를 구성합니다.
  8. NFS 버전 4를 쓸 계획이면 NFS 버전 4 지원의 고려 사항을 봅니다.
영어 원문

Checklist for configuring NFS

After the NFS software is installed on your systems, you are ready to configure NFS. Follow these steps to configure NFS.

The CryptoLite in C (CLiC) kernel library must be installed before configuring NFS to use the following types of security:

  • krb5

  • krb5i

  • krb5p

Each step is described in greater detail below.

  1. Determine which systems in the network are to be servers and which are to be clients (a system can be configured as both a server and a client).

  2. Determine what version of NFS you are going to use.

  3. Decide whether you are going to use RPCSEC-GSS security. If so, refer to considerations in Setting up a network for RPCSEC-GSS.

  4. For each system (whether client or server), follow the instructions in “Start the NFS daemons at system startup.”

  5. For each NFS server, follow the instructions in “Configuring an NFS server.”

  6. For each NFS client, follow the instructions in Configuring an NFS client.

  7. If you want personal computers on your network to have access to your NFS servers (beyond being able to mount file systems), configure PC-NFS by following the instructions in PC-NFS.

  8. If NFS version 4 use is planned, refer to considerations in NFS version 4 support.

시스템 시작 때 NFS 데몬 시작

NFS 데몬은 기본으로 설치 중에 시작되지 않습니다.

설치하면 모든 파일이 시스템에 놓이지만 NFS를 활성화하는 단계는 하지 않습니다. 시스템 시작 때 NFS 데몬을 시작하려면 다음을 씁니다.

  • Web-based System Manager(wsm)
  • SMIT 빠른 경로 smit mknfs
  • mknfs 명령

이 방법들은 모두 inittab 파일에 항목을 넣어, 시스템이 다시 시작할 때마다 /etc/rc.nfs 스크립트가 실행되게 합니다. 이 스크립트는 다시 그 시스템에 필요한 모든 NFS 데몬을 시작합니다.

영어 원문

Start the NFS daemons at system startup

The NFS daemons, by default, are not started during installation.

When installed, all of the files are placed on the system, but the steps to activate NFS are not taken. You can start the NFS daemons at system startup through:

  • The Web-based System Manager, wsm

  • The SMIT fast path, smit mknfs

  • The mknfs command.

All of these methods place an entry in the inittab file so that the /etc/rc.nfs script is run each time the system restarts. This script, in turn, starts all NFS daemons required for a particular system.

NFS 서버 구성

NFS 서버를 구성하는 절차입니다.

  1. /etc/exports 파일을 만듭니다. /etc/exports 파일을 봅니다.
  2. Kerberos를 쓴다면 NFS 서버를 Kerberos 클라이언트로 설정합니다. RPCSEC-GSS용 네트워크 설정을 봅니다.
  3. NFS 버전 4를 쓴다면 chnfsdom 명령으로 NFS 버전 4 도메인을 정합니다. 자세한 내용은 Commands Reference, Volume 1의 chnfsdom 명령 설명을 봅니다. 처음에는 파일에 서버의 인터넷 도메인을 지정할 수 있습니다. 그러나 서버의 인터넷 도메인과 다른 NFS 버전 4 도메인을 정의할 수도 있습니다. 이에 관한 설명은 Commands Reference, Volume 4의 NFS 레지스트리 데몬 nfsrgyd 문서를 봅니다.
  4. Kerberos와 함께 NFS 버전 4를 쓴다면 /etc/nfs/realm.map 파일을 만들어야 할 수 있습니다. /etc/nfs/realm.map 파일을 봅니다.
  5. 서버에서 Kerberos 인증을 쓰려면 서버에서 강화 보안을 켜야 합니다. SMIT나 chnfs -S -B 명령으로 강화 보안을 켤 수 있습니다. chnfs에 관한 자세한 정보는 Commands Reference, Volume 1의 chnfs 명령 설명을 봅니다.
영어 원문

Configuring an NFS server

Use this procedure to configure an NFS server.

To configure an NFS server:

  1. Create the /etc/exports file. See /etc/exports file.

  2. If you are using Kerberos, set up the NFS server as a Kerberos client. See Setting up a network for RPCSEC-GSS.

  3. If you are using NFS version 4, establish the NFS version 4 domain using the chnfsdom command. See the chnfsdom command description in Commands Reference, Volume 1 for details. Initially, you can specify the server's internet domain in the file. It is possible, however, to define an NFS version 4 domain that is different from the server's internet domain. For clarification on this, see the documentation for the NFS registry daemon, nfsrgyd in Commands Reference, Volume 4.

  4. If you are using NFS version 4 with Kerberos, you may need to create the /etc/nfs/realm.map file. See /etc/nfs/realm.map file.

  5. If you want to use Kerberos authentication on the server, you must enable enhanced security on the server. You can enable enhanced security through using SMIT, or by using the chnfs -S -B command. For more information on chnfs, refer to the chnfs command description in Commands Reference, Volume 1.

NFS 클라이언트 구성

NFS 클라이언트를 구성하는 절차입니다.

  1. NFS 데몬 시작의 지시에 따라 NFS를 시작합니다.

  2. mkdir 명령으로 로컬 마운트 지점을 만듭니다. NFS가 마운트를 성공적으로 마치려면 NFS 마운트의 마운트 지점(자리 표시) 역할을 하는 디렉터리가 있어야 합니다. 이 디렉터리는 비어 있어야 합니다. 이 마운트 지점은 다른 디렉터리처럼 만들 수 있으며 특별한 속성은 필요 없습니다.

    참고: 한 가지 예외를 빼면, 모든 NFS 마운트의 마운트 지점은 파일 시스템을 마운트하기 전에 시스템에 있어야 합니다. automount 데몬을 쓰면 마운트 지점을 만들 필요가 없습니다. 자세한 내용은 Commands Reference, Volume 1의 automount 데몬 설명을 봅니다.

  3. Kerberos를 쓴다면 다음 단계를 따릅니다.

    1. NFS 클라이언트를 Kerberos realm에 구성합니다. config.krb5 명령으로 합니다. 구성 내용은 IBM Network Authentication Service Administrator's and User's Guide를 봅니다.

    2. Kerberos 마운트로 파일에 접근할 클라이언트의 모든 사용자에 대해 Kerberos 주체를 만듭니다. kadmin 명령으로 합니다. Kerberos 주체를 만드는 방법은 Network Authentication Service Administrator's and User's Guide를 봅니다.

    3. 클라이언트 기계 자체의 Kerberos 주체를 만드는 것은 선택입니다. 주체가 없는 클라이언트를 slim 클라이언트, 주체가 있는 클라이언트를 full 클라이언트라고 합니다. slim 클라이언트는 상태 관리에 쓰는 일부 NFS 버전 4 클라이언트-서버 컨텍스트 관리 작업을 할 때 더 약한 NFS RPC 보안을 씁니다. full 클라이언트는 구성에 따라 더 강한 Kerberos 기반 RPC 보안을 쓸 수 있습니다. slim 클라이언트 구성은 관리 부담이 적고 많은 환경에 충분할 수 있습니다. 가장 높은 수준의 보안이 필요한 배치는 full 클라이언트 구성을 고를 수 있습니다.

  4. NFS 버전 4를 쓴다면 chnfsdom 명령으로 NFS 버전 4 도메인도 정해야 합니다. 처음에는 파일에 클라이언트의 인터넷 도메인을 지정할 수 있습니다. 그러나 클라이언트의 인터넷 도메인과 다른 NFS 버전 4 도메인을 정의할 수도 있습니다. 이에 관한 설명은 NFS 레지스트리 데몬 nfsrgyd 문서를 봅니다.

  5. 클라이언트에서 Kerberos 인증을 쓰려면 클라이언트에서 강화 보안을 켜야 합니다. SMIT나 chnfs -S -B 명령으로 켤 수 있습니다. chnfs에 관한 자세한 정보는 chnfs 명령 참조 페이지를 봅니다.

  6. 미리 정의한 NFS 마운트 만들기의 지시에 따라 미리 정의한 마운트를 만들고 마운트합니다.

영어 원문

Configuring an NFS client

Use this procedure to configure an NFS client.

  1. Start NFS using the instructions in Starting the NFS daemons.

  2. Establish the local mount point using the mkdir command. For NFS to complete a mount successfully, a directory that acts as the mount point (or place holder) of an NFS mount must be present. This directory should be empty. This mount point can be created like any other directory, and no special attributes are needed.

Note: With one exception, the mount points for all NFS mounts must exist on your system before mounting a file system. If the automount daemon is used, it is not necessary to create mount points. See the automount daemon description in Commands Reference, Volume 1 for details.

  1. If using Kerberos, follow these steps: a. Configure the NFS client into a Kerberos realm. This is done with the config.krb5 command. Refer to the IBM Network Authentication Service Administrator's and User's Guide for configuration details. b. Create Kerberos principals for all users on the client who will be accessing files via Kerberos mounts. This is done with the kadmin command. Refer to the Network Authentication Service Administrator's and User's Guide for a description of how to create Kerberos principals. c. Establishing a Kerberos principal for the client machine itself is optional. A client without a principal is known as a slim client, and a client with a principal is referred to as a full client. Slim clients use weaker NFS RPC security when performing certain NFS version 4 client-to-server context management operations used for state management. A full client, dependent on configuration, can use the stronger Kerberos-based RPC security. Slim client configurations require less administrative overhead and may be sufficient for many environments. Deployments requiring the highest levels of security may choose to run full client configurations. 4. If you are using NFS version 4, you must also establish an NFS version 4 domain using the chnfsdom command. Initially, you can specify the client's internet domain in the file. It is possible, however, to define an NFS version 4 domain that is different from the client's internet domain. For clarification on this, see the documentation for the NFS registry daemon, nfsrgyd.

  2. If you want to use Kerberos authentication on the client, you must enable enhanced security on the client. You can enable enhanced security using SMIT, or by using the chnfs -S -B command. For more information on chnfs, refer to the chnfs command reference page.

  3. Establish and mount the predefined mounts by following the instructions in Establishing predefined NFS mounts.

ID 매핑

ID 매핑은 로컬 NFS 서버와 클라이언트가 외부 사용자와 그룹을 로컬 사용자와 그룹으로 변환하는 방법을 제공합니다.

AIX는 LDAP 기반인 EIM 기술로 ID 매핑을 합니다. 모든 NFS ID 매핑 데이터는 LDAP 서버에 저장됩니다.

EIM 클라이언트를 설정하려면 bos.eim.rte와 ldap.client 파일 세트가 설치되어 있어야 합니다. EIM 서버에는 ldap.server 파일 세트도 필요합니다. 알맞은 파일 세트를 설치한 뒤 /usr/sbin/chnfsim으로 EIM을 구성합니다. 최소 설정 옵션은 다음과 같습니다.

text
/usr/sbin/chnfsim -c -a -t [type] -h [EIM server] -e [LDAP/EIM domain] -f [LDAP suffix] -w [administrator password]

이렇게 하면 EIM 클라이언트와 서버 모두 ID 매핑에 특정 EIM 서버를 쓰도록 구성됩니다. 명령에 지정한 호스트 이름이 로컬 호스트 이름이면 LDAP 서버도 설정됩니다.

구성 단계가 끝나면 EIM 관리자가 LDAP 서버에 NFS ID 매핑 데이터를 채울 수 있습니다. John Doe 같은 개별 사용자나 그룹을 mapping identity라고 합니다. 그 사용자의 NFS 소유자 문자열 [email protected]을 identity mapping이라고 합니다. 이 데이터를 LDAP 서버에 넣으려면 다음 명령을 실행합니다.

text
/usr/sbin/chnfsim -a -u -i "John Doe" -n johndoe -d austin.ibm.com

mapping identity는 사용자나 그룹의 설명 이름이고, identity mapping은 name@domain 형식의 NFS 소유자 문자열입니다. realm과 도메인 매핑도 LDAP 서버에 저장합니다. Kerberos realm kerb.austin.ibm.com이 NFS 도메인 austin.ibm.com에 대응한다고 넣으려면 다음 명령을 실행합니다.

text
/usr/sbin/chnfsim -a -r kerb.austin.ibm.com -d austin.ibm.com

NFS가 EIM의 매핑 데이터를 쓰도록 구성하려면 NFS 레지스트리 데몬을 다시 시작해야 합니다. NFS 레지스트리 데몬은 시작할 때 EIM 서버를 쓸 수 있는지 확인하며, 찾으면 모든 매핑 기능이 EIM을 거치고 로컬 매핑은 더는 쓰지 않습니다.

EIM에 관한 정보는 Security의 Enterprise identity mapping을 봅니다.

영어 원문

Identity mapping

Identity mapping provides a method for the local NFS server and client to translate foreign users and groups to local users and groups.

AIX uses the EIM technology, which is based on LDAP, to perform its identity mapping. All NFS identity mapping data is stored on an LDAP server.

In order to set up an EIM client, the bos.eim.rte and ldap.client filesets must be installed. The EIM server also requires the ldap.server fileset. After the appropriate filesets are installed, the /usr/sbin/chnfsim is used to configure EIM. The minimum setup options are as follows:

text
/usr/sbin/chnfsim -c -a -t [type] -h [EIM server] -e [LDAP/EIM domain] -f [LDAP suffix] -w [administrator password]

This configures both EIM clients and servers to use a specific EIM server for identity mapping. If the host name specified in the command is the local host name, then an LDAP server will also be setup.

After the configuration step is complete, the EIM administrator can populate the LDAP server with NFS identity mapping data. An individual user or group, such as John Doe, is known as a mapping identity. The NFS owner string of that user, [email protected], is known as an identity mapping. To input the LDAP server with this data, the following command should be run:

text
/usr/sbin/chnfsim -a -u -i "John Doe" -n johndoe -d austin.ibm.com

The mapping identity is the descriptive name of the user or group, and the identity mapping is the name@domain NFS owner string. Realm to domain mappings are also stored in the LDAP server. To input that the Kerberos realm kerb.austin.ibm.com maps to the NFS domain austin.ibm.com, the following command should be run:

text
/usr/sbin/chnfsim -a -r kerb.austin.ibm.com -d austin.ibm.com

In order to configure NFS to use the mapping data in EIM, the NFS registry daemon needs to be restarted. The NFS registry daemon checks for the availability of an EIM server upon startup, and if one is found, all mapping functions will go through EIM and all local mappings will no longer be used.

For information on EIM, see Enterprise identity mapping in the Security.

NFS 파일 시스템 내보내기

Web-based System Manager의 Network 응용 프로그램이나 다음 절차 가운데 하나로 NFS 파일 시스템을 내보낼 수 있습니다.

SMIT로 내보내기

  1. lssrc -g nfs 명령을 입력해 NFS가 이미 실행 중인지 확인합니다. 출력에 nfsd와 rpc.mountd 데몬이 활성이라고 나와야 합니다. 그렇지 않으면 NFS 데몬 시작의 지시에 따라 NFS를 시작합니다.
  2. 명령행에서 다음을 입력하고 Enter를 누릅니다.
text
smit mknfsexp
  1. PATHNAME of directory to export, MODE to export directory, EXPORT directory now, system restart or both 필드에 알맞은 값을 지정합니다.
  2. 원하는 다른 선택 특성을 지정하거나, 나머지 필드를 그대로 두어 기본값을 받아들입니다.
  3. 변경을 마치면 SMIT가 /etc/exports 파일을 갱신합니다. /etc/exports 파일이 없으면 만듭니다.
  4. 내보낼 디렉터리마다 3~5단계를 되풀이합니다.

텍스트 편집기로 내보내기

  1. 좋아하는 텍스트 편집기로 /etc/exports 파일을 엽니다.
  2. 내보낼 디렉터리마다 디렉터리의 전체 경로 이름으로 항목을 만듭니다. 내보낼 각 디렉터리를 왼쪽 여백부터 적습니다. 어떤 디렉터리도 이미 내보낸 다른 디렉터리를 포함하면 안 됩니다. /etc/exports 파일 항목의 전체 구문은 Files Reference의 /etc/exports 파일을 봅니다.
  3. /etc/exports 파일을 저장하고 닫습니다.
  4. NFS가 실행 중이면 다음 명령을 입력하고 Enter를 누릅니다.
text
/usr/sbin/exportfs -a

-a 옵션은 exportfs 명령이 /etc/exports 파일의 모든 정보를 커널에 보내게 합니다. NFS가 실행 중이 아니면 NFS 데몬 시작의 지시에 따라 NFS를 시작합니다.

임시로 내보내기

/etc/exports 파일을 바꾸지 않고 NFS 파일 시스템을 임시로 내보내려면 다음 명령을 입력하고 Enter를 누릅니다.

text
exportfs -i / dirname

여기서 dirname은 내보낼 파일 시스템의 이름입니다. exportfs -i 명령은 지정한 디렉터리에 대해 /etc/exports 파일을 확인하지 않고 모든 옵션을 명령행에서 바로 받는다는 뜻입니다. AIX NFS 버전 4 지원은 관리자가 NFS 서버가 클라이언트에 보여 주는 대체 이름 공간을 만들고 제어하게 합니다. 이것은 exname 내보내기 옵션으로 합니다. 이 지원으로 서버의 로컬 파일 시스템 이름 공간의 세부 사항을 NFS 클라이언트에게서 감출 수도 있습니다. 자세한 내용은 Commands Reference, Volume 2의 exportfs 명령 설명과 Files Reference의 /etc/exports 파일 설명을 봅니다.

영어 원문

Exporting an NFS file system

You can export an NFS file system using the Web-based System Manager Network application, or you can use one of the following procedures.

  • To export an NFS file system using the SMIT:
  1. Verify that NFS is already running by typing the command lssrc -g nfs. The output should indicate that the nfsd and the rpc.mountd daemons are active. If they are not, start NFS using the instructions in Starting the NFS daemons.

  2. At a command line, type the following and press Enter:

text
smit mknfsexp
  1. Specify appropriate values in the PATHNAME of directory to export, MODE to export directory, and EXPORT directory now, system restart or both fields.

  2. Specify any other optional characteristics you want, or accept the default values by leaving the remaining fields as they are.

  3. When you have finished making your changes, SMIT updates the /etc/exports file. If the /etc/exports file does not exist, it is created.

  4. Repeat steps 3 through 5 for each directory you want to export.

  • To export an NFS file system using a text editor:
  1. Open the /etc/exports file with your favorite text editor.

  2. Create an entry for each directory to be exported using the full path name of the directory. List each directory to be exported starting in the left margin. No directory should include any other directory that is already exported. See the /etc/exports file in Files Reference for a description of the full syntax for entries in the /etc/exports file.

  3. Save and close the/etc/exports file.

  4. If NFS is running, type the following command and press Enter:

text
/usr/sbin/exportfs -a

The -a option tells the exportfs command to send all information in the /etc/exports file to the kernel. If NFS is not running, start NFS using the instructions in Starting the NFS daemons.

  • To temporarily export an NFS file system (without changing the /etc/exports file), type the following command and press Enter:
text
exportfs -i / dirname

where dirname is the name of the file system you want to export. The exportfs -i command specifies that the /etc/exports file is not to be checked for the specified directory, and all options are taken directly from the command line. The AIX NFS version 4 support allows the administrator to create and control an alternate namespace that is rendered by the NFS server to clients. This is done using the exname export option. This support can also be used to hide details of the server's local file system namespace from NFS clients. For more details, see the exportfs command description in Commands Reference, Volume 2 and the /etc/exports file description in Files Reference.

RPCSEC-GSS용 네트워크 설정

이 시나리오에서 설정하는 네트워크에는 서버 다섯 대가 있으며 RPCSEC-GSS용으로 구성합니다.

네트워크의 서버 다섯 대는 다음과 같습니다.

  • kdc.austin.ibm.com
  • alpha.austin.ibm.com
  • beta.austin.ibm.com
  • gamma.austin.ibm.com
  • zeta.austin.ibm.com

kdc.austin.ibm.com 시스템은 KDC(Key Distribution Center) 서버로 구성하고 Kerberos realm AUSTIN.IBM.COM을 만듭니다. 이 realm에서 kdc.austin.ibm.com과 zeta.austin.ibm.com을 뺀 모든 시스템이 RPCSEC-GSS로 파일 시스템을 내보내는 NFS 서버가 됩니다.

alpha.austin.ibm.com과 beta.austin.ibm.com 시스템 사이에는 추가 링크가 있으며, 그 링크로는 서로 fast_alpha.test.austin.com과 fast_beta.test.austin.ibm.com으로 보입니다. 그래서 추가 구성 단계가 필요합니다.

또 이 네트워크에는 일부 시스템에 구성된 다음 사용자가 있습니다.

  • adam
  • brian
  • charlie
  • dave
  • eric

참고: 다음 설정은 예로만 제공하며 모든 환경에 알맞지 않을 수 있습니다. 새 Kerberos realm을 설정하기 전에 Network Authentication Service의 Administrator's and User's Guide를 봅니다.

참고: Kerberos는 네트워크 전체에서 시스템 시간이 상당히 가까워야 합니다. 이 절차를 시작하기 전에 AIX timed 데몬이나 NTP 설정 같은, 네트워크 전체 시간을 자동으로 맞추는 메커니즘을 설정해야 합니다.

1. KDC 서버 설정

참고: KDC 서버는 되도록 다른 용도로 쓰지 않아야 합니다. KDC가 침해되면 모든 Kerberos 주체가 침해됩니다. 이 시나리오에서는 kdc.austin.ibm.com을 KDC 서버로 구성합니다. 다음 구성은 des3용입니다. 성능 때문에 des를 쓰려면 아래 kadmin의 addprinc 호출과 ktadd 호출에 -e des-cbc-crc:normal 인수를 더합니다. aes 암호화로 네트워크를 구성하려면 kadmin 명령의 addprinc 호출과 ktadd 호출에 -e aes256-cts:normal 인수를 더합니다.

  1. kdc.austin.ibm.com에 krb5.server.rte 파일 세트를 설치합니다.

  2. KDC 서버를 설정합니다. 이 시나리오에서는 다음 명령을 썼습니다.

text
config.krb5 -S -d austin.ibm.com -r AUSTIN.IBM.COM

이 명령을 실행하면 시스템이 Master Database 비밀번호와 관리 주체의 비밀번호를 묻습니다.

  1. KDC 서버에서 /usr/krb5/sbin/kadmin.local 명령을 실행해 각 사용자와 호스트의 주체를 만듭니다. 이 예는 해당 사용자의 UNIX 사용자 이름과 같은 Kerberos 주체를 만듭니다. NFS는 주체 이름을 사용자 이름에 대응시켜 주체에 연결된 UNIX 자격 증명을 정합니다. 주체와 사용자 이름 사이의 더 일반적인 매핑을 쓰는 방법은 ID 매핑을 봅니다. 이 네트워크에서는 다음 주체를 만들었습니다.
  • adam
  • brian
  • charlie
  • dave
  • eric
  • nfs/alpha.austin.ibm.com
  • nfs/beta.austin.ibm.com
  • nfs/gamma.austin.ibm.com

참고: 고른 사용자 주체 이름은 시스템에 구성된 사용자 레지스트리(/etc/passwd, LDAP, NIS 등)의 해당 사용자 이름과 맞아야 합니다. NFS는 주체 이름을 사용자 이름으로 써서 로컬 시스템에서 사용자와 그룹 ID를 얻습니다. 이름이 맞지 않으면 접근은 익명 접근으로 다뤄집니다.

이제 KDC가 구성되었습니다.

2. 각 NFS 시스템을 Kerberos 클라이언트로 구성

이제 config.krb5 명령으로 각 NFS 클라이언트와 서버를 Kerberos 클라이언트로 구성합니다. 방법은 KDC를 어떻게 구성했는지에 따라 다릅니다. 이 시나리오에서는 각 NFS 시스템에서 다음 명령을 실행했습니다.

text
config.krb5 -C -d austin.ibm.com -r AUSTIN.IBM.COM -c kdc.austin.ibm.com -s kdc.austin.ibm.com

이제 구성한 어느 시스템에서든 어느 사용자 주체로든 kinit할 수 있습니다. 예를 들어 사용자 adam으로 kinit하려면 다음 명령을 실행합니다.

text
/usr/krb5/bin/kinit adam

AIX 비밀번호가 아니라 adam의 Kerberos 비밀번호를 입력해야 합니다. 이 예는 kinit로 사용자를 인증합니다. 시스템 로그인 때 Kerberos 인증을 쓰도록 AIX를 구성할 수도 있습니다. 자세한 정보는 Security의 Authenticating to AIX Using Kerberos를 봅니다.

3. 각 NFS 서버에 keytab 항목 구성

이제 각 NFS 서버에 알맞은 keytab 항목을 구성합니다. 이 시나리오에서는 예로 alpha.austin.ibm.com의 keytab 항목을 구성했습니다. beta.austin.ibm.com과 gamma.austin.ibm.com에도 똑같은 과정을 씁니다.

  1. alpha.austin.ibm.com에서 kadmin 명령을 실행합니다. 그런 다음 다음 명령을 실행합니다.
text
ktadd nfs/alpha.austin.ibm.com

이렇게 하면 keytab 파일이 만들어집니다.

  1. 다음으로 nfshostkey 명령으로, 방금 만든 keytab 파일을 gssd 데몬이 쓰도록 설정합니다. 이 시나리오에서는 다음을 실행했습니다.
text
nfshostkey -p nfs/alpha.austin.ibm.com -f /etc/krb5/krb5.keytab
  1. 다음 명령을 실행해 gssd 데몬이 자동으로 시작하도록 설정합니다.
text
chnfs -S -B

각 시스템에 이 설정을 되풀이합니다.

4. NFS 레지스트리 데몬 구성

이 시점에서 NFS 서버는 동작하지만 모든 사용자가 nobody로 보입니다. 모든 서버에 모든 사용자가 같은 uid와 gid로 있게 하기를 권합니다. 없는 사용자는 내보낸 디렉터리에 nobody로만 접근합니다. 사용자 이름이 올바르게 매핑되게 하려면 NFS 레지스트리 데몬을 구성해야 합니다.

  1. chnfsdom 명령으로 도메인을 설정합니다. 이 시나리오에서는 모든 NFS 서버에서 다음 명령을 실행해 austin.ibm.com을 도메인으로 설정했습니다.
text
chnfsdom austin.ibm.com
  1. /etc/nfs/realm.map 파일을 설정합니다. 이 파일에는 realm 이름 뒤에 로컬 도메인이 오는 줄이 하나 있어야 합니다. 예 네트워크에서는 모든 NFS 서버에서 이 파일이 다음과 같아야 합니다.
text
realm.map AUSTIN.IBM.COM   austin.ibm.com

이 파일의 realm 항목은 대소문자를 구분하지 않으므로 엄밀히는 이 항목이 필요 없습니다.

  1. NFS 서버가 아닌 zeta.austin.ibm.com에서는 chnfs -S -B 명령으로 gssd 데몬을 시작합니다. Kerberos 클라이언트 작업을 하기 전에 사용자는 kinit로 올바른 자격 증명을 얻어야 합니다.

5. 다른 이름으로 보이는 링크 처리

이 시나리오에서는 alpha.austin.ibm.com과 beta.austin.ibm.com 사이에 빠른 네트워크 링크가 구성되어 있습니다. 이 링크로는 beta.austin.ibm.com이 alpha.austin.ibm.com을 fast_alpha.test.austin.ibm.com으로, alpha.austin.ibm.com이 beta.austin.ibm.com을 fast_beta.test.austin.ibm.com으로 봅니다. nfs/fast_alpha.test.austin.ibm.com과 nfs/fast_beta.test.austin.ibm.com은 올바른 주체가 아니므로 이 링크를 마운트에 쓸 수 없습니다. 이를 바로잡으려고 주체를 매핑하는 nfshostmap 명령을 씁니다.

  1. alpha.austin.ibm.com에서 다음 명령을 실행했습니다.
text
nfshostmap -a beta.austin.ibm.com fast_beta.test.austin.ibm.com

이렇게 하면 alpha.austin.ibm.com은 fast_beta.test.austin.ibm.com의 주체가 beta.austin.ibm.com의 것임을 압니다.

  1. beta에서 다음 명령을 실행했습니다.
text
nfshostmap -a alpha.austin.ibm.com fast_alpha.test.austin.ibm.com

서버에는 호스트 주체가 여럿 있을 수 있습니다. fast_alpha의 IP 주소가 10.0.0.1이고 fast_beta의 IP 주소가 10.0.0.2라고 하면, 다음 단계로 호스트 주체를 여럿 더합니다.

  1. nfs/fast_alpha.test.austin.ibm.com과 nfs/fast_beta.test.austin.ibm.com 주체를 알맞은 keytab 파일에 더합니다.

  2. alpha 서버에서 nfshostkey 명령을 다음과 같이 실행합니다.

text
nfshostkey -a -p nfs/fast_alpha.test.austin.ibm.com -i 10.0.0.1
  1. beta 서버에서 nfshostkey 명령을 다음과 같이 실행합니다.
text
nfshostkey -a -p nfs/fast_beta.test.austin.ibm.com -i 10.0.0.2
영어 원문

Setting up a network for RPCSEC-GSS

The network that is being set up in this scenario contains five servers and is configured for RPCSEC-GSS.

The five servers on the network are as follows:

  • kdc.austin.ibm.com

  • alpha.austin.ibm.com

  • beta.austin.ibm.com

  • gamma.austin.ibm.com

  • zeta.austin.ibm.com

The system kdc.austin.ibm.com will be configured as the Key Distribution Center (KDC) server, and the Kerberos realm AUSTIN.IBM.COM will be created, on which all of the systems except kdc.austin.ibm.com and zeta.austin.ibm.com will be NFS servers offering file systems exported with RPCSEC-GSS.

Systems alpha.austin.ibm.com and beta.austin.ibm.com have an additional link between them; across that link, they appear to each other as fast_alpha.test.austin.com and fast_beta.test.austin.ibm.com. For this reason, an additional configuration step will be required.

In addition, this network has the following users, which have been configured on some of the systems:

  • adam

  • brian

  • charlie

  • dave

  • eric

Note: The following setup is provided only as an example, and may not be appropriate for all environments. See the Administrator's and User's Guide for the Network Authentication Service before attempting to set up a new Kerberos realm.

Note: Kerberos requires that the system time be reasonably close throughout the network. Before beginning this procedure, you should set up a mechanism to automatically synchronize time throughout the network, such as the AIX timed daemon or an NTP setup.

  1. Set up the KDC server.

Note: The KDC server should ideally not be used for any other purpose; if the KDC is compromised, all Kerberos principals are compromised. In this scenario, kdc.austin.ibm.com will be configured as the KDC server. The following configuration is for des3. If des would be preferred for performance reasons, add the argument -e des-cbc-crc:normal to the addprinc call and the ktadd call for the kadmin below. To configure your network with aes encryption, add the -e aes256-cts:normal argument to the addprinc call and the ktadd call for the kadmin command. a. Install the krb5.server.rte fileset on kdc.austin.ibm.com. b. Set up the KDC server. In this scenario, the following command was used:

text
config.krb5 -S -d austin.ibm.com -r AUSTIN.IBM.COM

After running this command, the system will ask for a Master Database password and a password for the administrative principal. c. Create principals for each user and host by running the /usr/krb5/sbin/kadmin.local command on the KDC server. This example creates Kerberos principals that match the UNIX user name of the associated user. The principal name will be mapped to the user name by NFS to determine the UNIX credential associated with the principal. For a description of how to use more general mappings between principals and user names, see Identity mapping. For this network, we created the following principals:

  • adam

  • brian

  • charlie

  • dave

  • eric

  • nfs/alpha.austin.ibm.com

  • nfs/beta.austin.ibm.com

  • nfs/gamma.austin.ibm.com

Note: The chosen user principal names must match the corresponding user names in the system's configured user registry (/etc/passwd, LDAP, NIS, and so on). NFS uses the principal name as a user name to obtain user and group IDs on the local system. If the names do not match, the access will be treated as an anonymous access.

The KDC is now configured.

  1. Each NFS client and server will now be configured as Kerberos clients by using the config.krb5 command. How this is done will depend on how the KDC was configured. In this scenario we ran the following command on each NFS system:
text
config.krb5 -C -d austin.ibm.com -r AUSTIN.IBM.COM -c kdc.austin.ibm.com -s kdc.austin.ibm.com

It is now possible to kinit as any of the user principals on any of the configured systems . For example, to kinit as user adam, run the following command:

text
/usr/krb5/bin/kinit adam

You will need to specify adam's Kerberos, not AIX, password. This example uses kinit to authenticate the user. It is possible to configure AIX to use Kerberos authentication during system login. For more information, see Authenticating to AIX Using Kerberos in Security.

  1. Each NFS server will now be configured with the appropriate keytab entry. In this scenario, we configured the keytab entry for alpha.austin.ibm.com as an example; the exact same process will be used on beta.austin.ibm.com and gamma.austin.ibm.com. a. From alpha.austin.ibm.com, run the kadmin command. Then, run the following command:
text
ktadd nfs/alpha.austin.ibm.com

This creates a keytab file. b. Next, set up the gssd daemon to use the keytab file you just created with the nfshostkey command. In this scenario, we ran the following:

text
nfshostkey -p nfs/alpha.austin.ibm.com -f /etc/krb5/krb5.keytab
  1. Set up the gssd daemon to start up automatically by running the following command:
text
chnfs -S -B

Repeat this setup for each system.

  1. At this point, the NFS server will work, although, all users will come across as nobody. It is advisable to have all of the users exist on all servers with the same uid and gid; any users that do not exist will have access to the exported directory only as nobody. To get user names to map properly, you must configure the NFS registry daemon. a. Set up the domain using the chnfsdom command. In this scenario, the following command was run on all the NFS servers to set up austin.ibm.com as the domain:
text
chnfsdom austin.ibm.com
  1. Set up the /etc/nfs/realm.map file; this file should contain one line, with the realm name followed by the local domain. For our example network, these two files should look like this on all of the NFS servers:
text
realm.map AUSTIN.IBM.COM   austin.ibm.com

The realm entry in this file is not case-sensitive, so technically, this entry is not required. c. For zeta.austin.ibm.com, which will not be an NFS server, start up the gssd daemon using the chnfs -S -B command. Before trying any Kerberos client operations, the user must use kinit to obtain valid credentials.

  1. In this scenario, there is fast network link configure between alpha.austin.ibm.com and beta.austin.ibm.com. Across this link, beta.austin.ibm.com will see alpha.austin.ibm.com as fast_alpha.test.austin.ibm.com, and alpha.autsin.ibm.com will see beta.austin.ibm.com as fast_beta.test.austin.ibm.com. Because neither nfs/fast_alpha.test.austin.ibm.com nor nfs/fast_beta.test.austin.ibm.com are valid principals, they will be unable to use this link for mounts. To correct this, the nfshostmap command will be used, which will map principal to handle this situation. a. On alpha.austin.ibm.com, we ran the following command:
text
nfshostmap -a beta.austin.ibm.com fast_beta.test.austin.ibm.com

This tells alpha.austin.ibm.com that fast_beta.test.austin.ibm.com's principal is for beta.austin.ibm.com. b. On beta, we ran the following command:

text
nfshostmap -a alpha.austin.ibm.com fast_alpha.test.austin.ibm.com

Servers can have multiple host principals. Assuming that the IP address for fast_alpha is 10.0.0.1 and the IP address for fast_beta is 10.0.0.2, complete the following steps to add multiple host principals: a. Add the nfs/fast_alpha.test.austin.ibm.com and nfs/fast_beta.test.austin.ibm.com principals to the appropriate keytab files. b. Run the nfshostkey command on the alpha server, as follows:

text
nfshostkey -a -p nfs/fast_alpha.test.austin.ibm.com -i 10.0.0.1
  1. Run the nfshostkey command on the beta server, as follows:
text
nfshostkey -a -p nfs/fast_beta.test.austin.ibm.com -i 10.0.0.2

NFS 파일 시스템 내보내기 취소

Web-based System Manager의 Network 응용 프로그램이나 다음 절차 가운데 하나로 NFS 디렉터리의 내보내기를 취소할 수 있습니다.

SMIT로 취소

  1. 명령 프롬프트에서 다음을 입력하고 Enter를 누릅니다.
text
smit rmnfsexp
  1. PATHNAME of exported directory to be removed 필드에 알맞은 경로 이름을 입력합니다. 이제 디렉터리가 /etc/exports 파일에서 빠지고 내보내기가 취소됩니다. NFS 버전 4로 클라이언트에 내보낸 디렉터리라면 서버의 파일 상태 때문에 취소가 실패할 수 있습니다. 파일 상태란 내보낸 디렉터리의 파일을 클라이언트가 열고 있다는 뜻입니다. 그 데이터를 쓰는 응용 프로그램을 멈추도록 조치하거나, 데이터의 내보내기를 강제로 취소(exportfs -F)할 수 있으며, 강제로 취소하면 데이터를 활발히 쓰는 응용 프로그램이 실패할 수 있습니다.

텍스트 편집기로 취소

  1. 좋아하는 텍스트 편집기로 /etc/exports 파일을 엽니다.
  2. 내보내기를 취소할 디렉터리의 항목을 찾아 그 줄을 지웁니다.
  3. /etc/exports 파일을 저장하고 닫습니다.
  4. NFS가 지금 실행 중이면 다음을 입력합니다.
text
exportfs -u dirname

여기서 dirname은 방금 /etc/exports 파일에서 지운 디렉터리의 전체 경로 이름입니다. NFS V4 클라이언트의 접근 때문에 취소가 실패하면 -F 옵션을 더해 디렉터리 내보내기를 강제로 취소할 수 있습니다.

영어 원문

Unexporting an NFS file system

You can unexport an NFS directory using the Web-based System Manager Network application, or you can use one of the following procedures.

  • To unexport an NFS directory using SMIT:
  1. Type the following at a command prompt and press Enter:
text
smit rmnfsexp
  1. Enter the appropriate path name in the PATHNAME of exported directory to be removed field. The directory is now removed from the /etc/exports file and is unexported. If the directory was exported to clients using NFS version 4, the unexport may fail due to file state on the server. File state means files in the exported directories are open by a client. You can either take actions to stop applications using that data, or you can forcefully unexport (exportfs -F) the data, which may result in failures for applications that are actively using the data.
  • To unexport an NFS directory by using a text editor:
  1. Open the /etc/exports file with your favorite text editor.

  2. Find the entry for the directory you wish to unexport, and the delete that line.

  3. Save and close the /etc/exports file.

  4. If NFS is currently running, enter:

text
exportfs -u dirname

where dirname is the full path name of the directory you just deleted from the /etc/exports file. If the unexport fails due to access by NFS V4 clients, you can add a -F option to force the directory to be unexported.

내보낸 파일 시스템 바꾸기

Web-based System Manager의 Network 응용 프로그램이나 다음 절차 가운데 하나로 내보낸 NFS 파일 시스템을 바꿉니다.

SMIT로 바꾸기

  1. 파일 시스템의 내보내기를 취소하려면 다음을 입력합니다.
text
exportfs -u / dirname

여기서 dirname은 바꿀 파일 시스템의 이름입니다. 2. 다음을 입력합니다.

text
smit chnfsexp
  1. PATHNAME of exported directory 필드에 알맞은 경로 이름을 입력합니다.
  2. 원하는 것을 바꿉니다.
  3. SMIT를 빠져나옵니다.
  4. 다음을 입력해 파일 시스템을 다시 내보냅니다.
text
exportfs /dirname

여기서 dirname은 방금 바꾼 파일 시스템의 이름입니다.

텍스트 편집기로 바꾸기

  1. 파일 시스템의 내보내기를 취소하려면 다음을 입력합니다.
text
exportfs -u /dirname

여기서 dirname은 바꿀 파일 시스템의 이름입니다. 2. 좋아하는 텍스트 편집기로 /etc/exports 파일을 엽니다. 3. 원하는 것을 바꿉니다. 4. /etc/exports 파일을 저장하고 닫습니다. 5. 다음을 입력해 파일 시스템을 다시 내보냅니다.

text
exportfs /dirname

여기서 dirname은 방금 바꾼 파일 시스템의 이름입니다.

영어 원문

Changing an exported file system

Change an exported NFS file system using the Web-based System Manager Network application, or use one of the following procedures.

  • To change an exported NFS file system using SMIT:
  1. To unexport the file system, type:
text
exportfs -u / dirname

where dirname is the name of the file system you want to change.

  1. Type:
text
smit chnfsexp
  1. Enter the appropriate path name in the PATHNAME of exported directory field.

  2. Make whatever changes you want.

  3. Exit SMIT.

  4. Reexport the file system by entering:

text
exportfs /dirname

where dirname is the name of the file system you just changed.

  • To change an exported NFS file system by using a text editor:
  1. To unexport the file system, type:
text
exportfs -u /dirname

where dirname is the name of the file system you want to change.

  1. Open the /etc/exports file with your favorite text editor.

  2. Make whatever changes you want.

  3. Save and close the /etc/exports file.

  4. Reexport the file system by entering:

text
exportfs /dirname

where dirname is the name of the file system you just changed.

내보낸 파일 시스템에 대한 root 사용자 접근

파일 시스템을 내보내면 기본으로 root 사용자에게 그 파일 시스템에 대한 root 접근을 주지 않습니다.

한 호스트의 root 사용자가 NFS로 특정 파일에 접근을 요청하면, NFS는 요청자의 사용자 ID를 사용자 nobody의 사용자 ID로 대응시킵니다(nobody는 기본으로 /etc/passwd 파일에 들어 있는 사용자 이름 가운데 하나입니다). 사용자 nobody의 접근 권한은 특정 파일에서 공개(others)에 준 권한과 같습니다. 예를 들어 others에 파일 실행 권한만 있으면 사용자 nobody는 그 파일을 실행만 할 수 있습니다.

내보낸 파일 시스템에 root 사용자 접근을 허용하려면 내보낸 파일 시스템 바꾸기의 지시를 따릅니다. Web-based System Manager나 SMIT 방법을 쓰면 HOSTS allowed root access 필드에 root 접근을 줄 호스트 이름을 지정합니다. 텍스트 편집기로 파일을 고치면 파일 시스템 항목에 -root=hostname 한정자를 더합니다. 예:

text
/usr/tps -root=hermes

이것은 호스트 hermes의 root 사용자가 root 권한으로 /usr/tps 디렉터리에 접근할 수 있다고 지정합니다.

영어 원문

Root user access to an exported file system

When a file system is exported, by default, the root user is not granted root access to that exported file systems.

When a root user on one host requests access to a particular file from NFS, the user ID of the requester is mapped by NFS to the user ID of user nobody (nobody is one of the user names placed in the /etc/password file by default). The access rights of user nobody are the same as those given to the public (others) for a particular file. For example, if others only has run permission for a file, then user nobody can only run the file.

To enable root user access to an exported file system, follow the instructions in Changing an exported file system. If you use the Web-based System Manager or SMIT method, specify in the HOSTS allowed root access field the name of the host to which you want to grant root access. If you edit the file with a text editor, add the qualifier -root=hostname to the file system entry. For example,

text
/usr/tps -root=hermes

specifies that the root user on host hermes may access the /usr/tps directory with root privileges.