Created
May 22, 2026 01:14
-
-
Save jurandysoares/6bb1dc6b25b6fb45ecc828c3d53f72f3 to your computer and use it in GitHub Desktop.
Setup Debian to join domain <lapso.lab>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "Erro: Este script precisa ser executado como root (ou usando sudo)." >&2 | |
| exit 1 | |
| fi | |
| apt update | |
| apt install -y realmd sssd adcli krb5-user realmd sssd sssd-tools libnss-sss libpam-sss adcli \ | |
| samba-common-bin oddjob oddjob-mkhomedir packagekit krb5-user | |
| sed -i 's/mange/lapso/g' /etc/hostname /etc/hosts | |
| realm join lapso.lab -U Administrator | |
| pam-auth-update --enable mkhomedir | |
| cat << EOF > /etc/sssd/sssd.conf | |
| [sssd] | |
| domains = lapso.lab | |
| config_file_version = 2 | |
| services = nss, pam | |
| [domain/lapso.lab] | |
| default_shell = /bin/zsh | |
| krb5_store_password_if_offline = True | |
| cache_credentials = True | |
| krb5_realm = LAPSO.LAB | |
| realmd_tags = manages-system joined-with-adcli | |
| id_provider = ad | |
| fallback_homedir = /home/%d/%u | |
| ad_domain = lapso.lab | |
| use_fully_qualified_names = False | |
| ldap_id_mapping = True | |
| access_provider = ad | |
| EOF | |
| systemctl restart sssd.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment