Skip to main content

linux - Impossible to connect with ldap

IP : 192.168.0.70 (dell)


DIT :


enter image description here


(seen through ldapphpadmin)


And for patricia duchesne:


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...


IP : 192.168.0.60 (pb)


NSSWitch is configured :


$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

so is 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

and libnss :


$ cat /etc/libnss-ldap.conf
uri ldap://192.168.0.70
base dc=memorandum,dc=pro

I can reach the ldap user information :


$ getent passwd | tail -n 1
pduchesne:*:1000:501:patricia duchesne:/home/users/pduchesne:/bin/bash


From IP : 192.168.0.80


$ ssh pduchesne@192.168.0.60
pduchesne@192.168.0.60's password:
Permission denied, please try again.
pduchesne@192.168.0.60's password:
Permission denied, please try again.
pduchesne@192.168.0.60's password:
Permission denied (publickey,password).


I looked at hundred of webpages without finding a way to set up all that :( 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


Finding this page : https://www.vincentliefooghe.net/content/openldap-gestion-des-logs I realized I don't know where are the ldap logs :-(



Following : https://help.ubuntu.com/community/LDAPClientAuthentication


PAM configuration on 192.168.0.60 :


$ 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

Update :


$ sudo pam-auth-update
[sudo] password for romain:
LDAP Password:

enter image description here


The file


$ cat /etc/security/group.conf

is fully commented


I didn't use 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

I didn't use the [ LDAP Host Access Authorization ] paragraph. Should I ?



Verbose 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 chacha20-poly1305@openssh.com none
debug1: kex: client->server chacha20-poly1305@openssh.com 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).


Adding user pwd hash in ldap server (see user's dump at the beginning)



Following @grawity proposal I installed 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) ...

Then I configured /etc/nslcd.conf on which I notice I was not specifying precising to use ldap version3 ( I don't know which version is by default ? ) :


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

Restarted nslcd:


romain@pb$ sudo service nslcd restart

and tryed to connect from my mac :


romain@Mac:~$ ssh pduchesne@pb

which worked...kind of :


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


Why doesn't I change of user ?? I was expecting to log into 'pb' as 'pduchesne' :-/



I don't know which files to check - any advice welcome.

Comments

Popular Posts

Use Google instead of Bing with Windows 10 search

I want to use Google Chrome and Google search instead of Bing when I search in Windows 10. Google Chrome is launched when I click on web, but it's Bing search. (My default search engine on Google and Edge is http://www.google.com ) I haven't found how to configure that. Someone can help me ? Answer There is no way to change the default in Cortana itself but you can redirect it in Chrome. You said that it opens the results in the Chrome browser but it used Bing search right? There's a Chrome extension now that will redirect Bing to Google, DuckDuckGo, or Yahoo , whichever you prefer. More information on that in the second link.

linux - Using an index to make grep faster?

I find myself grepping the same codebase over and over. While it works great, each command takes about 10 seconds, so I am thinking about ways to make it faster. So can grep use some sort of index? I understand an index probably won't help for complicated regexps, but I use mostly very simple patters. Does an indexer exist for this case? EDIT: I know about ctags and the like, but I would like to do full-text search. Answer what about cscope , does this match your shoes? Allows searching code for: all references to a symbol global definitions functions called by a function functions calling a function text string regular expression pattern a file files including a file

How do I transmit a single hexadecimal value serial data in PuTTY using an Alt code?

I am trying to sent a specific hexadecimal value across a serial COM port using PuTTY. Specifically, I want to send the hex codes 9C, B6, FC, and 8B. I have looked up the Alt codes for these and they are 156, 182, 252, and 139 respectively. However, whenever I input the Alt codes, a preceding hex value of C2 is sent before 9C, B6, and 8B so the values that are sent are C2 9C, C2 B6, and C2 8B. The value for FC is changed to C3 FC. Why are these values being placed before the hex value and why is FC being changed altogether? To me, it seems like there is a problem internally converting the Alt code to hex. Is there a way to directly input hex values without using Alt codes in PuTTY? Answer What you're seeing is just ordinary text character set conversion. As far as PuTTY is concerned, you are typing (and reading) text , not raw binary data, therefore it has to convert the text to bytes in whatever configured character set before sending it over the wire. In other words, when y

networking - Windows 10, can ping other PC but cannot access shared folders! What gives?

I have a computer running Windows 7 that shares a Git repo on drive D. Let's call this PC " win7 ". This repo is the origin of a project that we push to and pull from. The network is a wireless network. One PC on this network is running on Windows 10. Let's call this PC " win10 ". Win10 can ping every other PC on the network including win7 . Win7 can ping win10 . Win7 can access all shared files on win10 . Neither of the PCs have passwords. Problem : Win10 cannot access any shared files on win7 , not from Explorer, nor from Git Bash or any other Git management system (E-Git on Eclipse or Visual Studio). So, win10 cannot pull/push. Every other PC on the network can access win7 shared files and push/pull to/from the shared Git origin. What's wrong with Windows 10? I have tried these: Control Panel\All Control Panel Items\Network and Sharing Center\Advanced sharing settings\ File sharing is on, Discovery is on, Password protected sharing is off Adapte