08-31-2023 06:40 AM - edited 09-08-2023 03:44 AM
Hi Folks,
I hope you've all had an unforgettable summer holiday, taking the time to disconnect and create special memories with your loved ones.
Sooooo, I've stumbled upon something (thanks @james_herbert & Rickie 😉) that potentially could be a significant game charger for integrating Linux devices (servers) with JC. Before JC caught up with Linux’s myriad of distros for deploying the agents, I’ve discovered a mid-ground - using the JC user account to login via LDAP!
Try picture this: you effortlessly push out configuration settings to your Linux servers using popular automation tools like Ansible, Chef, or Puppet. All the while, secure the login by JC (via LDAP) —no agent required.
Let’s dive into it.
[Updated - 8th Sep 2023]
Ubuntu 22.04.2 LTS - Jammy
Oracle Linux 9.2 (Fedora 34)
sudo apt install sssd-ldap ldap-utils # Ubuntu
#Or
yum install sssd sssd-client # for Oracle Linux
[Updated on 4th Sep 2023] - Added sudoer group & SSH keys support
echo -n | openssl s_client -connect ldap.jumpcloud.com:636 -showcerts | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/openldap/certs/jumpcloud.chain.pem
[sssd]
config_file_version = 2
services = nss,pam,ssh
domains = jumpcloud
[nss]
[pam]
[domain/jumpcloud]
debug_level = 2
id_provider = ldap
enumerate=true
auth_provider=ldap
ldap_uri = ldaps://ldap.jumpcloud.com:636
#ldap_uri = ldaps://ldap-mfa.jumpcloud.com:636 #MFA for JC LDAP
ldap_search_base = o=YOUR_ORG_ID,dc=jumpcloud,dc=com
ldap_default_bind_dn = uid=YOUR_LDAP_BIND_USER,ou=Users,o=YOUR_ORG_ID,dc=jumpcloud,dc=com ldap_default_authtok = YOUR_LDAP_BIND_USER_PASSWORD
ldap_user_ssh_public_key = sshKey
ldap_use_tokengroups = False
ldap_tls_cacert = /etc/ssl/certs/ca-certificates.crt
#ldap_tls_cacert = /etc/openldap/certs/jumpcloud.chain.pem # Oracle Linux only
sudo_provider = none
ldap_access_filter = memberOf=cn=YOUR_GROUP_NAME,ou=Users,o=YOUR_ORG_ID,dc=jumpcloud,dc=com
#Enabling PAM
UsePAM yes
#Disable Root Login
PermitRootLogin no
#Disable Password Login (enforce using SSH key)
PasswordAuthentication no
#Directing sshd to use SSSD as the authorized_keys
AuthorizedKeysCommand /usr/bin/sss_ssh_authorizedkeys
AuthorizedKeysCommandUser root
session required pam_mkhomedir.so skel=/etc/skel/
%Linux_Sudoers ALL=(ALL) ALL #Use the linux group name, NOT the JC group name
sudo chmod 600 /etc/sssd/sssd.conf
# authconfig --update --enablesssd --enablesssdauth # For Oracle Linux only
sudo systemctl enable sssd
sudo systemctl start sssd
sudo systemctl restart sshd
Thanks for reading! Let me know your thoughts in the comments below.
New to the site? Take a look at these additional resources:
Ready to join us? You can register here.