System Security Services Daemon (SSSD): Difference between revisions

From Leo's Notes
This page was last edited on 19 October 2020, at 23:55.
Created page with "<br /> == Troubleshooting == === Testing Authentication === You can test whether your authentication works using sssd without needing to login to the system from another ses..."
 
mNo edit summary
Line 1: Line 1:
<br />
== Use Cases ==
 
=== Authentication without Joining a Domain ===
This use case is to allow your system to authenticate against a Windows AD server via Kerberos using sssd. It does not require joining the Windows domain. The method outlined below also does not retrieve account information either as both <code>/etc/passwd</code> and <code>/etc/groups</code> are managed locally.
 
These steps have been tested on CentOS 8.
 
Install SSSD and the Kerberos workstation packages.
{{Highlight
| code = # yum install sssd sssd-krb5 krb5-workstation authselect-compat
| lang = terminal
}}
Configure <code>krb5.conf</code>:
{{Highlight
| code = [logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
 
[libdefaults]
default_realm = WIN.EXAMPLE.COM
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
 
[realms]
WIN.EXAMPLE.COM = {
  kdc = itsodcsrv14.win.example.com
}
 
[domain_realm]
win.example.com = WIN.EXAMPLE.COM
.win.example.com = WIN.EXAMPLE.COM
| lang = text
}}
At this point, you should be able to successfully obtain a Kerberos ticket:
{{Highlight
| code = $ kinit username@WIN.EXAMPLE.COM        # case matters!
Password for username@WIN.EXAMPLE.COM:  # Enter your password
| lang = terminal
}}
Configure <code>sssd.conf</code>:
{{Highlight
| code = [sssd]
config_file_version = 2
services = nss, pam, ifp
domains = win.example.com
 
[domain/win.example.com]
id_provider = files
debug_level = 5
auth_provider = krb5
chpass_provider = krb5
 
krb5_realm = WIN.EXAMPLE.COM
krb5_server = ITSODCSRV14.WIN.EXAMPLE.COM:88
krb5_validate = false
| lang = text
}}
Run <code>authconfig</code> to enable <code>sssd</code> and to enable <code>sssdauth</code>. This will set up the required pam configuration and also inject sssd to <code>/etc/nsswitch.conf</code> as a provider. At the very minimum for authentication, sss should be the provider for shadow.
{{Highlight
| code = # authconfig --enablesssd --update
# authconfig --enablesssdauth --update
| lang = terminal
}}
Start <code>sssd</code> with <code>systemctl start sssd</code>. You should now be able to authenticate as a user.


== Troubleshooting ==
==Troubleshooting==


=== Testing Authentication ===
===Testing Authentication===
You can test whether your authentication works using sssd without needing to login to the system from another session using <code>sssctl user-checks</code>.  
You can test whether your authentication works using sssd without needing to login to the system from another session using <code>sssctl user-checks</code>.  
<br />
<br />
{{Highlight
| code = $ sssctl user-checks -a=auth leo
| lang = terminal
}}

Revision as of 23:55, 19 October 2020

Use Cases

Authentication without Joining a Domain

This use case is to allow your system to authenticate against a Windows AD server via Kerberos using sssd. It does not require joining the Windows domain. The method outlined below also does not retrieve account information either as both /etc/passwd and /etc/groups are managed locally.

These steps have been tested on CentOS 8.

Install SSSD and the Kerberos workstation packages.

# yum install sssd sssd-krb5 krb5-workstation authselect-compat

Configure krb5.conf:

[logging]
 default = FILE:/var/log/krb5libs.log
 kdc = FILE:/var/log/krb5kdc.log
 admin_server = FILE:/var/log/kadmind.log

[libdefaults]
 default_realm = WIN.EXAMPLE.COM
 dns_lookup_realm = false
 dns_lookup_kdc = false
 ticket_lifetime = 24h
 renew_lifetime = 7d
 forwardable = true

[realms]
 WIN.EXAMPLE.COM = {
  kdc = itsodcsrv14.win.example.com
 }

[domain_realm]
 win.example.com = WIN.EXAMPLE.COM
 .win.example.com = WIN.EXAMPLE.COM

At this point, you should be able to successfully obtain a Kerberos ticket:

$ kinit username@WIN.EXAMPLE.COM         # case matters!
Password for username@WIN.EXAMPLE.COM:   # Enter your password

Configure sssd.conf:

[sssd]
config_file_version = 2
services = nss, pam, ifp
domains = win.example.com

[domain/win.example.com]
id_provider = files
debug_level = 5
auth_provider = krb5
chpass_provider = krb5

krb5_realm = WIN.EXAMPLE.COM
krb5_server = ITSODCSRV14.WIN.EXAMPLE.COM:88
krb5_validate = false

Run authconfig to enable sssd and to enable sssdauth. This will set up the required pam configuration and also inject sssd to /etc/nsswitch.conf as a provider. At the very minimum for authentication, sss should be the provider for shadow.

# authconfig --enablesssd --update
# authconfig --enablesssdauth --update

Start sssd with systemctl start sssd. You should now be able to authenticate as a user.

Troubleshooting

Testing Authentication

You can test whether your authentication works using sssd without needing to login to the system from another session using sssctl user-checks.

$ sssctl user-checks -a=auth leo