LDAP authentication: enable ssh and login

General support questions
Post Reply
BrianD1994
Posts: 2
Joined: 2020/03/31 13:26:07

LDAP authentication: enable ssh and login

Post by BrianD1994 » 2020/04/01 13:58:47

Hello everyone!

I am new to the forum and I hope this is the right section to post my question. Otherwise I ask for forgiveness and move the question to where you think is most appropriate.

I installed CentOS 7 core on a VM in virtualbox and I'm trying to connect it to my ldap server. I put in succession the steps I made:

base dc = oxygen, dc = local
ou users

  • Checked that there was no AllowUsers on specific user in / etc / ssh / sshd_config
  • yum update && yum install openldap openldap-clients nss-pam-ldapd nscd nslcd
  • vim / etc / sysconfig / authconfig and modified the following parameters USEPAMACCESS = yes USESSSDAUTH = no FORCELEGACY = yes USESSSD = no
  • launched authconfig-tui and checked everything about ldap and entered the correct ldap: // url of my server
  • in /etc/nslcd.conf I added map passwd homeDirectory "/ home / $ uid" and map passwd loginShell "/ bin / bash"
  • in /etc/pam.d/system-auth added session required pam_mkhomedir.so skel = / etc / skel / umask = 0022
  • in /etc/nsswitch.conf added "ldap" at the end of passwd, group, shadow
  • in /etc/pam.d/sshd added required account pam_access.so
  • added users group to visudo
  • restarted nscd and nslcd with systemctl

my test with

Code: Select all

getent passwd steve (which is the ldap user I want to log in with)
returns

Code: Select all

steve: *: 2000: 1005: ldap user: / home / steve: / bin / bash
and if as root I type

Code: Select all

su - steve
I log in as steve but I can't do sudo -i if I try from the outside from another machine to access via ssh it makes me connect.

The LDAP server is working properly, I have other LXC but Debian based machines / containers that connect regularly and do not give problems.
Can you help me? Thank you very much for your answers.
Stephen

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: LDAP authentication: enable ssh and login

Post by TrevorH » 2020/04/01 14:01:56

Start by getting ldapsearch to work, it's usually easier.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

BrianD1994
Posts: 2
Joined: 2020/03/31 13:26:07

Re: LDAP authentication: enable ssh and login

Post by BrianD1994 » 2020/04/02 15:44:02

Hi thank you for your reply.

I've deleted my previous VM and i've created new one. I've followed this guide https://www.golinuxcloud.com/configure- ... ap-server/ but ssh and login still not work.

Is it possible that the tls is the problem?

Post Reply