
열린 LDAP 서버가 있습니다.
IP : 192.168.0.70(델)
DIT :
(ldapphpadmin을 통해 확인)
패트리샤 뒤센의 경우:
dn cn=patricia duchesne,ou=users,dc=memorandum,dc=pro
cn patricia duchesne
gidnumber 501
givenname patricia
homedirectory /home/users/pduchesne
loginshell /bin/bash
objectclass inetOrgPerson | posixAccount | top
sn duchesne
uid pduchesne
uidnumber 1000
userpassword {MD5}eFI0F0...
그런 다음 LDAP 클라이언트가 있습니다.
IP : 192.168.0.60(pb)
NSSWitch가 구성되었습니다.
$cat /etc/nsswitch.conf
passwd: files ldap
group: files ldap
shadow: files ldap
gshadow: files
hosts: files mdns4_minimal [NOTFOUND=return] dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
ldap-auth도 마찬가지입니다.
$ cat /etc/auth-client-config/profile.d/ldap-auth-config
[lac_ldap]
nss_passwd=passwd: files ldap
nss_group=group: files ldap
nss_shadow=shadow: files ldap
nss_netgroup=netgroup: nis
그리고 libnss :
$ cat /etc/libnss-ldap.conf
uri ldap://192.168.0.70
base dc=memorandum,dc=pro
LDAP 사용자 정보에 접근할 수 있습니다.
$ getent passwd | tail -n 1
pduchesne:*:1000:501:patricia duchesne:/home/users/pduchesne:/bin/bash
하지만 연결할 수 없습니다.
IP에서 : 192.168.0.80
$ ssh [email protected]
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Permission denied (publickey,password).
내가 무엇을 놓치고 있나요?
나는 그 모든 것을 설정할 방법을 찾지 못한 채 수백 개의 웹페이지를 살펴보았습니다. :( https://help.ubuntu.com/community/LDAPClientAuthentication https://askubuntu.com/questions/127389/how-to-configure-ubuntu-as-an-ldap-client https://www.digitalocean.com/community/tutorials/how-to-authenticate-client-computers-using-ldap-on-an-ubuntu-12-04-vps
이 페이지 찾기:https://www.vincentliefooghe.net/content/openldap-gestion-des-logs LDAP 로그가 어디에 있는지 모른다는 것을 깨달았습니다. :-(
편집하다
다음 :https://help.ubuntu.com/community/LDAPClientAuthentication
192.168.0.60의 PAM 구성:
$ cat /usr/share/pam-configs/my_mkhomedir
Name: activate mkhomedir
Default: yes
Priority: 900
Session-Type: Additional
Session:
required pam_mkhomedir.so umask=0022 skel=/etc/skel
업데이트 :
$ sudo pam-auth-update
[sudo] password for romain:
LDAP Password:
파일
$ cat /etc/security/group.conf
완전히 댓글이 달렸습니다
나는 nscd를 사용하지 않았습니다.
$ /etc/init.d/nscd stop
[....] Stopping nscd (via systemctl): nscd.service==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'nscd.service'.
Authenticating as: romain,,, (romain)
Password:
LDAP Password:
==== AUTHENTICATION COMPLETE ===
. ok
[LDAP 호스트 액세스 권한 부여] 단락을 사용하지 않았습니다. 내가해야합니까 ?
편집 2
자세한 SSH :
romain@Mac:~$ ssh -v pduchesne@pb
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: /etc/ssh/ssh_config line 102: Applying options for *
debug1: Connecting to pb [192.168.0.60] port 22.
debug1: Connection established.
debug1: identity file /Users/romain/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/romain/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/romain/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/romain/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/romain/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/romain/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/romain/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/romain/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to pb:22 as 'pduchesne'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client [email protected] <implicit> none
debug1: kex: client->server [email protected] <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:OIiYKNK9FOdhlu2sVahXFoXYCjxmxTQ7NrZtA75Vwps
debug1: Host 'pb' is known and matches the ECDSA host key.
debug1: Found key in /Users/romain/.ssh/known_hosts:18
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/romain/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /Users/romain/.ssh/id_dsa
debug1: Trying private key: /Users/romain/.ssh/id_ecdsa
debug1: Trying private key: /Users/romain/.ssh/id_ed25519
debug1: Next authentication method: password
pduchesne@pb's password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
pduchesne@pb's password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
pduchesne@pb's password:
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
Permission denied (publickey,password).
편집 3
LDAP 서버에 사용자 비밀번호 해시 추가(시작 부분의 사용자 덤프 참조)
편집 4
@grawity 제안에 따라 libpam-ldapd를 설치했습니다.
romain@pb$ sudo apt-get install libpam-ldapd
[sudo] password for romain:
LDAP Password:
The following packages were automatically installed and are no longer required:
auth-client-config ldap-auth-config
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
libpam-ldap
The following NEW packages will be installed:
libpam-ldapd
Do you want to continue? [Y/n] Y
(...)
Setting up libpam-ldapd:amd64 (0.9.6-3) ...
그런 다음 ldap 버전3을 사용하기 위해 정확한 버전을 지정하지 않았다는 것을 알고 구성했습니다 /etc/nslcd.conf
(기본적으로 어떤 버전인지는 모르겠습니다.).
romain@pb$ sudo cat /etc/nslcd.conf | grep "^[^#]"
uid nslcd
gid nslcd
uri ldap://192.168.0.70
base dc=memorandum,dc=pro
ldap_version 3
tls_cacertfile /etc/ssl/certs/ca-certificates.crt
nslcd를 다시 시작했습니다.
romain@pb$ sudo service nslcd restart
내 Mac에서 연결을 시도했습니다.
romain@Mac:~$ ssh pduchesne@pb
작동했습니다 ... 일종의 :
romain@Mac:~$ ssh pduchesne@pb
pduchesne@pb's password:
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-53-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
197 packages can be updated.
4 updates are security updates.
*** System restart required ***
Last login: Fri Jan 13 11:12:23 2017 from 192.168.0.80
romain@pb:~$ pwd
/home/users/pduchesne
romain@pb:~$ whoami
romain
새 질문(편집 4용)
왜 사용자를 변경하지 않습니까 ?? 나는 'pduchesne'으로 'pb'에 로그인할 것으로 예상했습니다 :-/
이전 질문(편집 4 이전)
어떤 파일을 확인해야 할지 모르겠습니다. 어떤 조언이라도 환영합니다.
답변1
표시된 구성에는 실제로 인증에 사용될 수 있는 내용이 언급되어 있지 않습니다. 즉, 입력된 비밀번호를 확인할 방법이 없습니다.
nsswitch 1 구성에는 가 있지만 shadow: ldap
사용자 개체 덤프에는 실제로 "그림자" 속성이 언급되어 있지 않습니다.~이다검색할 수 있는 정보가 없습니다 getent shadow
. 어쨌든 LDAP를 통해 섀도우 정보를 노출하는 것은 그다지 안전하지 않기 때문에 괜찮습니다.
pam_ldap
대신, 주어진 비밀번호를 사용하여 LDAP 서버에 대해 인증(바인딩)을 시도하는 (libpam-ldapd)를 설정해야 합니다 . 이를 위해서는 사용자 userPassword
속성에 LDAP 형식 비밀번호 해시를 입력해야 합니다(이는 덤프에서도 누락됨).
독립형 libnss-ldap(및 libpam-ldap)에는 몇 가지 단점이 있으며 대부분 더 이상 사용되지 않습니다. nslcd + libnss-ldap을 사용하면 훨씬 더 안정적인 구성을 갖게 됩니다.디+ libpam-ldapd 대신.
1 "NSS의 마녀"가 아닌 "네임 서비스 스위치"