리눅스 호스트 계정 및 비밀번호를 LDAP으로 구성하고 ldapuser40 계정이 “password”로 설정되도록 하겠습니다. 성공적으로 인증된 경우에는 http://ip/dir/ldap.crt에서 다운로드할 수 있는 인증서로 로그인할 수 있습니다.
리눅스 호스트 계정 LDAP 구성
# yum groupinstall directory-client
# yum install authconfig-gtk sssd krb5-workstation -y
# system-config-authentication
- User Account Database: LDAP
- LDAP Search Base DN: dc=example,dc=com
- LDAP Server: ldap://instructor.example.com (도메인 형식으로 작성, IP 주소로 작성하지 않음)
- Download CA Certificate
- Authentication Method: LDAP password (커버로스 관련 내용이 없다면)
- Apply
# getent passwd ldapuser40
다음 출력을 인쇄해야 합니다.
ldapuser40:*:1001:1000::/home/ldapuser40:/bin/bash
# su - ldapuser40
CA 인증서 다운로드
http://ip/dir/ldap.crt에서 CA 인증서를 다운로드하여 /etc/openldap/certs/
디렉토리에 저장해야 합니다.
autofs 구성 (선택 사항)
사용자가 로그인할 때 홈 디렉토리를 갖도록 하려면 autofs를 구성해야 합니다. 다음 단계는 autofs를 사용자의 홈 디렉토리를 서버의 /home/ldapuser40
디렉토리에 매핑하도록 구성합니다.
echo '/home/ldapuser40 -fstype=nfs,rw localhost:/home/ldapuser40' > /etc/auto.master
sudo service autofs restart
autofs가 다시 시작되면 사용자는 로그인할 때 홈 디렉토리를 갖게 됩니다.
요약
이제 호스트 계정 및 비밀번호를 LDAP으로 구성하였고, ldapuser40 계정이 “password”로 설정되었습니다. 인증서를 통해 로그인할 수 있으며, 사용자가 로그인하면 자동으로 호스트 디렉토리가 생성되지 않습니다.