windows2008r2

All posts tagged windows2008r2

So this method wasn’t our first attempt to get our Linux farm authenticating against Windows AD. Our first attempt was to use the Microsoft Identity Management for UNIX component which is a role based component for Windows 2008 R2. We attempted to just do a one-way sync from AD to the Linux farm. This did work, but we latter found out that it’s just very insecure. Perhaps, I set it up wrong, but I tried to follow the instructions given or what I could find online the best I could.

There method was to have a Linux agent (ssod binary) that will need to run on every Linux box. That agent by default (and can be changed via /etc/sso.conf) is set to run on port 6677. It seemed the only purpose of this agent was to encrypt and decrypt the pass words so there were not being sent over the wire in plain text. Why I even thought that was a good idea without just enforcing LDAP over SSL or TLS from the get go, I have no idea. Anyhow, we choose to use that method. Well things were fine right up to the point of noticing that our network engineering accidentally started blocking port 6677 to the AD hosts. Had they not done that, we might still be using that insecure method. Anyhow with that port being blocked, low and behold I started noticing plain text being sent over the wire. Turns out if that ssod binary isn’t running or is getting blocked on the network, plain text pass words start getting sent. Well that definitely isn’t good, wouldn’t take very much effort to kill that ssod binary on any host, and fire up a sniffer. Shit snowball in full effect.

At that point, I needed to figure out how the hell to get either LDAPS (LDAP over SSL port 636) or TLS (port 389) working in AD, as of course, that being the secure method and well it being Microsoft that isn’t the default choice.

Long story short…here’s how.

First you need to install the CA manager in AD and/or a 3rd party CA. We have a CA at work, so I used this form. You of course will need to replace with your info.

Save this into a file like notepad, name it like ‘fqdn.example.com.cnf’. I’ll write up more on this if someone requests this, but there are a billion howto’s on how to create these self signed certs and to get Windows setup on that.

Make sure you save yourself a copy of the CA-cert, as you will need this on every Linux host you plan on authenticating from.

Continue to Page 2

So this method wasn’t our first attempt to get our Linux farm authenticating against Windows AD. Our first attempt was to use the Microsoft Identity Management for UNIX component which is a role based component for Windows 2008 R2. We attempted to just do a one-way sync from AD to the Linux farm. This did work, but we latter found out that it’s just very insecure. Perhaps, I set it up wrong, but I tried to follow the instructions given or what I could find online the best I could.

There method was to have a Linux agent (ssod binary) that will need to run on every Linux box. That agent by default (and can be changed via /etc/sso.conf) is set to run on port 6677. It seemed the only purpose of this agent was to encrypt and decrypt the pass words so there were not being sent over the wire in plain text. Why I even thought that was a good idea without just enforcing LDAP over SSL or TLS from the get go, I have no idea. Anyhow, we choose to use that method. Well things were fine right up to the point of noticing that our network engineering accidentally started blocking port 6677 to the AD hosts. Had they not done that, we might still be using that insecure method. Anyhow with that port being blocked, low and behold I started noticing plain text being sent over the wire. Turns out if that ssod binary isn’t running or is getting blocked on the network, plain text pass words start getting sent. Well that definitely isn’t good, wouldn’t take very much effort to kill that ssod binary on any host, and fire up a sniffer. Shit snowball in full effect.

At that point, I needed to figure out how the hell to get either LDAPS (LDAP over SSL port 636) or TLS (port 389) working in AD, as of course, that being the secure method and well it being Microsoft that isn’t the default choice.

Long story short…here’s how.

First you need to install the CA manager in AD and/or a 3rd party CA. We have a CA at work, so I used this form. You of course will need to replace with your info.

Save this into a file like notepad, name it like ‘fqdn.example.com.cnf’. I’ll write up more on this if someone requests this, but there are a billion howto’s on how to create these self signed certs and to get Windows setup on that.

Make sure you save yourself a copy of the CA-cert, as you will need this on every Linux host you plan on authenticating from.

Continue to Page 2

Start with a freshly installed copy of Windows 2008R2

Open up Server manager

Select Roles  –> Add Role Services –> Select Identity Management for UNIX

this should select all 3 boxes..ie make sure all 4 boxes are select..hit next, then finish.

You must reboot.  Reboot.

After the reboot and after logging back in…just sit at the desktop the installation will continue.  It should pop open server manager again, and finish the installation.

 

syswtestdss1sd.2008R2.local

2008R2.local

10.139.208.85

installing the DNS for domain 2008R2.local.  Since this domain was just a test, I added a local DNS server to the Windows host.  Configurate the domain in there..and had the UNIX boxes also use that for now.  Make sure PTR records are setup correctly.

 

 

 

 

To install Identity Management for UNIX components

  1. Open Server Manager. To open Server Manager, click Start, point to Administrative Tools, and then click Server Manager.
  2. In the tree pane, expand Roles.
  3. On the role home page for AD DS, in the Roles section, in the list of common tasks, click Add Role Services.
  4. On the Select Role Services page of the Add Role Services Wizard, select the Identity Management for UNIX role services that you want to install, and then click Next.
  5. If the wizard prompts you to install any other role services that are required by Identity Management for UNIX components, click Yes.
  6. After verifying your selections on the Confirm Installation Selections page, click Install.The computer must be restarted after the installation of Identity Management for UNIX finishes.

noteNote

You must be a member of the Administrators group on the local computer to install Identity Management for UNIX components.

Server Manager is available only to members of the Administrators group on the local computer. By default, Server Manager opens when an administrator logs on to the computer. You can open Server Manager from the Start menu, the Quick Launch bar, or from Administrative Tools.

 

Installing Identity Management for UNIX by using Windows PowerShell

You can use the Windows PowerShell set of cmdlets for Server Manager to install Identity Management for UNIX.

To install Identity Management for UNIX by using Windows PowerShell

  1. Open a Windows PowerShell session with elevated user rights. To do this, click Start, click All Programs, click Accessories, click Windows PowerShell, right-click the Windows PowerShell shortcut, and then click Run as administrator.
  2. Load the Server Manager module into the Windows PowerShell session before working with Server Manager cmdlets. Type the following, and then press Enter.Import-Module ServermanagernoteNoteWindows PowerShell cmdlets are not case-sensitive.
  3. Do one of the following.
    • To install all Identity Management for UNIX components, type the following, and then press Enter. Add-WindowsFeature ADDS-Identity-Mgmt -restart
    • To install only Password Synchronization, type the following, and then press Enter. Add-WindowsFeature ADDS-Password-Sync -restart
    • To install only Server for NIS, type the following, and then press Enter. Add-WindowsFeature ADDS-NIS -restart

    A restart of the computer is required when you install Identity Management for UNIX. The -restart parameter restarts the computer automatically after installation is complete.

    noteNote

    Add the -whatIf parameter to your command to instruct Server Manager to show the list of all software that is installed by default as a result of the command. Running the command with the -whatIf parameter does not result in an actual installation; the command results show only what would be installed by an actual installation.

 

Installing Identity Management for UNIX by using a command line

Server Manager command line tools allow you to install or remove roles, role services, or features in a Windows Command Prompt. Identity Management for UNIX can be installed by using the Server Manager line command because it is a role service of the Active Directory Domain Services role.

You can run the Server Manager line command, ServerManagerCmd.exe, from within any directory on the local computer. You must be a member of the Administrators group on the local computer to run the Server Manager command.

ImportantImportant

Because of security restrictions imposed by User Account Control in Windows Server 2008 R2, you must run ServerManagerCmd.exe in a Command Prompt window opened with elevated user rights. To do this, right-click the Command Prompt executable, or the Command Prompt object on the Start menu, and then click Run as administrator.

noteNote

Other parameters are available for this command, such as -restart, which automatically restarts the computer after installation if it is required by the programs you have installed. It is recommended that you read about additional Server Manager command line parameters in the topic “Overview of Server Manager Commands” in the Server Manager Help.

To install Identity Management for UNIX by using a command line

  1. Open a Command Prompt window with elevated user rights. To do this, click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator.
  2. Type one of the following, and then press ENTER.
    • ServerManagerCmd.exe -install ADDS-Identity-Management -restart to install all of Identity Management for UNIX
    • ServerManagerCmd.exe – install ADDS-NIS -restart to install Server for NIS
    • ServerManagerCmd.exe – install ADDS-Password-Sync -restart to install Password Synchronization

    A restart of the computer is required when you install Identity Management for UNIX. The -restart parameter restarts the computer automatically after installation is finished.

    noteNote

    Add the -whatIf parameter to your command to instruct Server Manager to show the list of all software that is installed by default by the command. Running the command together with the -whatIf parameter does not result in an actual installation. The command results show only what would be installed by an actual installation.

Setting up Password Synchronization for use with standalone UNIX-based hosts

Step
Reference

Check box

Read about Password Synchronization.

Overview of Password Synchronization

Check box

Log on as a member of both the Schema Administrators and Enterprise Administrators groups.

Check box

Install Password Synchronization on all Windows-based domain controllers. If the passwords of local accounts on a server are to be synchronized, install Password Synchronization on the server. If Windows domain passwords are to be synchronized, install Password Synchronization on all domain controllers.

Install Identity Management for UNIX Components

Check box

Set the password encryption key.

Setting the password encryption key

Check box

Change other settings, as needed.

Setting default synchronization; Setting computer-specific synchronization properties

Check box

Add UNIX-based computers with which passwords will be synchronized if they are not members of the Network Information Service (NIS) domain. For each computer, on the General tab of the Add Computer dialog box, clear the Synchronize password changes to this computer check box, select the Synchronize password changes from this computer check box, and then click OK. If you want to use non-default values, you can also specify values for the port number, encryption key, or both.

Adding or removing computers for synchronization

Check box

Ensure that the Password Synchronization configurations on all domain controllers in the domain are identical.

Configuring UNIX-based standalone hosts to work with Password Synchronization

Step
Reference

Check box

Install and configure the Password Synchronization single sign-on daemon (SSOD) on all UNIX-based computers with which passwords will be synchronized. Be sure to change the default encryption key in the sso.conf file to match the Password Synchronization encryption key set in previous steps before copying it to the UNIX-based computers.

Install the Password Synchronization daemon on UNIX-based computers

Check box

Specify which users have permissions to synchronize passwords.

Controlling password synchronization for user accounts

Check box

Start the Password Synchronization daemon.

Start or stop Identity Management for UNIX components

Check box

Install and configure the Password Synchronization PAM on all UNIX-based computers from which password changes are to be synchronized with Windows passwords.

Install the Password Synchronization pluggable authentication module

 

——————————————————————-

To add a bunch of hosts to the UNIX server manager for UNIX in MMC.

Create a text file called allhosts.txt; add all the hosts you want to add

,

,

 

hostname1

hostname2

hostname3

hostname4

.

.

Either copy this into a bat file or run it from command line. (carriage returns = 😉 Save it anything .bat, script.bat

for /f %%i in (%1) do (

psadmin add %%i)

 

To run it:  open command prompt; cd into your working directory; script.bat allhosts.txt

——————————————————————————-

You will need to make sure you also install the NIS  (Server for NIS)Role.  At first I didn’t think we needed this as we were not coming from a NIS environment, but this role adds the UNIX attribute tab to the Users Properties.  Without this you can’t assigned UNIX uid/gid/ home dirs, or login shell.

 

To use NIS:  open IDMU; select NIS right click and start service.  This service adds the NIS domain to the User props: UNIX attrib tab.

 

You will need to create a UNIX group first.  Create a group like normal, right click new, group.  come up with a new..I choose UNIXgroup (very creative).

Once that is created, right click on that and click the UNIX atrib tab.

NIS Domain:  Select your domain, ours test is 2008R2.

GID I choose 5000.  click ok

——————————————————-

Using Kerberos for UNIX/Linux directory and for authentication servvices.

 

Windows:  2008r2:  AD domain controller, DNS server, AD Services IDMU(make sure to include NIS)

Other Network File and Print services.  MS services for NFS

 

Linux:  krb5-libs, pam_krb5, and krb5-workstation.

—————————————————————————-

Novell SLES11 updates

vi /etc/ldap.conf

host 10.139.208.85
base dc=2008r2,dc=local
uri ldap://syswtssestdss1sd.2008dr2.local/
binddn syncuser@2008r2.local
bindpw P@ssword
scope sub
timelimit 120
bind_timelimit 120
idle_timelimit 3600
nss_initgroups_ignoreusers root,ldap
referrals no
ssl no
nss_base_passwd dc=2008r2,dc=local?sub
nss_base_shadow dc=2008r2,dc=local?sub
nss_base_group dc=2008r2,dc=local?sub?&(objectCategory=group)(gidnumber=*)
nss_map_objectclass posixAccount user
nss_map_objectclass shadowAccount user
nss_map_objectclass posixGroup group
nss_map_attribute uid sAMAccountName
nss_map_attribute homeDirectory unixHomeDirectory
nss_map_attribute gecos cn
nss_map_attribute shadowLastChange pwdLastSet
nss_map_attribute uniqueMember member
pam_login_attribute sAMAccountName
pam_filter objectclass=User
pam_password ad

—————————————————————-

/etc/sso.conf

ENCRYPT_KEY=]R;nuR=|=W}L7pj>@4hE

PORT_NUMBER=6677

SYNC_HOSTS=(10.139.208.85,6677,]R;nuR=|=W}L7pj>@4hE)

USE_NIS=0

———————————————————

copy the binary to /usr/local/bin/ssod

This needs to be running, create startup script that runs this.

_______________________________________

make sure your unix host is populated in IDMU password sync.

_______________________________

For testing since we are in a different domain, make sure /etc/hosts is updated with the syswtestdss1sd.2008r2.local and it’s IP.

————————————————–

update /etc/resolv.conf …this maybe just in test since they are different domains.