Difference between revisions of "UNIX and Windows Accounts in Zimbra LDAP and Zimbra Admin UI"

(ToDo)
(ToDo)
Line 23: Line 23:
 
* Fix creation of resources from the admin UI to work with the uidNumber attribute (you can provision them manually using zmprov as a workaround)
 
* Fix creation of resources from the admin UI to work with the uidNumber attribute (you can provision them manually using zmprov as a workaround)
 
* During new account creation, don't allow clicking of the finish button until user has filled out all required fields, including the posix and samba ones.  Or maybe put in some reasonable default values so the finish button does not raise an error.
 
* During new account creation, don't allow clicking of the finish button until user has filled out all required fields, including the posix and samba ones.  Or maybe put in some reasonable default values so the finish button does not raise an error.
 +
* UBUNTU: you will hit this bug after installing the ldap libraries for pam and nss [http://bugzilla.zimbra.com/show_bug.cgi?id=27848]
  
 
==How this guide is organized:==
 
==How this guide is organized:==

Revision as of 16:31, 27 May 2008

Introduction

This document describes how you can configure Zimbra Collaboration Server (ZCS) and Samba to act as a primary domain controller (PDC) that uses LDAP (Lightweight Directory Access Protocol) as a central password database for authenticating users on Linux and Windows desktops. The motivation behind this document is the need to seamlessly integrate ZCS into corporate network environment based entirely on Open Source server software. This functionality is achieved by configuring Zimbra LDAP to act as a central user database for PAM (Pluggable Authentication Modules), NSS (Name Service Switch), and for Samba's ldapsam password backend. The document also describes Zimbra Admin Extensions that allow managing OS and Samba accounts, groups and domains through Zimbra Admin UI.

The setup described in this document is not the only possible way to make Samba and Zimbra use the same user database for authentication. There are multiple other ways to achieve similar functionality, and it is recommended that you explore Zimbra WIKI at http://wiki.zimbra.com to see if another solution is a better fit for your needs. However, this solution is the only solution that allows network administrators to manage Windows user accounts and groups using Zimbra Admin UI. It is also highly recommended to get familiar with Zimbra, Samba, LDAP and PAM, before you start the installation. Particularly helpful are the following sources of information:

Intended audience

This document is intended mainly for network administrators who are faced with the task of integrating multiple OpenSource software packages to support a corporate network. The author assumes that the reader has basic knowledge of Linux/Unix OS, is capable of using a text editor and is at least vaguely familiar with Zimbra, Samba, LDAP and PAM. If these four words sound foreign to you, please take some time to look at the aforementioned sources of helpful information, or even better – have them open in separate tabs in Firefox on your second monitor while you are following the directions in this document ;)

ToDo

  • Write AJAX SMB client Zimlet to mail UI, http://freshmeat.net/projects/davenport/ sounds like a good option.
  • Add hooks to Zimbra Server to allow calling extensions when an account's password is changed and write an extension that will change Samba password hashes in LDAP (Solved by zimbraSambaPassword Extension - http://gallery.zimbra.com/gallery.php?act=viewProd&productId=71)
  • Make zimbra's password change update the NT password. (Solved by zimbraSambaPassword Extension - http://gallery.zimbra.com/gallery.php?act=viewProd&productId=71)
  • Fix creation of resources from the admin UI to work with the uidNumber attribute (you can provision them manually using zmprov as a workaround)
  • During new account creation, don't allow clicking of the finish button until user has filled out all required fields, including the posix and samba ones. Or maybe put in some reasonable default values so the finish button does not raise an error.
  • UBUNTU: you will hit this bug after installing the ldap libraries for pam and nss [1]

How this guide is organized:

Part 1 describes what software you need to download and install

Part 2 describes how to configure Zimbra LDAP and Zimbra Admin to store information required by Linux password backend and allow managing Samba and Posix accounts via Zimbra Admin.

Part 3 describes how to configure Samba server to use Zimbra LDAP as a source of user information and as a Primary Domain Controller

Part 4 describes how to configure a Linux server to use Zimbra LDAP as a central source of user information.

Part 1

Installing Zimbra

  1. First, Install Zimbra Collaboration Suite (it can be an Open Source or a Network Edition) following Zimbra Installation guides that you can download from the Zimbra website (http://www.zimbra.com/products/documentation.html). Make note of the root LDAP password that is selected during the installation, you will need it to configure ldapsam, pam_ldap and nss_ldap.
  2. If you have an existing functioning ZCS server, you can use it instead of a new one, but make sure to back up all your data and that you know your LDAP root password (this password was created during ZCS installation - can be found by running the command zmlocalconfig -s zimbra_ldap_password as zimbra user). This setup works with single- as well as with multi-server Zimbra setups.

Installing zimbra_posixaccount and zimbra_samba extensions for Zimbra Admin

  1. Extract files from /opt/zimbra/zimlets-admin-extra/zimbra_posixaccount.zip to a folder on your desktop computer, open zimbra_posixaccount folder and edit config_template.xml.
  2. Edit ldapSuffix property in config_template.xml. This property is the path in your LDAP tree where all Linux and Samba user information will be stored. This can be the name of your primary email domain written in the ldap syntax. E.g. if your domain is mycompany.com, then ldapSuffix will be

dc=mycompany,dc=com

in this example I will use the domain gregzimbra1.zimbra.com, which is the name of my Ubuntu Linux machine running inside a VMWare instance, hence my ldapSuffix is

dc=gregzimbra1,dc=zimbra,dc=com

  1. Edit uidBase property in config_template.xml. uidBase is the base for creating Linux user IDs for user accounts that will be stored in LDAP. The first account that you will create through Zimbra Admin UI will have user ID = uidBase+1. If you already have user accounts in your current password database (most likely /etc/passwd) it is recommended that you set this value higher than the maximum existing user account.
  2. Edit gidBase property in config_template.xml. gidBase is the base for creating Linux group IDs for groups that will be stored in LDAP. The first group that you will create through Zimbra Admin UI will have group ID = gidBase+1.
  3. Zip all the files that are in zimbra_posixaccount folder into zimbra_posixaccount.zip together with modified config_template.xml (make a flat zip file without folders)

cd zimbra_posixaccount zip zimbra_posixaccount *.*

  1. Log in to Zimbra Admin (https://yourserver.com:7071/zimbraAdmin) as administrator, navigate to Admin Extensions and deploy zimbra_posixaccount extension using the zimbra_posixaccount.zip file (refer to ZCS Admin Guide for more information about installing Admin Extensions)
  2. Extract files from /opt/zimbra/zimlets-admin-extra/zimbra_samba.zip to a folder on your desktop computer and open config_template.xml (this file is in zimbra_samba folder along with other extension files).
  3. Edit ldapSuffix, uidBase and gidBase properties using the same values as you used in for zimbra_posixaccount.zip
  4. Zip all the files zimbra_samba folder into zimbra_samba.zip together with modified config_template.xml into a flat ZIP file and deploy zimbra_samba Admin Extension.
  5. Reload your Zimbra Admin to initialize the extensions. When the extensions are loaded for the first time, they will check if OUs defined by ldapMachineSuffix and ldapGroupSuffix propertiesin config_template.xml files exist and create these OUs, if they do not exist.

Installing Samba

Install Samba 3 on a Linux/Unix box. I used Samba-3.0.28 which I built from sources on Ubuntu 6.06 server running inside a VMWare. If you are building Samba from sources, make sure to enable ldap support. I do not recommend installing Samba on the same machine where you installed Zimbra – better to use a separate machine. I built it with minimum options:

root@gregzimbra2:/home/ubuntu/samba-3.0.28# ./configure --with-pam --with-ldap
root@gregzimbra2:/home/ubuntu/samba-3.0.28# make
root@gregzimbra2:/home/ubuntu/samba-3.0.28# make isntall

You may choose the options depending on your needs.

Installing pam_ldap and nss_ldap

You need to install and configure PAM and NSS on the machine where you installed Samba. You can also install it on any Linux desktop that should use Zimbra LDAP as a user database, e.g. Linux desktops where you want to be able to log in using the same username/password that is used for Zimbra Mail.

You need to download and install pam_ldap and nss_ldap modules for your OS. I used Ubuntu Linux which has these modules available as Debian packages through Synaptic Package Manager. If you are using Synaptic Package Manager, make sure to enable community maintained repositories (see Settings->Repositories) and search for libpam-ldap and libnss-ldap packages. If you are using a different Linux, you might need to build these modules from the sources. You can find the Sources for pam_ldap and nss_ldap on http://www.padl.com.

I built and installed both pam_ldap and nss_ldap from the sources downloaded from http://www.padl.com. It take 5 minutes to download and build. If you are building from the sources, you need to edit the LDAP configuration file (ldap.conf) first. This file is in the source folder for both pam_ldap and nss_ldap. This is the contents of my ldap.conf file for both modules:

host gregzimbra1.zimbra.com
base dc=gregzimbra1,dc=zimbra,dc=com
binddn cn=config
bindpw test123
rootbinddn uid=zimbra,cn=admins,cn=zimbra
port 389
bind_policy soft
nss_reconnect_tries 2

If you do not know the bind password for user cn=config, you can retrieve it with this command as zimbra user:

zimbra@gregzimbra1:$ zmlocalconfig -s ldap_root_password

After editing ldap.conf file, create /etc/ldap.secret file and put the password for uid=zimbra,cn=admins,cn=zimbra user there. If you do not know the password for uid=zimbra,cn=admins,cn=zimbra user, you can get it with this command as zimbra user:

zimbra@gregzimbra1:& zmlocalconfig -s zimbra_ldap_password

Build pam_ldap with the following options:

root@gregzimbra2:/home/ubuntu/pam_ldap-184# ./configure --with-ldap-conf=./ldap.conf --with-ldap-secret=/etc/ldap.secret
root@gregzimbra2:/home/ubuntu/pam_ldap-184# make
root@gregzimbra2:/home/ubuntu/pam_ldap-184# make install

Build nss_ldap with the same options:

root@gregzimbra2:/home/ubuntu/nss_ldap-259# ./configure --with-ldap-conf=./ldap.conf --with-ldap-secret=/etc/ldap.secret
root@gregzimbra2:/home/ubuntu/nss_ldap-259# make
root@gregzimbra2:/home/ubuntu/nss_ldap-259# make install


If you are using Synaptic Package Manager to install libnss_ldap, you will be prompted for the following information:

  • LDAP server Uniform Resource Identifier – enter the LDAP URL of your Zimbra LDAP server. i.e. [ldap://zimbra.mydomain.com ldap://zimbra.mydomain.com/] (in my case ldap://gregzimbra1.zimbra.com/)
  • LDAP search base – enter the same value that you used for ldapSuffix property in zimbra_posixaccount and zimbra_samba extensions. I.e.: dc=yourdomain,dc=com (in my case dc=gregzimbra1,dc=zimbra,dc=com)
  • LDAP account for root – entercn=config
  • LDAP root account password – enter the LDAP root password that you selected during Zimbra installation (told you make a note of it ;) ) If you do not know the password for cn=config user, you can get it with this command as user zimbra:

zmlocalconfig -s ldap_root_password

If you are using Synaptic Package Manager to install libpam_ldap, you will be prompted for the following information:

  • LDAP Server – enter the hostname or IP address of your Zimbra LDAP server
  • root login account – enter uid=zimbra,cn=admins,cn=zimbra
  • root login password - enter the LDAP root password that you selected during Zimbra installation

Ubuntu uses 4 files

  • /etc/pam_ldap.conf
  • /etc/pam_ldap.secret
  • /etc/nss_ldap.conf
  • /etc/nss_ldap.secret

Just create a symlink for each of these files to /etc/ldap/ldap.conf and /etc/ldap/ldap.secret, so you have only 2 files to configure. Make sure /etc/ldap/ldap.secret is r------ and do not use binddn and bindpw as it is the same password as for rootdn, intstead add the 2 extra ACL in your slapd.conf.in file.

In RHEL5/CentOS5 both nss_ldap and pam_ldap modules are included in a single nss_ldap rpm package which is a part of base install. They can be configured using authconfig command line utility. (See Configuring pam_ldap and nss_ldap.)

Part 2

Configuring Zimbra LDAP

Please note:  upgrading Zimbra will overwrite any changes made to /opt/zimbra/conf/slapd.conf.in 
this will break any read permission changes made (as below).  
Backup slapd.conf.in prior to upgrade, and restore immediately after.

Before you can configure Zimbra LDAP you need to download nis.schema and samba.schema files.

  • If nis.schema file already exists in /opt/zimbra/openldap/etc/openldap/schema/ - skip to the next bullet, otherwise you need to download it. nis.schema file depends on your version of OpenLDAP. Therefore, the best way to get the correct nis.schema file is to download OpenLDAP source code from http://www.openldap.org/software/download/ for your version of OpenLDAP and take the nis.schema file from servers/slapd/schema folder in the source package. In this document I am using OpenLDAP 2.3.34 which is distributed with ZCS 4.5.4 for Ubuntu Linux.
  • samba.schema file depends on the version of Samba that you will be installing. Therefore, I recommend downloading Samba source package for the latest stable version of Samba available for your server's OS and taking samba.schema from examples/LDAP folder in the source package. In this document I am using Samba 3.0.24. In CentOS 5 it is here: /usr/share/doc/samba-3.0.23c/LDAP/samba.schema.

Log in to the shell on your Zimbra LDAP server. If you have a multi-server setup this is the machine where ldap service is running. Copy samba.schema and nis.schema files to /opt/zimbra/openldap/etc/openldap/schema/ (or wherever your OpenLDAP schema files are if you are using a different LDAP server). They should be chowned to zimbra account.

Next, edit /opt/zimbra/conf/slapd.conf.in file. Mind the .in suffix, the non-.in file is regenerated during restart. You need to add these the following two lines after the last “include” statement at the top of the file:

include "/opt/zimbra/openldap/etc/openldap/schema/nis.schema"

include "/opt/zimbra/openldap/etc/openldap/schema/samba.schema"

You may also want to add these ldap indexes after the other index statements:

#indexes for PAM

index uidNumber             eq
index gidNumber             eq
index memberUID             eq


#indexes for Samba

index sambaSID              eq
index sambaPrimaryGroupSID  eq
index sambaDomainName       eq

For these indices to take effect in an existing database (i.e., after an upgrade) it is advised that you run slapindex with the updated indexing configuration. slapd must be stopped, and /opt/zimbra/slapd.conf must have been rewritten to include the new indices (via ldap stop, ldap start, then ldap stop). You may also want to add the 2 following ACLs to allow pam to read the user config without obliging it to use the binddn and its password. The password is in clear in the ldap.conf file on the client machine and this file must be readable by all which creates a security issue (on zimbra the binddn password and rootdn password seem to be the same).

# only allow access to these attrs basically GAL/Postfix related attrs

access to dn.subtree="ou=people,dc=gregzimbra1,dc=zimbra,dc=com"
        by dn.children="cn=admins,cn=zimbra" write
        by * read

access to dn.subtree="ou=groups,dc=gregzimbra1,dc=zimbra,dc=com"
        by dn.children="cn=admins,cn=zimbra" write
        by * read

Note: the above lines may be too permissible, and could be more restrictive using attributes, but for now they will do.

an example of slapd.conf.in file is in ZimbraSamba.zip in examples/conf folder.

After you edited slapd.conf.in file and copied *.schema files to /opt/zimbra/openldap/etc/openldap/schema/, restart Zimbra services and make sure that they started successfully.

Now run the following zmprov commands as user zimbra:

>zmprov mcf +zimbraAccountExtraObjectClass posixAccount
>zmprov mcf +zimbraAccountExtraObjectClass sambaSamAccount

Part 3

Configuring Samba

There are many ways to configure Samba depending on what you needs are. In this example I will configure Samba to use Zimbra LDAP as password backend and to act as a primary domain controller for domain GREGZIMBRA1 and as a WINS server for my network. This configuration will allow Windows NT/XP/2000 workstations to join GREGZIMBRA1 domain as if it was an NT domain. Below is the /etc/samba/smb.conf file used in this example.

[global]
  workgroup = GREGZIMBRA1
  netbios name = gregzimbra2
  os level = 33
  preferred master = yes
  enable privileges = yes
  server string = %h server (Samba, Ubuntu)
  wins support =yes 
  dns proxy = no
  name resolve order = wins bcast hosts
  log file = /var/log/samba/log.%m
  log level = 3
  max log size = 1000
  syslog only = no
  syslog = 0
  panic action = /usr/share/samba/panic-action %d
  security = user
  encrypt passwords = true
  ldap passwd sync = yes
  passdb backend = ldapsam:ldap://gregzimbra1.zimbra.com/
  ldap admin dn = "cn=config"
  ldap suffix = dc=gregzimbra1,dc=zimbra,dc=com
  ldap group suffix = ou=groups
  ldap user suffix = ou=people
  ldap machine suffix = ou=machines
  obey pam restrictions = no
  passwd program = /usr/bin/passwd %u
  passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .
  domain logons = yes
  logon path = \\gregzimbra2.zimbra.com\%U\profile
  logon home = \\gregzimbra2.zimbra.com\%U
  logon script = logon.cmd
  add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
  add machine script = /usr/sbin/adduser --shell /bin/false --disabled-password --quiet --gecos "machine account" --force-badname %u
  socket options = TCP_NODELAY
  domain master = yes
  local master = yes
[homes]
  comment = Home Directories
  browseable =yes 
  read only = No
  valid users = %S
[netlogon]
  comment = Network Logon Service
  path = /var/lib/samba/netlogon
  guest ok = yes
  locking = no
[profiles]
  comment = Users profiles
  path = /var/lib/samba/profiles
  read only = No
[profdata]
  comment = Profile Data Share
  path = /var/lib/samba/profdata
  read only = No
  profile acls = Yes
[printers]
  comment = All Printers
  browseable = no
  path = /tmp
  printable = yes
  public = no
  writable = no
  create mode = 0700
[print$]
  comment = Printer Drivers
  path = /var/lib/samba/printers
  browseable = yes
  read only = yes
  guest ok = no

I will not attempt to explain every line in this file, so if you are interested – read the official Samba HOWTO. The key elements that are important for this example are these lines:

passdb backend = ldapsam:ldap://gregzimbra1.zimbra.com/
ldap admin dn = "cn=config"
ldap suffix = dc=gregzimbra1,dc=zimbra,dc=com
ldap group suffix = ou=groups
ldap user suffix = ou=people
ldap machine suffix = ou=machines


  • passdb backend = ldapsam:ldap://gregzimbra1.zimbra.com/ - tells Samba to use ldap as the password backend and to contact Zimbra LDAP server at [ldap://gregzimbra1.zimbra.com/].
  • ldap admin dn - LDAP DN of a user that Samba will use to bind to Zimbra LDAP. If you decide to change this value later, don't forget to rerun smbpasswd -w command which tells Samba the password to use for binding to LDAP.
  • ldap suffix - is the name of your Zimbra domain, and it is the same value as the value of ldapSuffix property in config_template.xml files.
  • ldap group suffix - is the same value as the value of ldapGroupSuffix in config_template.xml files.
  • ldap machine suffix - is the same value as the value of ldapMachineSuffix in config_template.xml files.
  • the value of ldap user suffix must be ou=people, because this is where Zimbra account records are stored in LDAP.

After you edited smb.conf file, you need to tell Samba what is the root password for ldap. On your Samba server, restart samba services (/usr/sbin/smbd and /usr/sbin/nmbd) run the following command (replace test123 with your ldap root password).

smbpasswd -w test123

You can use http://sourceforge.net/projects/ldapscripts for manage POSIX accounts (users, groups, machines) in an LDAP directory.

Creating Samba domain using Zimbra Admin UI

Restart Samba. Then, log in to Zimbra Admin an click on Samba Domains. You should see a domain entry in the list. When Samba started up with the new smb.conf file it should have looked up the domain entry in LDAP and created it if it could not find the entry.

Part 4

Configuring pam_ldap and nss_ldap

Edit /etc/nsswitch.conf file. Replace these two lines:

passwd: compat
group: compat

with these lines:

passwd files ldap
group files ldap

this change will tell nsswitch to use ldap when it looks for uids and gids. It will first look at /etc/passwd and then at ldap. You may want to change these lines differently if you know what you are doing ;)

Edit /etc/pam.d/common-account. It should look like the following:

account sufficient pam_unix.so
account sufficient pam_ldap.so

Edit /etc/pam.d/common-auth. It should look like the following:

auth sufficient pam_ldap.so
auth sufficient pam_unix.so

Edit /etc/pam.d/common-password. It should look like the following:

password sufficient pam_unix.so
password sufficient pam_ldap.so

Edit /etc/pam.d/common-session. It should look like the following:

session sufficient pam_unix.so
session sufficient pam_ldap.so

You may want to first add to the session section the following line to automatically create a home directory when the user login for the first time

session required pam_mkhomedir.so skel=/etc/skel umask=0077

Now you need to test whether pam_ldap and nssswitch are working correctly. Log in to Zimbra Admin UI (https://yourserver.com:7071/zimbraAdmin) as Administrator and create a couple of new user accounts. On the New Account Wizard you should see two additional steps (after “Advanced” step): Posix Account and Samba Account

Configuring on RHEL5/CentOS5/Fedora7 using authconfig

As root run authconfig --test. It will display current settings for both nss_ldap and pam_ldap. In most cases the following command will do the job (although some manual editing will still be needed):

authconfig --enableldap --enableldapauth --disablenis --enablecache \
           --ldapserver=gregzimbra1.zimbra.com --ldapbasedn=dc=gregzimbra1,dc=zimbra,dc=com \
           --updateall

The last parameter will update /etc/ldap.conf, /etc/nsswitch.conf and /etc/pam.d/system-auth configuration files. The only file which requires manual editing is /etc/ldap.conf.

The base line should be already there. It is inserted by authconfig. You should also see a uri line with the address of your ldap server. The host, binddn, bindpw, rootbinddn lines should be added as explained above and /etc/ldap.secret file should exist and contain a password.

The issue with a single /etc/ldap.conf configuration file for both nss_ldap and pam_ldap is that host and uri can work together in Zimbra-specific configuration only if we also add bind_policy soft option. The modified /etc/ldap.conf should look like this:

base dc=gregzimbra1,dc=zimbra,dc=com
host gregzimbra1.zimbra.com
# binddn uid=zimbra,cn=admins,cn=zimbra (pre 5.x)
binddn cn=config
bindpw test123
rootbinddn uid=zimbra,cn=admins,cn=zimbra
uri ldap://gregzimbra1.zimbra.com
bind_policy soft

nss_base_passwd ou=people,dc=gregzimbra1,dc=zimbra,dc=com?one
nss_base_shadow ou=people,dc=gregzimbra1,dc=zimbra,dc=com?one
# Replace the lines above with
# nss_base_passwd dc=gregzimbra1,dc=zimbra,dc=com?sub
# nss_base_shadow dc=gregzimbra1,dc=zimbra,dc=com?sub
# if you want to store windows computers account in LDAP
nss_base_group ou=groups,dc=gregzimbra1,dc=zimbra,dc=com?one
nss_base_hosts ou=machines,dc=gregzimbra1,dc=zimbra,dc=com?one


The last four lines are optional and are added to make the Zimbra nss_ldap setup compatible with the Webmin’s LDAP Client and LDAP Users and Groups modules. {The latter module would allow you to add secondary groups to your Zimbra/Samba accounts etc.)

Any additional lines added by authconfig would not hurt. However you shall have to re-check /etc/ldap.conf every time you run authconfig with –-update or -–updateall switch. If it sees the host line, the command disables it and moves the host address value to uri line. This breaks pam_ldap an Zimbra might even fail to start.

Creating Linux and Samba groups using Zimbra Admin UI

Log in to Zimbra Admin UI. You should not have logged out of it anyway, because we are not done yet. Go to Posix Groups and click “New”. If you do not know what to type in group type field – type 2, this is the default value.

To test if PAM on your Samba server is reading the group information correctly from Zimbra LDAP, go back to your Samba server shell and run this command as root:

>getent group

you should see the group(s) that you just created in the list that is produced.

Creating Linux and Samba users using Zimbra Admin UI

Back to the Zimbra Admin UI :). Go to Accounts and hit New, fill in the information on the first screen and follow the wizard to the Posix Account screen. Fill in all the required fields on the Posix Account screen and click Next to go to Samba Account screen. Fill in the required fields and click Finish. To test if PAM on your Samba server is reading the user password information correctly from Zimbra LDAP, go back to your Samba server shell and run this command as root:

 getent passwd

you should see the Zimbra accounts that you just created in the list. Create a home folder for the new Zmbra user and try to change the current user to the newly created one. In this example, I create a user ubuntu2, and home folder /home/ubuntu2

 root@gregzimbra2:/home/ubuntu# su - ubuntu2
 ubuntu2@gregzimbra2:~$ 

Now test if Samba authenticates your new user correctly. In this example I went to the shell on my Zimbra server box and ran this command (as root):

 smbclient -U ubuntu2 //gregzimbra2.zimbra.com/ubuntu2

It should prompt you for the password and then log in to ubuntu2's home folder on gregzimbra2 Samba server.

Next, log in to Zimbra Admin UI, click on Aliases and remove root@.gregzimbra1.zimbra.com alias. Then run

 smbpasswd -a root


To add posixAccount attributes to the previously established users (before ldap schema change) you can run command:

 zmprov ma admin@gregzimbra2.zimbra.com +objectClass posixAccount uidNumber 10003 gidNumber 10001 homeDirectory /home/admin loginShell /bin/bash

and for update sambaSamAccount run:

 zmprov ma admin@gregzimbra2.zimbra.com +objectClass sambaSamAccount sambaDomainName GREGZIMBRA1 sambaSID S-1-5-21-3745602466-621825477-2613676135-21006 sambaAcctFlags [UX]

Creating Windows NT Domain groups

Next, create “Domain Admins” group using Zimbra Admin UI, on Samba tab select Special Windows group type “Domain Admins”. Then you need to grant privileges to this group. Run the following command as root on your Samba server. Put your domain name instead of GREGZIMBRA1. More information on this topic is available in Official Samba HOWTO Reference Guide (http://us3.samba.org/samba/docs/man/Samba-HOWTO-Collection/).

 net rpc rights grant "GREGZIMBRA1\Domain Admins" SeAddUsersPrivilege SeMachineAccountPrivilege SePrintOperatorPrivilege

Adding Windows NT/2000/XP machines to Samba domain

Log in to an Windows desktop as a local administrator and join the Samba domain the same way you would be joining a Windows domain. You might need to point your Windows box to your Samba WINS server depending on how your DHCP and DNS servers are configured. Use a member of “Domain Admins” group to join the domain. After you joined the domain, verify that the machine account was added to ldap directory by running ldapsearch command. I.e. if your windows desktop machine name is gregvmxp2:

 root@gregzimbra1:/home/ubuntu# /opt/zimbra/openldap/bin/ldapsearch -h gregzimbra1 | grep gregvmxp
 # gregvmxp2$, machines, gregzimbra1.zimbra.com
 dn: uid=gregvmxp2$,ou=machines,dc=gregzimbra1,dc=zimbra,dc=com
 uid: gregvmxp2$
Verified Against: unknown Date Created: 4/20/2006
Article ID: https://wiki.zimbra.com/index.php?title=UNIX_and_Windows_Accounts_in_Zimbra_LDAP_and_Zimbra_Admin_UI Date Modified: 2008-05-27



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search