OpenLDAP를 활용한 중앙 인증

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Centralized authentication using OpenLDAP and the translation is 66% complete.
Outdated translations are marked like this.
The information in this article is probably outdated. You can help the Gentoo community by verifying and updating this article.

이 안내서는 LDAP 기초를 소개하고 컴퓨터 그룹을 인증하는데 사용할 OpenLDAP를 어떻게 설정하는지 보여드립니다.

경고
The current state does not yield a working configuration. See Talk:Centralized_authentication_using_OpenLDAP for details. Work is in progress.

OpenLDAP 시작하기

LDAP는 무엇인까요?

LDAP는 경량형 디렉터리 접근 프로토콜을 의미합니다. X.500에 기반하며 주된 기능의 대부분을 아우르고 있지만 X.500이 가진 일부 기능에는 부족함이 있습니다. 자, 그러면 X.500은 무엇이고 왜 LDAP가 있는걸까요?

X.500은 OSI 개념의 디렉터리 서비스 모델입니다. 여기엔 이름 공간의 정의와 디렉터리 요청 및 업데이트용 프로토콜이 들어있습니다. 그러나, X.500은 대부분의 상황을 엉망으로 휘저어놓았습니다. LDAP로 오십시오. X.500처럼 디렉터리의 데이터/이름공간 모델과 프로토콜도 제공합니다. 그러나 LDAP는 TCP/IP 스택을 통해 바로 동작하도록 설계했습니다. X.500에서 군더더기를 뺀 결과물로서 LDAP를 이해하십시오.

잘 모르겠는데요. 디렉터리가 뭔가요?

디렉터리는 빈번한 요청에 드물게 업데이트를 수행하도록 설계하여 특화된 데이터베이스입니다. 일반 데이터베이스와는 달리 트랜잭션 지원 기능이나 롤백 기능이 없습니다. 디렉터리는 가용성과 신뢰성을 개선하기 위해 쉽게 복제할 수 있습니다. 디렉터리를 복제하면, 디렉터리를 동기화 한 만큼 일시적인 비일관성도 허용됩니다.

정보가 어떻게 구성되어 있죠?

모든 디렉터리 내부 정보는 계층 구조로 되어 있습니다. 게다가 디렉터리에 데이터를 입력하면 트리에 데이터를 어떻게 저장하는지 알아야 합니다. 그러면 허구속의 회사와 인터넷과 비슷한 트리를 보도록 하겠습니다:

코드 Organisational structure for GenFic, a Fictional Gentoo community
dc:         org
             |
dc:        genfic         ## (Organisation)
          /      \
ou:   People   servers    ## (Organisational Units)
      /    \     ..
uid: ..   John            ## (OU-specific data)

아스키 아트 유사 방식으로 데이터베이스에 데이터를 넣지 않았기 때문에 각 트리의 모든 노드를 반드시 정의해야 합니다. LDAP에서는 이 노드에 이름을 부여하려 작명 스킴을 사용합니다. 대부분의 LDAP 구성(OpenLDAP 포함)에서는 이미 설정한(그리고 일반적으로 승인하는) inetOrgPerson 같은 스키마와 유닉스/리눅스 머신에서 사용할 수 있도록 사용자를 정의하는 지주 사용하는 posixAccount 스키마가 있습니다. LDAP를 문제 없이 관리할 수 있게 하는 GUI 웹 기반 도구가 있음을 참고하십시오. 대략적인 목록은 Working with OpenLDAP을 보십시오.

흥미를 가진 사용자라면 OpenLDAP 관리자 안내서를 보십시오.

어디에 사용할 수 있죠?

LDAP는 다양한곳에 사용할 수 있습니다. 이 문서는 사용자 관리를 집중화하고, 단일 LDAP 위치에서 모든 사용자 계정을 관리(단일 서버에 저장한다는 의미가 아니며, LDAP에서는 고가용성과 중복성을 지원합니다)하며, 이와 마찬가지로 그 밖에 LDAP를 활용하는 곳에서 사용 목적을 달성할 수 있습니다.

  • 공개 키 인프라스트럭처
  • 공유 달력
  • 공유 주소록
  • DHCP, DNS등의 저장소
  • 시스템 수준 설정 지시문(몇가지 서버 설정 유지)
  • 집중화된 인증(PosixAccount)
  • ...

OpenLDAP 서버 설정

일반적인 문제

이 안내서에서는 genfic.org을 예로 들겠습니다. 물론 이 도메인을 독자 여러분들께 맞게 다른 도메인으로 바꿀 수 있습니다. 그러나 공식 상위 도메인(net, com, cc, be, ...)이 상위 노드에 위치했는지 확인하십시오.

USE flags for net-nds/openldap LDAP suite of application and development tools

argon2 Enable password hashing algorithm from app-crypt/argon2
autoca Automatic Certificate Authority overlay
berkdb Add support for sys-libs/db (Berkeley DB for MySQL)
cleartext Enable use of cleartext passwords
crypt Add support for encryption -- using mcrypt or gpg where applicable
cxx Build support for C++ (bindings, extra libraries, code generation, ...)
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
experimental Enable experimental backend options
gnutls Prefer net-libs/gnutls as SSL/TLS provider (ineffective with USE=-ssl)
iodbc Add support for iODBC library
ipv6 Add support for IP version 6
kerberos Add kerberos support
kinit Enable support for kerberos init
minimal Build libraries & userspace tools only. Does not install any server code
odbc Enable ODBC and SQL backend options
overlays Enable contributed OpenLDAP overlays
pbkdf2 Enable support for pbkdf2 passwords
perl Add optional support/bindings for the Perl language
samba Add support for SAMBA (Windows File and Printer sharing)
sasl Add support for the Simple Authentication and Security Layer
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
sha2 Enable support for pw-sha2 password hashes
smbkrb5passwd Enable overlay for syncing ldap, unix and lanman passwords
ssl Add support for SSL/TLS connections (Secure Socket Layer / Transport Layer Security)
static-libs Build static versions of dynamic libraries as well
syslog Enable support for syslog
systemd Enable use of systemd-specific libraries and features like socket activation or session tracking
tcpd Add support for TCP wrappers
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)

먼저 OpenLDAP를 이머지하겠습니다. syslog, -minimal (사용 안함), tcpd USE 플래그를 사용했는지 확인하십시오.

root #emerge --ask net-nds/openldap

OpenLDAP에서는 두가지 인증 매커니즘을 제공합니다:

  1. SIMPLE이라고 하는 표준 사용자-암호 (LDAP에서 "사용자" 는 "Bind DN"이라고 함) 인증 방식
  2. SASL(단순 인증 및 보안 레이어, 자세한 내용은 RFC4422 참조)에 요청하는 인증 대리 방식

OpenLDAP 에서는 SASL 방식을 기본으로 사용하지만, 이 게시글을 작성할 초기에는 암호 기반 인증만 활용했습니다. OLC 애드온 방식에 대해서는 시스템 인증에 의존하는 "외부 요소" 단순 SASL 매커니즘 활용 설명부터 시작하도록 하겠습니다.

OpenLDAP의 주 사용자는 프로그램에 하드 코딩한 rootdn(루트 식별 이름) 입니다. 기존의 유닉스 루트 사용자와는 달리, rootdn 사용자는 적당한 권한 할당이 필요합니다. rootdn 사용자는 설정 환경에서만 활용할 수 있지만 디렉터리 정의 범위에서도 사용할 수 있습니다. 이 경우 해당 사용자는 환경 설정에 넣은 암호과 트리(디렉터리 기반) 암호를 사용하여 rootdn으로 자신을 인증 할 수 있습니다.

검증 목적의(rootdn 사용자 여부와는 상관 없는) 사용자 암호는 평문 또는 해시 문자열로 저장할 수 있습니다. 다양한 해시 알고리즘을 사용할 수 있지만, 취약한 알고리즘의 사용(MD5 까지)은 권장하지 않습니다. SHA는 현재 암호화 보안 수단으로 활용하기에 충분합니다.

아래 명령을 통해, 주어진 암호에 대한 해시값을 만듭니다. 이 명령의 결과는 slapd.conf 설정 파일에서 사용하거나 사용자 내부 디렉터리 정의 용도로 사용할 수 있습니다:

root #slappasswd
New password: my-password
Re-enter new password: my-password
{SSHA}EzP6I82DZRnW+ou6lyiXHGxSpSOw2XO4

기존 설정 (flat config slapd.conf)

경고
Do not use this anymore in 2021. It is also not the foundation to be transformed to LDIF with OpenLDAP tools. It will not be translated correctly.

/etc/openldap/slapd.conf에 있는 LDAP 서버 설정을 편집하십시오. 제공된 slapd.conf는 원본 OpenLDAP 소스 코드에 들어있는 파일입니다. 아래 예제 설정 파일은 처음 시작할 때 대체할 내용으로 사용할 수 있습니다.

파일 /etc/openldap/slapd.conf
include	/etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include	/etc/openldap/schema/misc.schema
 
pidfile  /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
 
## ## ServerID used in case of replication
serverID 0 
loglevel 0
 
## ## Certificate/SSL Section
TLSCipherSuite normal
TLSCACertificateFile /etc/openldap/ssl/ldap.crt
TLSCertificateFile /etc/openldap/ssl/ldap.pem
TLSCertificateKeyFile /etc/openldap/ssl/ldap.key
TLSVerifyClient never
 
## ## Access Controls
access to dn.base="" by * read
access to dn.base="cn=Subschema" by * read
access to *
  by self write
  by users read
  by anonymous read
 
## ## Database definition
database mdb
suffix "dc=genfic,dc=org"
checkpoint 32 30
maxsize 10485760
#Note: It is important to set this to as large a value as possible,
#(relative to anticipated growth of the actual data over time)
#since growing the size later may not be practical when the system is under heavy load.
 
rootdn "cn=Manager,dc=genfic,dc=org"
## ## rootpwd generated earlier via slappasswd command
rootpw "{SSHA}EzP6I82DZRnW+ou6lyiXHGxSpSOw2XO4" 
directory "/var/lib/openldap-data"
index objectClass eq
 
## ## Synchronisation (pull from other LDAP server)
syncrepl rid=001
  provider=ldap://ldap2.genfic.org
  type=refreshAndPersist
  retry="5 5 300 +"
  searchbase="dc=genfic,dc=org"
  attrs="*,+"
  bindmethod="simple"
  binddn="cn=ldapreader,dc=genfic,dc=org"
  credentials="ldapsyncpass"
 
index entryCSN eq
index entryUUID eq
 
mirrormode TRUE
 
overlay syncprov
syncprov-checkpoint 100 10
참고
2차 노드에서는 "rid" 값과 제공자의 ldapuri 의 적절한 주소 값이 달라야 함을 잊지 마십시오.

더 자세하게 설정 파일을 분석하려면, man 5 slapd.conf 맨 페이지 정독으로도 충분하겠지만, 업스트림 프로젝트 문서 페이지에서 찾아볼 수 있는 OpenLDAP 관리자 안내서를 보며 진행하시는게 좋습니다.

시작하지 않는다면, 설정 파일을 확인해보시는게 가장 우선입니다:

user $slaptest -v -d 1 -f /etc/openldap/slapd.conf

더 많은 내용을 확인하려면 디버그 레벨("-d 1" 이상)을 바꿔보십시오. 모든 동작이 잘 된다면 "config file testing succeedded"가 보입니다. 오류가 있다면, slaptest에서 (slapd.conf 파일에서) 오류가 난 부분의 줄 번호를 표시합니다

기본 적으로 slapd는 "local4" syslog에 로그 이벤트를 기록합니다.

경고
참고로 2.4.23부터는, OpenLDAP의 기본 설정 방식이 기존 slapd.conf 플랫 설정 파일에서 OLC(OnLineConfiguration, cn=config 구조로 알려짐) 방식으로 바뀌었습니다. OLC를 사용하면 설정을 업데이트한 후 동적 백엔드(cn=config)에서 서버를 재시작할 필요가 없는 장점이 있습니다. 기존의 사용자는 slaptest 명령 실행시 -f-F 두 옵션을 사용하는 새 설정 방식으로 옮겨갈 수 있습니다. 기존의 OLC는 /etc/openldap/slapd.d 디렉터리의 ldif 백엔드(사용자가 알아볼 수 있는 장점이 있음) 에 저장했습니다. 젠투에서는 아직 설정을 변환할 필요가 없지만 현재 문서로 정리한 방법은 나중에 제거합니다.

slapd.conf 에서 OLC로 설정 이전

경고
The following section is totally unusable and will be improved soon. Instead follow any decent basic LDIF based setup guide tosetup the objectClass: olcGlobal setup objectClass: moduleList, back_mdb.so or back_bdb.la, depending on USE setup objectClass: olcSchemaConfig, nis.ldif and such database config for tree, incl. reader role, denying anonymous reads and so on create a base DN/ objectclass=organization, without it tools like phpldapadmin will not work at all setup organizational units to group objectClass further, sane substructure with Person, Group import relevant Gentoo groups, e.g. wheel, audio, usb, desktop users with these will be rather limited use a tool, even only temporarily, to create one or two more users

OpenLDAP 서버 설정을 바꿀 수 있게 하려면 최소한 cn=configwrite (또는 일반 manage) 접근 권한을 정의해야 합니다.

아래 예시에서는 slapd.conf 파일 마지막에 적당한 줄을 추가하여 시스템 관리자(루트 사용자)에게 OLC("cn=config" 데이터베이스) 접근 권한을 부여하는 방법을 보여줍니다:

파일 /etc/openldap/slapd.confcn=config 에 루트 리눅스 계정 관리 권한 부여
database config
access to *
        by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage
        by * none

그런 다음, slaptest 유틸리티를 -f-F 옵션을 붙여 slapd.conf 파일을 설정 디렉터리(slapd.d)로 변환하도록 실행합니다.

root #mkdir /etc/openldap/slapd.d
root #slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
root #chown -R ldap /etc/openldap/slapd.d

이 명령을 실행하면 설정을 보내고 변환합니다. 이 과정이 끝나면 각각 마련된 ldif 파일을 사용하여 설정을 업데이트함니다. 그리고 이 방식에 충분히 익숙하지 않다면, 우선 slapd.conf를 편집하고, 그 다음에 slapd.conf 파일을 slapd.d/ 형식에 맞춰 재작성할 수 있습니다. 디렉터리 권한 확인을 잊지 마십시오.

더 많은 내용은 만들어진 파일의 자체 주석을 참고하십시오.

아래 줄은 slapd.d/ 설정 방식을 활성화합니다.

파일 /etc/conf.d/slapd
OPTS="-F /etc/openldap/slapd.d -h 'ldaps:// ldap:// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock'"

마지막으로, /var/lib/openldap-data 구조를 만드십시오:

root #mkdir -p /var/lib/openldap-data
root #chown -R ldap:ldap /var/lib/openldap-data
root #chmod -R 0700 /var/lib/openldap-data

OLC 초기 설정

An initial configuration is shipped as a standard LDAP database dump, available as slapd.ldif or config.ldif.

경고
To include additional schemas, flat schema files should be converted into ldif format. Custom scheme must also be converted into ldif format. See openldap.ldif for more detailed description.
경고
The upstream provided file is currently not modified by Gentoo installation process. You will probably need to modify it. This will be the case if you get an error message such as str2ad(olcDbIndex): attribute type undefined, probably coming from the fact that the backend module is not loaded, or if slapd refuses to start due to pid file.
파일 /etc/openldap/slapd.ldifUpdating run files directory
olcArgsFile: /run/openldap/slapd.args
olcPidFile: /run/openldap/slapd.pid
파일 /etc/openldap/slapd.ldifLoading appropriate module
dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
olcModulepath: /usr/lib64/openldap/openldap
olcModuleload: back_mdb.so

This initial configuration can be loaded (and only loaded, unlike ordinary LDAP databases) by the slapadd utility:

root #slapadd -d -1 -F /etc/openldap/slapd.d -n 0 -l /etc/openldap/config.ldif

When using a root account, be sure to correct ownership of the files created by root, as described below in migrate section.

경고
The default configuration does not provide permissions to change the server's configuration to anybody.

For the right to change the configuration database, proper permissions must be provided. The next example shows how these privileges are granted to the root system user:

파일 config-access.ldif
# {0}config, config
dn: olcDatabase={0}config,cn=config
objectClass: olcDatabaseConfig
olcDatabase: {0}config
olcAccess: {0}to *  by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage  by * none
olcAddContentAcl: TRUE
olcLastMod: TRUE
olcMaxDerefDepth: 15
olcReadOnly: FALSE
olcRootDN: cn=config
olcSyncUseSubentry: FALSE
olcMonitoring: FALSE

See man 5 slapd-config for more details.

경고
This database configuration must be added between dn: olcDatabase=frontend,cn=config and dn: olcDatabase=mdb,cn=config, because each part requires the previous to exist and creates a default one if not.

When using OLC, never manually edit the configuration files. The directory files can be used to check the consistency of the configuration through:

root #slaptest -v -d 1 -F /etc/openldap/slapd.d

디렉터리 관리

slapd를 시작하십시오:

root #/etc/init.d/slapd start

Most users will also want the OpenLDAP daemon to start automatically:

root #rc-update add slapd

아파치/proftpd/qmail/삼바에서 사용자를 인증할 때 디렉터리를 사용하여 시작할 수 있습니다. 쉬운 관리 인터페이스를 제공하는 LAM (LDAP 계정 관리자) phpldapadmin,diradm, jxplorer, lat으로 관리할 수 있습니다.

The directory server can be managed with tools such as net-nds/phpldapadmin, app-admin/diradm and net-nds/jxplorer from the Gentoo ebuild repository, or app-misc/ldapexplorertool from the poly-c overlay available through eselect repository.

OLC로 서버 관리하기

참고
One of the benefits of using OLC-style configuration is that the LDAP server does not require a restart to apply configuration changes.

OLC 방식 설정 업데이트 예제를 아래에 보여드리겠습니다.

예를 들자면, OLC 설정 디렉터리 위치를 바꾸려면(설정 파일 방식에서 설정 디렉터리 방식으로 바꾸고 난 후 필요함):

파일 fix-configs.ldif
dn: cn=config
changetype: modify
delete: olcConfigFile
dn: cn=config
changetype: modify
replace: olcConfigDir
olcConfigDir: /etc/openldap/slapd.d

OpenLDAP 인스턴스에서 사용할 로그 레벨을 바꾸려면:

파일 loglevel.ldif
dn: cn=config
changetype: modify
replace: olcLogLevel
olcLogLevel: stats stats2 sync

바뀐 내용을 적용하려면, 다음 명령을 실행하십시오:

root #ldapmodify -Y EXTERNAL -H ldapi:/// -f loglevel.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"
경고
On restart, the init script performs a check of the updated configuration. The ldapmodify command used above blocks only fatal errors. To get info about non-fatal errors using OLC:
root #slaptest -F /etc/openldap/slapd.d
58b7d4c2 olcThreads: value #0: warning, threads=64 larger than twice the default (2*16=32); YMMV.
config file testing succeeded

OpenLDAP 로깅

OpenLDAP produces numerous log events, which might not be obvious to interpret, but are necessary for debugging purposes.

As OpenLDAP by default writes the log events into the system log, it is advisable to reconfigure the system logger to direct OpenLDAP log events into a dedicated log file.

It is advisable to use the stats stats2 log level in OpenLDAP standalone server and stats stats2 sync in OpenLDAP cluster. In such case query results logs session-related information such as the following:

root #grep conn=1 /var/log/slapd.log
Mar  9 12:26:47 ldap1 slapd[95182]: conn=1 fd=14 ACCEPT from IP=192.168.100.9:55655 (IP=192.168.1.1:389)
Mar  9 12:26:47 ldap1 slapd[95182]: conn=1 op=0 BIND dn="" method=128
Mar  9 12:26:47 ldap1 slapd[95182]: conn=1 op=0 RESULT tag=97 err=0 text=
Mar  9 12:26:47 ldap1 slapd[95182]: conn=1 op=1 SRCH base="ou=People,dc=genfic,dc=org" scope=1 deref=0 filter="(&(objectClass=posixAccount)(uidNumber=1001))"
Mar  9 12:26:47 ldap1 slapd[95182]: conn=1 op=1 SRCH attr=uid userPassword uidNumber gidNumber cn homeDirectory loginShell gecos description objectClass shadowLastChange shadowMax shadowExpire
Mar  9 12:26:47 ldap1 slapd[95182]: conn=1 op=1 ENTRY dn="uid=larry,ou=People,dc=genfic,dc=org"
Mar  9 12:26:47 ldap1 slapd[95182]: conn=1 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=

서버 로그에 들어있는 일반 오류 메시지는 err=49 입니다:

파일 /var/log/slapd.log
Aug 10 12:47:27 ldap-2 slapd[32920]: conn=1004 op=0 RESULT tag=97 err=49 text=

Which means «invalid credentials» (i.e. wrong password).

그리고 err=32:

파일 /var/log/slapd.log
Aug 10 14:15:35 ldap-2 slapd[32966]: conn=1085 op=1 SEARCH RESULT tag=101 err=32 nentries=0 text=

Which means «No such object». Usually this error appears when binddn (user) has no permissions on requested object. So either try to do something wrong, or there is a mistake in the set ACLs.

접근 관리 (ACLs)

The authorizations and access control mechanism used in OpenLDAP is described in the slapd.access manual page. Its base syntax is as follows:

코드 OpenLDAP ACL 문법
access to <what> [ by <who> [ <access> ] [ <control> ] ]+

The following table shows the access levels available in OpenLDAP:

Access level Privileges Description
none 0 no access
disclose d needed for information disclosure on error
auth dx needed to authenticate (bind)
compare cdx needed to compare
search scdx needed to apply search filters
read rscdx needed to read search results
write wrscdx needed to modify/rename
manage mwrscdx needed to manage

For details about the exact privilege settings, see the manual pages and official OpenLDAP documentation.

경고
rootdn 사용자는 모든 요소를 읽고 쓸 수 있음을 기억하십시오.

설정 파일

ACLs are parsed in the order they are set in the configuration, and are applied based on the specificity (meaning that, when an ACL rule is considered, the remainder of ACL rules is no longer checked). As such, more specific definitions should go first, before more generic ones are listed. For more information, see Access Control Evaluation.

예를 들자면:

파일 /etc/openldap/slapd.conf
…
access to attrs=userPassword
         by dn="cn=ldapreader,dc=genfic,dc=org" read
         by self read
         by anonymous auth
         by * none
  
access to dn.base="cn=Subschema" by users read
access to dn.base="" by * read
…


설정 디렉터리

ACLs are parsed in the order they are set in the configuration, and are applied based on the specificity (meaning that, when an ACL rule is considered, the remainder of ACL rules is no longer checked). As such, more specific definitions should go first, before more generic ones are listed. This order, when using OLC, is handled through the olcAccess directives.

예를 들자면:

파일 add_acl.ldif
dn: olcDatabase={-1}frontend,cn=config
changetype: modify
add: olcAccess
olcAccess: {0}to dn.base="cn=subschema" by users read
olcAccess: {1}to dn.base="" by * read

The following example inserts a new ACL on top, making the existing olcAccess entries to shift by one:

파일 insert_acl.ldif
dn: olcDatabase={-1}frontend,cn=config
changetype: modify
add: olcAccess
olcAccess: {0}to attrs=userPassword
  by dn="cn=ldapreader,dc=genfic,dc=org" read
  by self read
  by anonymous auth
  by * none

ACL을 삭제하려면:

파일 delete_acl.ldif
dn: olcDatabase={-1}frontend,cn=config
changetype: modify
delete: olcAccess
olcAccess: {1}

복제

고가용성

OpenLDAP 고가용성 일반 설정 과정은 다중 LDAP 시스템에서 일어나는 상태 변경을 복제(공유)할 수 있게 합니다.

Replication within OpenLDAP is, in this guide, set up using a specific replication account ( ldapreader ) which has read rights on the primary LDAP server and which pulls in changes from the primary LDAP server to the secondary.

두번째 LDAP 서버가 첫번째 서버의 동작과 유사한 동작을 허용한 상태에서 이 설정을 복제합니다. OpenLDAP의 내부 구조에 감사해야 할 일은 LDAP 구조상 바뀐 내용이 또 있다 할지라도 중복 적용하지 않습니다.

경고
OpenLDAP 클러스터 업스트림의 일반 동작을 수행하려면 모든 노드에 동일한 버전을 사용하시는게 좋습니다.

복제 설정

복제를 설정하려면, 우선, 먼저 위에서 진행한 바와 같이 두번째 OpenLDAP 서버를 설정해야 합니다. 그러나 설정 파일에 대해서는 다음을 주의하십시오.

  • 동기화 복제 제공자다른 시스템을 가리킵니다
  • 각각의 OpenLDAP의 서버 ID는 다릅니다
참고
미러 설치는 OpenLDAP 서비스를 단일 서버 설치처럼 구성하여, 각 노드의 "serverID" 값을 같게 해야 함을 의미합니다. 인스턴스는 "rid" 값으로 식별하며, 이 값은 유일해야합니다.
동기화 계정

다음, 동기화 계정을 만드십시오. LDIF 파일(LDAP서버 에서 데이터 입력할때 사용하는 형식)을 만들고 LDAP 서버 각각에 이를 추가하겠습니다.

user $slappasswd -s myreaderpassword
 {SSHA}XvbdAv6rdskp9HgFaFL9YhGkJH3HSkiM
파일 ldapreader.ldif
dn: cn=ldapreader,dc=genfic,dc=org
userPassword: {SSHA}XvbdAv6rdskp9HgFaFL9YhGkJH3HSkiM
objectClass: organizationalRole
objectClass: simpleSecurityObject
cn: ldapreader
description: LDAP reader used for synchronization
user $ldapadd -x -W -D "cn=Manager,dc=genfic,dc=org" -f ldapreader.ldif
Password: ## enter the administrative password
syncprov 오버레이 활성

오버레이를 동적/정적으로 링크할 수 있습니다. 동적으로 빌드했다면, 모듈을 불러와야 합니다. 젠투에서는 보통 정적으로 빌드합니다. 형식을 확인하려면:

root #/usr/lib64/openldap/slapd -VVV
@(#) $OpenLDAP: slapd 2.4.44 (Feb 28 2017 10:07:46) $
	@larry:/var/tmp/portage/net-nds/openldap-2.4.44/work/openldap-2.4.44-abi_x86_64.amd64/servers/slapd

Included static overlays:
    syncprov
Included static backends:
    config
    ldif
    bdb
    hdb
syncprov 모듈 불러오기 (옵션)

syncprov 모듈을 불러오려면 다음 ldif 파일을 활용합니다:

파일 syncprov-module-load.ldif
#Load the syncprov module.
dn: cn=module{0},cn=config
changetype: modify
add: olcModuleLoad
olcModuleLoad: syncprov
데이터베이스 복제 설정

모두에게 필수 요건인 다음 단계는, 데이터베이스 복제를 설정하는 단계입니다(각 노드에 대해 수행해야 함):

파일 syncprov-add-overlay.ldif
# syncrepl Provider for primary db
dn: olcOverlay=syncprov,olcDatabase={1}mdb,cn=config
changetype: add
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: syncprov
olcSpNoPresent: TRUE
olcSpCheckpoint: 100 10
olcSpSessionlog: 100

# Add indexes for replica to the frontend db.
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcDbIndex
olcDbIndex: entryCSN eq
-
add: olcDbIndex
olcDbIndex: entryUUID eq
경고
ldif-백엔드 기능을 제대로 설명하지 않은 문서 내용 중에 파일 삭제를 허용하지 않는 부분이 있습니다. 오버레이를 추가할 수는 있지만 삭제할 수는 없습니다.
최종 설정

마지막으로, 복제 정의를 추가합니다.

노드 1번에서:

파일 add-replication-node1.ldif
dn: cn=config
changetype: modify
add: olcServerID
olcServerID: 1

dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcSyncrepl
olcSyncrepl: 
  rid=001 
  provider=ldap://ldap-2.genfic.org 
  binddn="cn=ldapreader,dc=genfic,dc=org" 
  bindmethod=simple 
  credentials="secret" 
  searchbase="dc=genfic,dc=org" 
  type=refreshAndPersist 
  timeout=0 
  network-timeout=0 
  retry="60 +"

dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcMirrorMode
olcMirrorMode: TRUE

secret은 보통 암호 문자열을 의미합니다.

노드 2번에서:

파일 add-replication-node2.ldif
add-replication-node2.ldif 
dn: cn=config
changetype: modify
add: olcServerID
olcServerID: 1

dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcSyncrepl
olcSyncrepl:
  rid=002
  provider=ldap://ldap-1.genfic.org
  binddn="cn=ldapreader,dc=genfic,dc=org"
  bindmethod=simple
  credentials="secret"
  searchbase="dc=genfic,dc=org"
  type=refreshAndPersist
  timeout=0
  network-timeout=0
  retry="60 +"

dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcMirrorMode
olcMirrorMode: TRUE

유일한 차이점은 서버의 식별 표시(ident, rid)와 제공자 uri 뿐입니다.

참고
LDAP 데이터베이스는 클러스터 노드 중 하나에서만 불러와야 하며, 다른 곳에서는 불러오면 안됩니다. 데이터베이스는 인용 정의를 추가하고 나면 자동으로 복제됩니다.

LDAP 마스터(초기에 불러온 데이터베이스의 미러 노드)를 사용하지 못한다면("slapd" 데몬이 시작하지 않거나 389/tcp 포트를 패킷 필터에서 막았을 경우), 2차 노드의 "slapd" 데몬에서는 다음 오류 메시지를 내며 시작에 실패합니다.

root #tail -f /var/log/slapd.log
May 14 15:39:29 ldap2 slapd[1749]: olcMirrorMode: value #0: <olcMirrorMode> database is not a shadow
May 14 15:39:29 ldap2 slapd[1749]: config error processing olcDatabase={1}mdb,cn=config: <olcMirrorMode> database is not a shadow
May 14 15:39:29 ldap2 slapd[1749]: slapd stopped.
May 14 15:39:29 ldap2 slapd[1749]: connections_destroy: nothing to destroy.

Almost certainly the database will not fit into default limits. So, you will need to increase ldapreader's limits. For example:

파일 add_replicator-limits.ldif
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcLimits
olcLimits: dn.exact="cn=ldapreader,dc=genfic,dc=org" time.soft=unlimited time.hard=unlimited size.soft=unlimited size.hard=unlimited
경고
Database file note: replicated database size may be significantly different with origin. In my case about 300 megabytes ldif-dump is loaded into almost 900 megabytes mdb-data file and replicated in 1.5 gigabyte mdb-data file.

성능 미세 조정

Default daemon settings significantly limits LDAP server performance.

증상

When server load fits system limit client applications fails with different kind of timeout errors.

In server log this produces error messages like following:

파일 /var/log/slapd.log
May 17 15:56:11 ldap2 slapd[13834]: fd=76 DENIED from unknown (192.168.210.101)
May 17 15:56:11 ldap2 slapd[13834]: warning: cannot open /etc/hosts.allow: Too many open files
May 17 15:56:11 ldap2 slapd[13834]: warning: cannot open /etc/hosts.deny: Too many open files
May 17 15:56:11 ldap2 slapd[13834]: fd=237 DENIED from unknown (192.168.77.130)
May 17 15:56:11 ldap2 slapd[13834]: warning: cannot open /etc/hosts.allow: Too many open files
May 17 15:56:11 ldap2 slapd[13834]: daemon: accept(8) failed errno=24 (Too many open files)

Increasing OS limits

우선, ldap 시스템 사용자 제한 값을 불러옵니다:

root #su ldap -c 'ulimit -aHS' -s '/bin/bash'
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 6981
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 6981
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

The first parameter, you need to increase, is the open files limit.

Maximum available value is described in Documentation/sysctl/fs.txt file of kernel documentation:

파일 /usr/src/linux-4.9.95-gentoo/Documentation/sysctl/fs.txt
nr_open:
This denotes the maximum number of file-handles a process can 
allocate. Default value is 1024*1024 (1048576) which should be
enough for most machines. Actual limit depends on RLIMIT_NOFILE
resource limit.


PAM system limits are stored in /etc/security/limits.conf file or, optionally, in /etc/security/limits.d/ directory. Daemons, started with sys-apps/openrc init system use these parameters (see sys-apps/openrc: start-stop-daemon should use system-services PAM stack for details), so you need just to put in the file:

파일 /etc/security/limits.conf
ldap           soft    nofile          4096
ldap           hard    nofile          8192

그리고 데몬을 다시 시작합니다.

경고
For some unknown reasons, upstart init system together with systemd by design ignores system PAM settings i.e. /etc/security/limits.conf file. Users of systemd init in Gentoo please contact me to verify the solution.

The next limitation is sysctl's net.core.somaxconn parameter.

During run time, this value can be updated via:

root #sysctl -w net.core.somaxconn=256
net.core.somaxconn = 256

After verifying new value do not forget to fix it:

파일 /etc/sysctl.conf
## For LDAP:
net.core.somaxconn = 256

그리고, 가능하다면, 프로그램 개별 매개변수 일부도 추가합니다.

OpenLDAP 클라이언트 도구 설정

LDAP 클라이언트 설정 파일을 편집하십시오. 이 파일은 ldapsearch 및 다른 ldap 명령행 도구에서 읽어들입니다.

파일 /etc/openldap/ldap.conf다음 내용 추가
BASE         dc=genfic, dc=org
URI          ldap://ldap.genfic.org:389/ ldap://ldap-1.genfic.org:389/ ldap://ldap-2.genfic.org:389/
TLS_REQCERT  allow
TIMELIMIT    2

다음 명령으로 서버 동작을 시험해볼 수 있습니다:

user $ldapsearch -x -D "cn=Manager,dc=genfic,dc=org" -W

오류가 나타났다면, 자세한 수준을 늘리기 위해 -d 255를 추가하고, 처한 문제를 해결해보십시오.

중앙 인증용 클라이언트 설정

원격 인증에 사용할 수 있는 방식과 도구는 많이 있습니다. 어떤 배포판에서는 사용하기 쉬운 자체 도구도 있습니다. 아래에는 특별한 순서는 없습니다. 로컬 사용자와 중앙 인증 계정을 통시에 합칠 수 있습니다. LDAP 서버가 루트 계정으로 여전히 로그인할 수 있는 위치에 접근할 수 없는 경우 등의 이유로 이러한 점은 중요합니다.

  • SSSD (Single Sign-on Services Daemon). 시스템에 캐싱, 오프라인 지원 기능을 제공할 수 있는 일반 프레임워크를 통해 원격 자원을 식별하고 인증하여 접근하는 기능을 제공하는 근본 기능을 수행합니다. PAM과 NSS 모듈을 제공하며, 나중에는 확장 사용자 정보에 대해 D-Bus 인터페이스를 지원할 예정입니다. 확장 사용자 데이터로 로컬 사용자를 저장하기 위해 더 나은 데이터베이스를 제공하기도 합니다.
  • LDAP 서버에 로그인하고 인증하기 위해 pam_ldap를 사용합니다. 암호는 네트워크 상에 분명한 텍스트로 전송하지 않습니다.
  • NSLCD (Name Service Look up Daemon). SSSD와 유사하지만 오래됐습니다.
  • 기존 pam_unix 모듈을 사용하는 NSS(Name Service Switch)로 네트워크로 암호 해시를 가져옵니다. 사용자가 암호를 새로 바꿀 수 있게 하려면, pam_ldap 방식과 결합합니다.

아랫 부분에 시연한 처음 두 부분은, 동작하게 하는 최소한의 필요 설정 옵션입니다.

SSSD 방식의 클라이언트 PAM 설정

경고
Untested as of 2021

더 직접적인 방식이 있습니다. 아래에 필요한 세가지 파일을 편집한 상태로 보여드리겠습니다.

파일 /etc/sssd/sssd.conf
[sssd]
config_file_version = 2
services = nss, pam
domains = genfic
debug_level = 5
  
[nss]
filter_users = root,ldap,named,avahi,haldaemon,dbus,radiusd,news,nscd
  
[domain/genfic]
id_provider = ldap
auth_provider = ldap
ldap_search_base = dc=genfic,dc=org
ldap_tls_reqcert = never
# primary and backup ldap servers below [first server and],[second server]
ldap_uri = ldap://X.X.X.X,ldap://X.X.X.X


sssd 시스템 서비스의 역할로서의 검색을 활성화 하려면 하부에 보이는대로 마지막 부분에 sss를 추가하십시오. 편집을 끝내고 나면 sssd 데몬을 시작하십시오.

파일 /etc/nsswitch.confSSSD 지원 설정을 넣은 nsswitch.conf 예제
passwd:     files sss
shadow:     files sss
group:      files sss
  
netgroup:   files sss
automount:  files sss
sudoers:    files sss

마지막 파일은 상당히 중요합니다. 편집하기 전에 추가 루트 터미널을 대체 수단으로 여십시오. #으로 끝나는 줄은 원격 인증을 활성화하려 추가했습니다. 참고로 사용자 디렉터리 만들기를 지원하는 pam_mkhomedir.so 파일을 사용합니다.

파일 /etc/pam.d/system-authpam_sss 기능 지원 활성화
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      pam_env.so
auth        sufficient    pam_unix.so nullok try_first_pass
auth        requisite     pam_succeed_if.so uid >= 500 quiet
auth        sufficient    pam_sss.so use_first_pass                                         #
auth        required      pam_deny.so
  
account     required      pam_unix.so
account     sufficient    pam_localuser.so
account     sufficient    pam_succeed_if.so uid < 500 quiet
account     [default=bad success=ok user_unknown=ignore] pam_sss.so                         #
account     required      pam_permit.so
  
password    requisite     pam_cracklib.so try_first_pass retry=3
password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok
password    sufficient    pam_sss.so use_authtok                                            #
password    required      pam_deny.so
  
session     required      pam_mkhomedir.so skel=/etc/skel/ umask=0077
session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so
session     optional      pam_sss.so                                                        #

이제 다른 머신에서 로그인하십시오.

참고
SSSD 방식으로는 LDAP 인증 뿐만 아니라 AD-인증에도 활용할 수 있습니다.

pam_ldap 모듈 방식으로 클라이언트 PAM 설정

Before starting any change to the client side authentication configuration, make sure that the LDAP server can be reached and presents the correct information. The following steps assume a user Bert Ram was created in the LDAP with login name bertram. Exchange accordingly with a user from the LDAP instance. Use the manager role with caution. But at least check with the LDAP read user role and a user that will logon to the client(s) to be configured:

# Uses the manager role, prompts for Manager's password
# if you can't use the manager role change -D to reader role
ldapsearch -x uid=bertram -H ldaps://ldap.genfic.org -b "dc=genfic,dc=org" -D cn=Manager,dc=genfic,dc=org -W
</div>

<div lang="en" dir="ltr" class="mw-content-ltr">
# Make a member query for the initgroups with the user that will login
# tests also this user's password
ldapsearch -x '({{|}}(&(objectClass=posixAccount)(uid=bertram))({{&}}(objectClass=posixGroup)(memberUid=bertram)))'  -H ldaps://ldap.genfic.org -b "dc=genfic,dc=org" -D "cn=Bert Ram,dc=genfic,dc=org" -W

먼저 LDAP 인증을 할 수 있게 PAM을 설정하겠습니다. PAM이 LDAP 인증을 지원하게 sys-auth/pam_ldap를 설치하고, (nsswitch.conf가 활용하는) 추가 정보에 대해 여러분의 시스템이 LDAP 서버에 대응할 수 있도록 sys-auth/nss_ldap를 설치하십시오.

참고
sys-auth/pam_ldap in combination with sys-auth/nss_ldap is an alternative. It requires a globally readable /etc/ldap.conf which is questionable with recent OpenLDAP setups that prohibit anonymous binds. A readable plain text password is as good as anonymous binds. Also code did not change for a long time and some links are dead. Nevertheless it still works. Also ldap.conf on cliet systems may collide with other services.
root #emerge --ask pam_ldap nss_ldap

마지막 파일은 상당히 중요합니다. 이 파일을 편집하기 전의 백업본으로 몇가지 추가 루트 터미널 창을 여십시오. #으로 끝나는 줄은 원격 인증을 활성화하려 추가했습니다.

파일 /etc/pam.d/system-auth
#%PAM-1.0
 
auth       required     pam_env.so
auth       sufficient   pam_unix.so try_first_pass likeauth nullok
auth       sufficient   pam_ldap.so use_first_pass                                                    #
auth       required     pam_deny.so
 
account    sufficient   pam_ldap.so                                                                   #
account    required     pam_unix.so
 
password   required     pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 try_first_pass retry=3
password   sufficient   pam_unix.so try_first_pass use_authtok nullok md5 shadow
password   sufficient   pam_ldap.so use_authtok use_first_pass                                        #
password   required     pam_deny.so
 
session    required     pam_limits.so
session    required     pam_unix.so
session    optional     pam_ldap.so                                                                   #
  1. anything before pam_unix left out

account required pam_unix.so

  1. ...after pam_unix again, before pam_permit.so

account sufficient pam_ldap.so minimum_uid=1000 account required pam_permit.so

  1. anything before pam_unix left out

password sufficient pam_unix.so nullok md5 shadow use_authtok

  1. ...after pam_unix again, before pam_deny.so

password sufficient pam_ldap.so minimum_uid=1000 try_first_pass password required pam_deny.so

  1. anything before pam_unix left out

session required pam_unix.so session optional pam_ldap.so minimum_uid=1000

}}

In /etc/nsswitch.conf each line for passwd, group, shadow and initgroups needs to be prepended with ldap:

파일 /etc/nsswitch.conf
# Many explanations in comments before...
</div>

<div lang="en" dir="ltr" class="mw-content-ltr">
passwd:         db files ldap
group:          db files ldap
shadow:         db files ldap
initgroups:     db [SUCCESS=continue] files ldap
gshadow:        files
</div>

<div lang="en" dir="ltr" class="mw-content-ltr">
# more statements afterwards
경고
If initgroups lacks ldap as source users logging in with LDAP credentials will have only their primary group. All other groups like wheel, audio, video and so on will be missing.

이제 읽어들이도록 /etc/ldap.conf를 바꾸십시오:

  • URI to contact LDAP server, use TLS/ ldaps:// by any means, otherwise passwords are transferred unencrypted
  • Base (general) to lookup DNs
  • Bind-DN (and secret) since anonymous binds are bad
  • Base per group, passwd and/ or shadow in case your LDAP tree deviates from defaults (as mentioned in the file's comments)
  • optional client certificates if you use mutual TLS
  • mapping for group membership to memberUid if you use primary group with additional groups expressed by membership
참고
{{{1}}}
경고
Make sure that /etc/nslcd.conf is owned by nslcd and only readable by nslcd through chmod 400.
파일 /etc/ldap.conf
#host 127.0.0.1
#base dc=padl,dc=com
 
base dc=genfic,dc=org
#rootbinddn uid=root,ou=People,dc=genfic,dc=org
bind_policy soft
bind_timelimit 2
ldap_version 3
nss_base_group ou=Group,dc=genfic,dc=org
nss_base_hosts ou=Hosts,dc=genfic,dc=org
nss_base_passwd ou=People,dc=genfic,dc=org
nss_base_shadow ou=People,dc=genfic,dc=org
pam_filter objectclass=posixAccount
pam_login_attribute uid
pam_member_attribute memberuid
pam_password exop
scope one
timelimit 2
uri ldap://ldap.genfic.org/ ldap://ldap1.genfic.org ldap://ldap2.genfic.org
  1. The user and group nslcd should run as.

uid nslcd gid nslcd

uri ldaps://ldap.genfic.org/

base dc=genfic,dc=org

  1. a plain assumption for a user with only read permission on the LDAP

binddn userid=ldapreader,dc=genfic,dc=org bindpw a plain text secret

  1. Reduce timeout from 30s to something sane otherwise login waits at least
  2. until timeout

bind_timelimit 2

  1. There are many other mappings for different schemas. Assuming you use
  2. posixAccount as schema member can be mapped to memberUid to add
  3. initgroups correctly

map group member memberUid }}

This is just a note and needs distinction between systemd and OpenRC, start nslcd:

root #/etc/init.d/nslcd start

If the daemon started successfully, change to one of the console terminals. Return to the graphical session by pressing Ctrl+Alt+F7. Switch to one of the 6 login consoles by pressing Ctrl+Alt+F1..F6. At the login prompt, try user bertram.

파일 userbase를 LDAP로 변환하기

참고
링크가 깨졌습니다. 다른 리눅스 배포판에서는 꾸러미와 패치를 제공합니다.

집중화 관리 및 일반 Linux/Unix 요소 관리를 위한 OpenLDAP 설정은 쉽지 않지만, 단일 시스템 관리 관점의 시스템을 OpenLDAP 기반 집중화 관리 시스템을 덜 까다롭게 하는 몇가지 도구와 스크립트가 인터넷에 둥둥 떠다닌다는 점은 감사해야 할 일입니다. :-P

https://www.padl.com/OSS/MigrationTools.html를 방문하셔서 스크립트를 가져오십시오. 이전 도구와 make_master.sh 스크립트가 필요합니다.

다음 도구의 압축을 해제하고 make_master.sh 스크립트를 압축을 푼 위치에 복사하십시오:

root #mktemp -d
/tmp/tmp.zchomocO3Q
root #cd /tmp/tmp.zchomocO3Q
root #tar xvzf /path/to/MigrationTools.tgz
root #mv /path/to/make_master.sh MigrationTools-47
root #cd MigrationTools-47

다음 단계에서는 시스템 정보를 OpenLDAP로 옮깁니다. LDAP 구조와 환경에 대한 정보를 제공한 후 make_master.sh 스크립트로 이 과정을 진행하십시오.

작성하는 도중에, 도구에서 다음 입력사항을 요구합니다:

입력 설명 예제
LDAP BaseDN 트리 기반 위치 (루트) dc=genfic,dc=org
Mail domain 이메일 주소에 사용하는 도메인 genfic.org
Mail host 메일 서버 인프라스트럭처의 FQDN smtp.genfic.org
LDAP Root DN LDAP 구조상 관리 계정 정보 cn=Manager,dc=genfic,dc=org
LDAP Root Password 이전 slappasswd 명령 결과와 비교한 관리 계정 암호

또한 도구에서 옮길 계정과 설정이 어떤건지 물어봅니다.

경고
pam.d/system-auth를 바꿀 필요는 없습니다

문제 해결

Emerge errors after conversion to LDAP

로컬 사용자 계정(예: /etc/passwd /etc/shadow) 또는 그룹(예: /etc/group)이 LDAP userbase 파일로 변환 후 사라졌다면, 꾸러미를 이머징하는 동안 사용자(또는 그룹) 누락 관련 오류가 나타날 수 있습니다.

"apache" 로컬 사용자 계정이 빠져 www-servers/apache 꾸러미를 이머징하는 동안 나타나는 오류는 다음과 같습니다:

Installing build system files
make[1]: Leaving directory '/var/tmp/portage/www-servers/apache-2.4.41/work/httpd-2.4.41'               [ ok ]
chown: invalid user: ?apache:apache?
* ERROR: www-servers/apache-2.4.41::gentoo failed (install phase):
*   fowners failed

이 경우 FEATURES=-network-sandbox 옵션을 적용하여 꾸러미를 이머징하면 됩니다. 이렇게 하면 잠재적 보안 결과로 이어지므로 시스템 사용자는 로컬 파일에 남아있어야 합니다.

감사문

이 안내서의 목적을 달성하기 위해 머신을 빌려준 Matt Heler에게 감사를 표합니다. 또한 리베라 채트 IRC 네트워크의 #ldap (webchat) 채널에 계시는 대단한 분들께도 감사를 드립니다.


This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Benjamin Coles, Sven Vermeulen (SwifT) , Brandon Hale, Benny Chuang, jokey,
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.