Well Hello there! I'm hoping you can help me with a Redhat Linux 8 system and Active…
- User
Well Hello there! I'm hoping you can help me with a Redhat Linux 8 system and Active Directory Logons. Can you assist me?
- Assistant
Hello! I'll do my best to assist you with your Red Hat Linux 8 system and Active Directory logons. Please go ahead and share the specific issue or question you have, and I'll provide the necessary guidance.
- User
I wish to permit an Active Directory group Logon access but NOT provide that same group SUDO rights.
- Assistant
To allow Active Directory group logon access without providing SUDO rights, you can configure your Red Hat Linux 8 system to use SSSD (System Security Services Daemon) and the Realmd utility to integrate with Active Directory. Here are the general steps to achieve this:
-
Install required packages: Run the following command to install necessary packages:
sudo dnf install realmd sssd adcli oddjob oddjob-mkhomedir samba-common-tools -
Join the Linux server to Active Directory: Use the
realmcommand to join the Linux system to the Active Directory domain. Run the following command and provide the appropriate domain information:sudo realm join --user=administrator example.comReplace
administratorwith the appropriate AD user account. -
Configure SSSD: Create a backup of the default SSSD configuration file and then modify it. Execute the following commands:
sudo cp /etc/sssd/sssd.conf /etc/sssd/sssd.conf.original sudo vi /etc/sssd/sssd.confEdit the
[domain/example.com]section to include the following line:ad_access_filter = !(memberOf=CN=Sudo_Group,OU=Groups,DC=example,DC=com)Replace
CN=Sudo_Group,OU=Groups,DC=example,DC=comwith the appropriate Active Directory group you want to exclude from SUDO rights. -
Restart SSSD: Restart the SSSD service to apply the configuration changes:
sudo systemctl restart sssd
With these steps, users from the specified Active Directory group will be able to log in to the Linux server, but they won't be granted SUDO rights. Ensure to adjust the AD group name and domain details as per your setup.
-
- User
Okay. If my domain is called "widgets.com" and the group is "commoners", can you provide an example of the configuration line in the [domain/example.com] section?
- Assistant
Certainly! If your domain is called "widgets.com" and the Active Directory group you want to exclude from SUDO rights is named "commoners", you can modify the configuration line in the
[domain/example.com]section of the SSSD configuration file as follows:ad_access_filter = !(memberOf=CN=commoners,CN=Users,DC=widgets,DC=com)Here's a breakdown of the configuration line:
memberOf=CN=commoners,CN=Users,DC=widgets,DC=comspecifies the Active Directory group you want to exclude from SUDO rights. ReplaceCN=commoners,CN=Users,DC=widgets,DC=comwith the appropriate distinguished name (DN) of your "commoners" group.!is used as a logical operator to negate the condition, stating that users who are not members of the specified group should be allowed access.
Ensure that the
sssd.conffile includes the correct domain details and that the configuration line is placed within the[domain/example.com]section. - User
Will that configuration line provide LOGON access to that group?
- Assistant
Apologies for the confusion in my previous response. The configuration line mentioned earlier is for excluding the group from SUDO rights but doesn't specifically provide logon access. To provide logon access to the "commoners" group from the "widgets.com" domain, you need to modify the SSSD configuration as follows:
-
Open the SSSD configuration file for editing:
sudo vi /etc/sssd/sssd.conf -
Modify the
[domain/example.com]section to include the following line:simple_allow_groups = commonersThis line specifies the Active Directory group "commoners" that will have logon access to the Linux server.
-
Restart the SSSD service to apply the configuration changes:
sudo systemctl restart sssd
With this updated configuration, members of the "commoners" group from the "widgets.com" domain will have logon access to the Linux server. They will not have SUDO rights unless specifically granted through other means.
-
- User
Okay. How can I use the "realm permit" command to allow Active Directory group logons to RHEL 8?
- Assistant
Apologies for the confusion earlier regarding the
realm permitcommand. In Red Hat Enterprise Linux (RHEL) 8, therealm permitcommand is not used to specifically allow Active Directory group logons. Instead, it is used to grant administrative access to specific AD users or groups.To allow Active Directory group logon access in RHEL 8, you can follow the steps outlined in my previous responses. Configuring SSSD and modifying the sssd.conf file, as well as using the
realm joincommand, are the recommended methods to integrate with Active Directory and allow logon access.If you have any specific concerns or issues regarding the SSSD and realm integration process, please let me know, and I'll be happy to assist you further.
- User
Okay, can you provide an example of using the "realm permit" command to allow admin access to an AD group?
- Assistant
Apologies for the confusion in my previous response. In RHEL 8, the
realm permitcommand is not used to specifically grant administrative access to Active Directory (AD) groups. Instead, you can use thesudocommand in combination with configuring the/etc/sudoersfile to grant specific AD groups administrative access.To grant administrative access to an AD group in RHEL 8, you can follow these steps:
-
Open the
/etc/sudoersfile using a text editor:sudo visudo -
Add the following line to the end of the file, assuming the AD group is called "ad_admins":
%ad_admins ALL=(ALL) ALLReplace "ad_admins" with the appropriate AD group name.
-
Save and close the file.
Now, members of the "ad_admins" AD group will have administrative (sudo) access on the RHEL 8 system. Remember to use the correct AD group name and ensure correct syntax in the
/etc/sudoersfile.Please note that modifying the
/etc/sudoersfile should be done with caution, and it's recommended to use thevisudocommand to prevent syntax errors that could lock you out of the system. -
- User
What if I don't want to provide admin access to the AD group, but still permit logons?
- Assistant
If you want to permit logon access to an Active Directory (AD) group without granting administrative access, you can achieve this by using the
realmcommand to manage access control rules for AD users and groups. Here's an example of how you can permit logon access to an AD group while excluding administrative privileges:-
List the available access control rules using the
realmcommand:sudo realm list-accessThis will display the existing access control rules defined for your AD domain.
-
Remove any existing access control rule that grants administrative access to the AD group:
sudo realm deny --allThis command revokes all access control rules currently defined.
-
Create a new access control rule to permit logon access for the AD group:
sudo realm permit --groups ad_group_nameReplace
ad_group_namewith the actual name of the AD group you want to allow logon access for.
With these steps, you have explicitly denied administrative access to the specified AD group while permitting logon access. Remember to adjust the AD group name accordingly.
-
- User
Okay. if the domain is "widgets.com" and the AD group name is "peasants", can you provide an example of that command?
- Assistant
Certainly! If your domain is "widgets.com" and the AD group you want to permit logon access for is named "peasants," you can use the following command:
sudo realm permit --groups peasantsThis command will permit logon access to the "peasants" AD group on the Linux system integrated with the "widgets.com" domain.
Make sure to double-check the AD group name and domain details to match your specific configuration.
- User
Thank you! I'll try this out and test for working functions. Again, thank you!
- Assistant
You're welcome! I'm glad I could assist you. If you have any more questions or need further help, feel free to ask. Good luck with your testing, and I hope everything works as expected. Thank you!
- User
so what would the command "realm -g" do?
- Assistant
The command
realm -gis used to display the groups that are allowed or denied access to the system through the Realmd integration with Active Directory (AD). It displays the AD groups that have been granted or denied access control rights on the Linux system.Here's how you can use the
realm -gcommand:realm -gRunning this command will list the AD groups that have been permitted or denied access, along with their corresponding access control status.
Please note that in order to use the
realmcommand, you need to have the Realmd package installed and have successfully joined your Linux system to the Active Directory domain using therealm joincommand.