Setup Samba Domain Controller with LDAP backend in Ubuntu 13.04

Posted by Unknown Rabu, 29 Mei 2013 0 komentar
http://www.unixmen.com/setup-samba-domain-controller-with-openldap-backend-in-ubuntu-13-04


We have already shown you how to install and configure a basic Samba server in our previous articles. Today i am gonna to show you how to install and configure samba domain controller with LDAP backend i.e the users created in LDAP server can login to your domain controller.
In this how-to tutorial, my test-box scenario is as follows:
Samba Hostname : server
Samba FQDN : server.unixmen.com
Ip Address : 192.168.1.200
The password i used wherever need is : ubuntu
Client : Windows 7 Professinal
IP Address : 192.168.1.50

Prerequisites

In order to continue, please make sure that you have installed and configured LDAP server properly. Navigate to this link to install and configure OpenLDAP in Ubuntu server 12.04 / 12.10 / 13.04.
Make sure that you have added the hostname in the /etc/hosts file as shown below.
sk@server:~$ sudo vi /etc/hosts
127.0.0.1       localhost
192.168.1.200   server.unixmen.com      server

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
For the testing purpose, I did a fresh installation of both Ubuntu 13.04 server and Windows 7 professional. Already installed OS might not be worked as you expected. Though it tested under Ubuntu, it may work on Debian too. It is not the full fledged how-to, but it should meet your requirements. Due to lack of resources, i tested this under Oracle VirtualBox. It is worked for me as i expected. I can’t issue any assurance that this will work for you. Well let me go further.

LDAP Authentication

Install libnss-ldap package to enable LDAP authentication.
sk@server:~$ sudo apt-get install libnss-ldap
Enter your LDAP server FQDN as shown below and click Ok.
sk@server: ~_001
Enter the name of the LDAP search base.
sk@server: ~_002
Select the LDAP version and Click Ok.
sk@server: ~_003
Select Yes.
sk@server: ~_004
Disable LDAP database login by clicking No.
sk@server: ~_005
Enter the LDAP root privileged account name and LDAP suffix as shown below.
sk@server: ~_006
Enter LDAP admin account password which you have created early while installing OpenLDAP.
sk@server: ~_007
Then run the following commands to setup the LDAP profile for NSS and inform your system to use it for authentication.
sk@server:~$ sudo auth-client-config -t nss -p lac_ldap
sk@server:~$ sudo pam-auth-update
sk@server: ~_009

Samba Installation

Now install samba packages using the following command.
sk@server:~$ sudo apt-get install samba samba-doc smbldap-tools
Import samba schema into LDAP.
sk@server:~$ sudo cp /usr/share/doc/samba-doc/examples/LDAP/samba.ldif.gz /etc/ldap/schema/
sk@server:~$ sudo gzip -d /etc/ldap/schema/samba.ldif.gz
sk@server:~$ sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/samba.ldif
adding new entry "cn=samba,cn=schema,cn=config"
Create a file called samba_indices.ldif and add the contents as shown below.
sk@server:~$ sudo vi /etc/ldap/schema/samba_indices.ldif
dn: olcDatabase={1}hdb,cn=config
changetype: modify
add: olcDbIndex
olcDbIndex: uidNumber eq
olcDbIndex: gidNumber eq
olcDbIndex: loginShell eq
olcDbIndex: uid eq,pres,sub
olcDbIndex: memberUid eq,pres,sub
olcDbIndex: uniqueMember eq,pres
olcDbIndex: sambaSID eq
olcDbIndex: sambaPrimaryGroupSID eq
olcDbIndex: sambaGroupType eq
olcDbIndex: sambaSIDList eq
olcDbIndex: sambaDomainName eq
olcDbIndex: default sub
Now import it using the following command.
sk@server:~$ sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/samba_indices.ldif
modifying entry "olcDatabase={1}hdb,cn=config"
Open the smbldap.conf and smbldap_bind.conf files and edit them with your LDAP settings as shown below.
sk@server:~$ sudo cp /usr/share/doc/smbldap-tools/examples/smbldap.conf.gz /etc/smbldap-tools/
sk@server:~$ sudo cp /usr/share/doc/smbldap-tools/examples/smbldap_bind.conf /etc/smbldap-tools/
sk@server:~$ sudo gzip -d /etc/smbldap-tools/smbldap.conf.gz
Find the following lines and make the changes as shown below. Before doing this, get your samba domain SID using the following command.
sk@server:~$ sudo net getlocalsid
SID for domain SERVER is: S-1-5-21-3102374607-2088646784-3588851380
Note down the SID. We have to enter it in the smbldap.conf file.
sk@server:~$ sudo vi /etc/smbldap-tools/smbldap.conf
[...]
SID="S-1-5-21-3102374607-2088646784-3588851380" ## Replace with your Domain SID ##
sambaDomain="UNIXMEN"  ## Enter your Domain name ##
#slaveLDAP="ldap://ldap.example.com/"  ## Make it comment, we don't have slave LDAP ##
masterLDAP="ldap://server.unixmen.com/"  ## Enter your LDAP Domain name ##
ldapTLS="0" ## We don't use TLS, so set it to "0" ##
verify="none"  ## Set it to "none"
clientcert="/etc/smbldap-tools/smbldap-tools.unixmen.com.pem"
clientkey="/etc/smbldap-tools/smbldap-tools.unixmen.com.key"
suffix="dc=unixmen,dc=com"
userSmbHome="\\SERVER\%U"   ## Set your host name here ##
userProfile="\\SERVER\profiles\%U"  ## Set your host name here ##
userHomeDrive="H:"  ## Set your Home drive ##
mailDomain="unixmen.com"
[...]
Open smbldap_bind.conf file and make the changes as shown below.
sk@server:~$ sudo vi /etc/smbldap-tools/smbldap_bind.conf
[...]
#slaveDN="cn=Manager,dc=example,dc=com"  ## make it comment. we don't have a slave LDAP ##
#slavePw="secret"  ## Make it comment ##
masterDN="cn=admin,dc=unixmen,dc=com"  ## Enter LDAP admin username and LDAP suffixes ##
masterPw="ubuntu"  ## Enter LDAP root administrative account password ##
Now enter the command to populate LDAP database.
sk@server:~$ sudo smbldap-populate
Populating LDAP directory for domain UNIXMEN (S-1-5-21-3102374607-2088646784-3588851380)
(using builtin directory structure)
entry dc=unixmen,dc=com already exist.
adding new entry: ou=Users,dc=unixmen,dc=com
adding new entry: ou=Groups,dc=unixmen,dc=com
adding new entry: ou=Computers,dc=unixmen,dc=com
adding new entry: ou=Idmap,dc=unixmen,dc=com
adding new entry: sambaDomainName=UNIXMEN,dc=unixmen,dc=com
adding new entry: uid=root,ou=Users,dc=unixmen,dc=com
adding new entry: uid=nobody,ou=Users,dc=unixmen,dc=com
adding new entry: cn=Domain Admins,ou=Groups,dc=unixmen,dc=com
adding new entry: cn=Domain Users,ou=Groups,dc=unixmen,dc=com
adding new entry: cn=Domain Guests,ou=Groups,dc=unixmen,dc=com
adding new entry: cn=Domain Computers,ou=Groups,dc=unixmen,dc=com
adding new entry: cn=Administrators,ou=Groups,dc=unixmen,dc=com
adding new entry: cn=Account Operators,ou=Groups,dc=unixmen,dc=com
adding new entry: cn=Print Operators,ou=Groups,dc=unixmen,dc=com
adding new entry: cn=Backup Operators,ou=Groups,dc=unixmen,dc=com
adding new entry: cn=Replicators,ou=Groups,dc=unixmen,dc=com
Please provide a password for the domain root:
Changing UNIX and samba passwords for root
New password:   ## Enter Password ##
Retype new password:   ## Re-enter password ##
Now check the LDAP database for samba groups.
sk@server:~$ sudo getent group
[...]
Domain Admins:*:512:root
Domain Users:*:513:
Domain Guests:*:514:
Domain Computers:*:515:
Administrators:*:544:
Account Operators:*:548:
Print Operators:*:550:
Backup Operators:*:551:
Replicators:*:552:

Configuring Samba

Open samba main configuration file smb.conf and make the changes as shown below.
sk@server:~$ sudo cp /usr/share/doc/smbldap-tools/examples/smb.conf.example /etc/samba/smb.conf
sk@server:~$ sudo vi /etc/samba/smb.conf
[global]
workgroup = UNIXMEN  ## Your domain Name ##
netbios name = SERVER  ## Samba server Host name ##

deadtime = 10
log level = 1
log file = /var/log/samba/log.%m
max log size = 5000
debug pid = yes
debug uid = yes
syslog = 0
utmp = yes

security = user
domain logons = yes
os level = 64
logon path =
logon home =
logon drive = H:  ## Logon drive ##
logon script =

passdb backend = ldapsam:"ldap://server.unixmen.com/"  ## Samba server FQDN ##
ldap ssl = off ## Set to off to disable SSL
ldap admin dn = cn=admin,dc=unixmen,dc=com  ## LDAP admin account and LDAP suffixes ##
ldap delete dn = no

# Sync UNIX password with Samba password
## Method 1:
ldap password sync = yes
## Method 2:
;ldap password sync = no
;unix password sync = yes
;passwd program = /usr/sbin/smbldap-passwd -u '%u'
;passwd chat = "Changing *\nNew password*" %n\n "*Retype new password*" %n\n"

ldap suffix = dc=unixmen,dc=com  ## LDAP suffix ##
ldap user suffix = ou=Users
ldap group suffix = ou=Groups
ldap machine suffix = ou=Computers
ldap idmap suffix = ou=Idmap

add user script = /usr/sbin/smbldap-useradd -m '%u' -t 1
rename user script = /usr/sbin/smbldap-usermod -r '%unew' '%uold'
delete user script = /usr/sbin/smbldap-userdel '%u'
set primary group script = /usr/sbin/smbldap-usermod -g '%g' '%u'
add group script = /usr/sbin/smbldap-groupadd -p '%g'
delete group script = /usr/sbin/smbldap-groupdel '%g'
add user to group script = /usr/sbin/smbldap-groupmod -m '%u' '%g'
delete user from group script = /usr/sbin/smbldap-groupmod -x '%u' '%g'
add machine script = /usr/sbin/smbldap-useradd -w '%u' -t 1

[NETLOGON]
path = /var/lib/samba/netlogon
browseable = no
share modes = no

[PROFILES]
path = /var/lib/samba/profiles
browseable = no
writeable = yes
create mask = 0611
directory mask = 0700
profile acls = yes
csc policy = disable
map system = yes
map hidden = yes
Finally restart the samba services.
sk@server:~$ sudo /etc/init.d/smbd restart
sk@server:~$ sudo /etc/init.d/nmbd restart
sk@server:~$ sudo smbpasswd -w ubuntu
Setting stored password for "cn=admin,dc=unixmen,dc=com" in secrets.tdb

Configuring LAM

It is possible to create LDAP users from command line and it is a bit of difficult. So here i am using LAM(LDAP Account Manager) to get things done much easier and simpler.
LAM, Ldap Account Manager is a GUI tool is used to manage LDAP server. For more about LAM visit the offcial website.
To install LAM, enter the following command in terminal.
sk@server:~$ sudo apt-get install ldap-account-manager
Now you can access the LAM from the browser using “http://ip-address/lam. The default password for lam administrative account is “lam”. You can change it if you wish.
LDAP Account Manager - Mozilla Firefox_019
Before login to lam, we must enter our LDAP admin user name and LDAP suffix in lam configuration file. To do so click on the LAM configuration on the right cornet of  lam main console.
Configuration overview - Mozilla Firefox_020
Click on Edit Server Profiles and enter the default password i.e lam.
Login - Mozilla Firefox_021
Enter the LDAP suffix and admin account details “cn=admin,dc=unixmen,dc=com” in the General Settings page.
LDAP Account Manager Configuration - Mozilla Firefox_022
LDAP Account Manager Configuration - Mozilla Firefox_023
Navigate to Account Types page and enter the LDAP suffix details as mentioned above and click Save.
LDAP Account Manager Configuration - Mozilla Firefox_024
Now you can login to lam using the LDAP root account password.
LDAP Account Manager - Mozilla Firefox_025
Click on Create button to create new suffixes.
LDAP Account Manager (localhost:389) - Mozilla Firefox_026

Creating Users and Groups

Now let us create a sample group called “test” and a sample user called “senthil”.

Create Group

Click on the New Group in the group section. Enter the group name and click save.
LDAP Account Manager (localhost:389) - Mozilla Firefox_027
LDAP Account Manager (localhost:389) - Mozilla Firefox_028

Create users

Click on the New User button in the Users section. In the personal tab, enter first name, last name and address details etc.
LDAP Account Manager (localhost:389) - Mozilla Firefox_034
In the Unix tab, enter the user name, home directory etc.
LDAP Account Manager (localhost:389) - Mozilla Firefox_035
Now Navigate to Samba 3 tab and click Add Samba 3 extension. Here you can set password expiration details, account deactivation and disabled details, home drive details and so on.
LDAP Account Manager (localhost:389) - Mozilla Firefox_036
And finally click on the Set Password tab on the upper side and set the password for the new user and click Save.
LDAP Account Manager (localhost:389) - Mozilla Firefox_037
Thats it. We have created users and groups now.

Testing Samba Domain controller

Now try to join the samba domain from windows client using the newly created user.
Enter your samba domain name in the Domain field and Click Ok.
Windows 7 [Running] - Oracle VM VirtualBox_011
Enter you samba user name and password which you have created in the earlier steps.
Windows 7 [Running] - Oracle VM VirtualBox_038
Oops!! Error !! You may get an error like as shown below if you have windows 7 client.
“The specified domain either does not exist or could not be contacted”
Windows 7 [Running] - Oracle VM VirtualBox_013

Resolution 1:

To get rid of this error, Open the windows registry. Goto HKEY_LOCAL_MACHINE  -> SYSTEM -> CurrentControlSet -> Services -> LanmanWorkstation -> Parameters.
Windows 7 [Running] - Oracle VM VirtualBox_015
Create a new two DWORD values called “DomainCompatibilityMode” and “DNSNameResolutionRequired”. And set values for “DomainCompatibilityMode” as 1(one) and DNSNameResolutionRequired” as 0(zero).
Windows 7 [Running] - Oracle VM VirtualBox_016
Now try again to join to samba domain.
Again you may get an error like as shown below.
“Logon failure: Unknown user name or bad password”
Windows 7 [Running] - Oracle VM VirtualBox_017
This means that we didn’t add and enable the samba users yet. Here is the tip what i did to get rid of this error using the following command.

Resolution 2:

sk@server:~$ sudo smbpasswd -a senthil
New SMB password:
Retype new SMB password:
Added user senthil.
sk@server:~$ sudo smbpasswd -e senthil
Enabled user senthil.
Note: The command “smbpasswd -a username” is used to add a samba user and “smbpasswd -e username” is used to enable the samba user. Both are different commands, don’t get confuse.
Now let us try again. Now also i got an error like as shown below.
“The join operation was not successful.This could be because an existing computer account having name “admin-PC” was previously created using a different set of credentials. Use a different computer name or contact your system administrator to remove any stale conflicting account. The error was:
Access denied.”
Windows 7 [Running] - Oracle VM VirtualBox_039

Resolution 3:

Here it is what i did to solve the above error. Open the terminal and enter the following command.
sk@server:~$ sudo net sam rights grant senthil SeMachineAccountPrivilege
[sudo] password for sk:
Granted SeMachineAccountPrivilege to UNIXMEN\senthil
Here senthil is my samba user name.
Let us try again to join to samba domain. Boom!! yes it worked now.
Windows 7 [Running] - Oracle VM VirtualBox_040
Restart the windows machine and you will able to login to samba domain now.
Note: I don’t know why this too much of difficulties to add a Windows 7 client to domain controller. If anybody know a fix, share it in the comment section. The first time only i did these resolutions to join to samba domain. For the rest of the new users, it is not necessary to do all those resolutions. Simply i created the users in LAM and it can join to the domain without any problems. If i find a way around for this bug, i will update the same.

Baca Selengkapnya ....

Unboxing of the BlackBerry Q10-2014

Posted by Unknown Selasa, 28 Mei 2013 0 komentar
In this video you can see the unboxing of blackberry Q10
its an amazing phone the blackberry Q10 
will kill Iphone 5 and samsung galxy s4



Baca Selengkapnya ....

What Should you do if your phone fell in water ?

Posted by Unknown Senin, 27 Mei 2013 0 komentar
This is some  of steps that you should undertake if your phone fell in the water or tea 

to avoid doing other things, will lead to the destruction of your phone follow the following steps ....
1. Do not try to run the phone to know if it works or not, this is the main reason for the destruction of your phone, what you have to do is scan your phone and try to dry the water.
2. If you can remove the back cover of the phone to remove the battery do so and if you can not no problem.
3. Take the phone and the battery and put them in a bowl of rice and close the container and leave it like this, and this is not the best way to dry the phone but rice has a high strength in the absorption of water and is available at any time.
4. Leave the phone on this case for 24 hours and then remove the phone battery .mode again and turn it.
5. Then there are two possibilities: either the device works, but if you do not see anything on the screen do change this screen and less losses The other possibility could be that the device does not work, what you need to do is take it to the nearest place specializes in repairing phones.
☻ Show This video illustrates:



Baca Selengkapnya ....

Micromax A110Q Canvas 2 a new phone with high specification

Posted by Unknown 0 komentar
The Micromax Indian Company announced  on  version of the new phone "Micromax A110Q Canvas 2", which comes with a big-screen size 5 inches of quality screens "FWVGA" where you view the contents of the graphics and texts written purity equal to
 (480 * 854 )pixels technology display the "IPS" which allows vision more clearly.Phone and quad-core processing unit of the type "MT6589" and comes with an internal memory capacity of 4 GB of RAM "RAM" with a capacity of 1 GB, the phone also supports the operating system software and applications Android "Jellybean 4.2"Has been providing electrical battery with a capacity equal to 2,000 mAh in addition to the rear camera accurately pictorial equal to 8 mega pixel camera with flash "LED Flash" to help capture images in places insufficient lighting in addition to the other front camera 2 mega pixel camera.
32VY47BUVF8D


Baca Selengkapnya ....

IPhone5 come with price 99 dollar only

Posted by Unknown 0 komentar
To every fan of apple  we quote you some rumors contained on the New iPhone 5 that   Made of plastic to be at a low price, which is expected to come in  a variety of colors, including gold, orange, white, gray, pink, green, and blue as well as yellow.This is based on the report, that come from  Japanese blog Macotakara and  apple working   to produce 1000 phone of low cost iPhone and will appear in next june  for tests , and scheduled to be announced officially by Apple in September 2013 and will be sold in markets including approximately $ 99 or $ 149.

Baca Selengkapnya ....

News of the new Nokia Phone Lumia 925

Posted by Unknown Minggu, 26 Mei 2013 0 komentar
Hi all of our blog visitors we come to day with news of the new Nokia Phone Nokia Lumia 925 which comming soon lets see the features.

Features of Nokia Lumia 925
 


1.Low-light photos never looked this good.
Award-winning PureView technology, Carl Zeiss optics and six physical lenses. Nokia Lumia 925 lets you capture the great moments, day or night. And the beautifully crafted design will turn heads wherever you go.
2.Nokia Lumia 925 smart Camera. Unleash your creativity.

Spend less time planning the shot. Nokia Lumia 925 Smart Camera mode lets you take a burst of photos, and then go back later and choose the story you want to tell.

3.All the action in a one photo.
Capture more of the action than your eyes can see. The Action Shot feature in Nokia Lumia 925 Smart Camera lets you snap once to get a sequence of movements in a single high-quality image.
4.Control the shot.

No more random people walking through your scene. The Remove Moving Object feature in Nokia Lumia 925 Smart Camera lets you erase unwanted details to get your picture looking just the way you want.
5.Put a smile on everyone's face.

Get all friends at their best with the Change Faces feature in Nokia Lumia 925 Smart Camera, which lets you combine your favorite expressions from a series of shots into a single perfect group photo.
Source:NOKIA

More about Nokia NEws :Nokia 

Baca Selengkapnya ....

The strangest covers for your iPhone5 in world

Posted by Unknown Kamis, 23 Mei 2013 0 komentar
To maintain your iPhone 5 , with a touch of fun in and out of the ordinary.
The   iPhone 5 has hundreds of dollars, is inviting you to maintain it, but instead of owning a traditional cover you can delinquency little crazy with these designs.




1 - When you see this cover may initially u think a classic book or an old dictionary for a language, but it is only a cover for   "iPhone" and looks very idea of ​​authenticity.

       

2 - If you prefer an elegant and useful cover, it suits this cover, who also works agency calculator.



3 - If you're nostalgic for years to the eighties and the era in which it was carrying the huge radio youth over their shoulders, Senaspk this cover but, of course, will not carry over the shoulder.


 


4 - painters and lovers paintings Sajbhm of this cover is divided into squares of different colors surrounding a feather fee.








5 - cover is useful if you do a lot of soft drinks, or that you need a key to disarm the cover.





6 - Do you miss mobile "Nokia" old? If you are of them, this will activate you cover a lot of memories.



7 - Many of us was using the Game Boy in the childhood years, some companies decided to cover innovation mentions this generation these days. 
8 - the cover of a festive nature come out of it the green light, and fits the phone "iPhone".



 9 - cover for lovers of sweets, especially cake pieces, may cause hunger to one of them, but the idea will attract many.


10 - Cover Good if you want to make your phone disguised camera.


What do you think of these covers??




Baca Selengkapnya ....
Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android japan.