Professional Documents
Culture Documents
How To Configure PBIS To Join Ubuntu With Windows AD: Download and Install
How To Configure PBIS To Join Ubuntu With Windows AD: Download and Install
Windows AD
In this article, we will install and configure PowerBroker Identity Services (PBIS) on the Ubuntu 14.04
in order to join together with Windows Active Directory. We also will consider how to remove stale
computer account from AD using dsquery command.
Now, you need to set execution bit and execute the package with root privileges:
chmod +x pbis-open-8.5.3.293.linux.x86_64.deb.sh
sudo ./pbis-open-8.5.3.293.linux.x86_64.deb.sh
It will ask a couple of question during installation so choose options accordingly. Once the installation
is done its time to join the machine to the domain.
PBIS Configuration
We are ready to proceed with configuration. Please navigate to /opt/pbis/bin/ directory and run
domainjoin-cli command to join a host to an Active directory domain.
cd /opt/pbis/bin/
sudo domainjoin-cli join [DomainName [DomainAccount]
where,
DomainName - the name of your domain
DomainAccount - your domain account (user@domainname)
Example: sudo domainjoin-cli join example.com administrator
When prompted, please provide Active Directory administrator's password. On successful
authentication, the command adds your Ubuntu computer as a member of the domain. The command
also adds entries in the /etc/hosts file.
To check Ubuntu domain setting you need to run the following command from your terminal:
sudo domainjoin-cli query
The command will display the name of the domain to which your Ubuntu computer has joined.
Example:
Name = username
Domain = example.com
Distinguished Name = CN=username,CN=Computers,DC=example,DC=com
Note: If you want to remove your Ubuntu computer from the domain, you need to run
sudo domainjoin-cli leave
Once joined to the domain important thing to do is to restrict access to sudoers group to members of
Domain Admin group only. This can be accomplished by updating /etc/sudoers file by adding
%domain^admins ALL=(ALL) ALL in group section so sudoers file section looks as follows:
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
%domain^admins ALL=(ALL) ALL
The good thing about using PBIS is that it allows multiple ways to customize the login, domain prefix,
login shell, folder name, etc. In order to set up default configuration for domain users, you need to use
PBIS to set the environment for all required domain users that will be logged to the system.
Please open the terminal and run following commands:
sudo /opt/pbis/bin/config UserDomainPrefix [Domain]
Set this to 'true' avoid entering domain names all the time
sudo /opt/pbis/bin/config LoginShellTemplate /bin/bash
Set different home dir then the local users on the machine
sudo /opt/pbis/bin/config RequireMembershipOf "[Domain]\\[SecurityGroup]"
Navigate to the line that states session sufficient pam_lsass.so and replace it with session [success=ok
default=ignore] pam_lsass.so
Then, we need to edit the lightdm configuration file and append the following lines:
sudo vi /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
allow-guest=false
greeter-show-manual-login=true
Please note, that if you are using Lubuntu 14.04 your lightdm configuration file will be 60-lightdm-
gtk-greeter.conf
Test it!
Once satisfied with all the options just reboot the machine:
reboot
and login:
ssh [username]@[servername]
If you want to completely remove all PBIS related files from you system, please run purge process:
/opt/pbis/bin/uninstall.sh purge
Please note, that instead of disabling the inactive computers firs, you can directly delete them by
running:
dsquery computer -inactive | dsrm -noprompt
Conclusion
This article is a continuation of the earleir article on integrating LDAP with Active Directory. There are
several ways to authenticate Linux servers against Microsoft Active Directory such as Samba/Winbind,
Centrify, etc. and installers are available for both debian and rpm package format supporting RHEL,
Ubuntu, CentOS, Debian, etc. Nevertheless, provided instructions have only been tested on Ubuntu
14.04 LTS Distribution. With minimal tweaking these steps should also work for other distributions.
Older and now deprecated versions of Likewise-Open should work in a similar fashion as PBIS-Open,
and may be required on older distributions.
Ejemplo:
Nombre = nombre de usuario
Domain = example.com
Nombre distinguido = CN = nombre de usuario, CN = computadoras, DC = ejemplo, DC = com
Nota: Si desea eliminar su computadora Ubuntu del dominio, debe ejecutar
sudo domainjoin-cli leave
Una vez que se haya unido al dominio, lo importante es restringir el acceso al grupo de sudoers
únicamente a los miembros del grupo de administración del dominio. Esto se puede lograr actualizando
el archivo / etc / sudoers agregando% domain ^ admins ALL = (ALL) ALL en la sección de grupo para
que la sección del archivo sudoers tenga el siguiente aspecto:
# Los miembros del grupo de administración pueden obtener privilegios de raíz
% admin ALL = (TODOS) TODOS
% domain ^ admins ALL = (ALL) TODOS
Lo bueno de usar PBIS es que permite múltiples formas de personalizar el inicio de sesión, el prefijo
del dominio, el shell de inicio de sesión, el nombre de la carpeta, etc. Para configurar la configuración
predeterminada para los usuarios del dominio, debe usar PBIS para establecer el entorno para todos
usuarios de dominio requeridos que se registrarán en el sistema.
Abra el terminal y ejecute los siguientes comandos:
sudo / opt / pbis / bin / config UserDomainPrefix [Dominio]
Establecer prefijo de dominio
sudo / opt / pbis / bin / config AssumeDefaultDomain True
Establezca esto en 'verdadero' evite ingresar nombres de dominio todo el tiempo
sudo / opt / pbis / bin / config LoginShellTemplate / bin / bash
Establecer el shell por defecto
sudo / opt / pbis / bin / config HomeDirTemplate% H /% D /% U
Establezca un directorio de inicio diferente y luego los usuarios locales en la máquina
sudo / opt / pbis / bin / config RequireMembershipOf "[Domain] \\ [SecurityGroup]"
Establecer grupos de seguridad específicos de Active Directory
El siguiente paso es editar el archivo de sesión común pamd.d. Por favor ingrese la terminal:
sudo vi /etc/pam.d/common-session
Navegue a la línea que indica la sesión suficiente pam_lsass.so y reemplácela por la sesión [success =
ok default = ignore] pam_lsass.so
Entonces, necesitamos editar el archivo de configuración lightdm y anexar las siguientes líneas:
sudo vi /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
allow-guest = falso
greeter-show-manual-login = true
Tenga en cuenta que si usa Lubuntu 14.04, su archivo de configuración lightdm será 60-lightdm-gtk-
greeter.conf
¡Pruébalo!
Una vez satisfecho con todas las opciones solo reinicie la máquina:
reiniciar
e inicie sesión:
ssh [nombre de usuario] @ [nombre de servidor]
Cómo reiniciar el servicio PBIS
Los agentes PBIS están compuestos por el administrador de servicios lwsmd daemon, que se encuentra
en / opt / pbis / sbin / lwsmd. Este daemon incluye el servicio lsass, que maneja las búsquedas de
autenticación, autorización, almacenamiento en caché y ldmap. Debido a que el servicio de
autenticación registra las confianzas solo en los inicios, debe reiniciar lsass con el Administrador de
servicios PBIS después de modificar una relación de confianza. Para reiniciar el servicio simplemente
ejecute:
/ opt / pbis / bin / lwsm reiniciar lsass
Cómo desinstalar PBIS usando una línea de comando
Para desinstalar PBIS usando un comando, ejecute el siguiente comando:
/opt/pbis/bin/uninstall.sh uninstall
Si desea eliminar por completo todos los archivos relacionados con PBIS de su sistema, ejecute el
proceso de purga:
/opt/pbis/bin/uninstall.sh purge