I am trying to add my CentOS EC2 machine to Windows AD.
My Windows Active Directory is configured on EC2 Instance in another account. There are two AD Instances (Multi-AZ) that are configured and replication etc is configured by the AD Administrator on the Servers.
He has created a User for me and shared the credentials with me.
I have performed the following steps according to this AWS Documentation to add the CentOS EC2 machine to Windows AD.
Still, I am listing down the steps which I have executed on my Server.
sudo yum -y update
cat /etc/hostname
Output : ip-1-7-2-6.xyz.local
sudo yum -y install sssd realmd krb5-workstation samba-common-tools
sudo realm join -U [email protected] XYZ.local --verbose
The above command gave me error:
* Resolving: _ldap._tcp.xyz.local
* Resolving: xyz.local
* No results: xyz.local
realm: No such realm found
So I made the following entries in sudo vi /etc/hosts
as mentioned in this link.
The above two IP's are of my AD Servers
I also made changes to /etc/resolv.conf
as follows :
Then I used the sudo realm discover XYZ.local
command to check if realm
is able to discover the domain:
I am able to see the details.
After this when I again tried to join the domain it gave me following error:
realm: Couldn't join realm: Necessary packages are not installed: oddjob, oddjob-mkhomedir, sssd, adcli
So I Installed the above packages as well.
I tried once again and this time error changed to :
Error :
! Couldn't get kerberos ticket for: [email protected]: Cannot find KDC for realm "XYZ.local"
adcli: couldn't connect to XYZ.local domain: Couldn't get kerberos ticket for: [email protected]: Cannot find KDC for realm "XYZ.local"
! Failed to join the domain
realm: Couldn't join realm: Failed to join the domain
I found a solution to the above problem over this link and executed the command once again. This time it is successful. Here is the output:
Output for realm list
:
I tried id
command to verify the user’s uid and gid
id user-shivkumar
, but this failed with message no such user
.
Still I proceeded ahead with the AWS doc to complete all of the steps and then cross check.
sudo vi /etc/ssh/sshd_config
PasswordAuthentication yes
sudo systemctl restart sshd.service
sudo service sshd restart
sudo visudo
## Add the "AWS Delegated Administrators" group from the example.com domain. %AWS\ Delegated\ [email protected] ALL=(ALL:ALL) ALL
Here are the details of my /etc/sssd/sssd.conf
Still I am not able to access the EC2 Instance using AD credentials.
It says Access Denied
.
I am not able to understand what other configurations needs to be made?