# Unable to set up PDC using Samba on FreeBSD 8



## datbytes (Jun 2, 2010)

Tried configuring a network on XP Pro/Samba Freebsd Server acting as PDC

Unable to connect the clients to the domain controller. If possible can you please tell me whats wrong

Samba User/machine accounts
Config of smb.conf ?

Any document which could solve the problem
Unable to find user accounts or passwords... 
RPC settings and setting on XP?


```
server# smbclient -L localhost -U%
Domain=[INET] OS=[Unix] Server=[Samba 3.0.37]

	Sharename       Type      Comment
	---------       ----      -------
	IPC$            IPC       IPC Service (Server)
	public          Disk      Public Stuff
	tmp             Disk      Temporary file space
	netlogon        Disk      Network Logon Service
Domain=[INET] OS=[Unix] Server=[Samba 3.0.37]

	Server               Comment
	---------            -------
	INET                 Server

	Workgroup            Master
	---------            -------
	INET                 INET
	W                    ADMIN-PC
```


```
server# testparm /usr/local/etc/smb.conf
Load smb config files from /usr/local/etc/smb.conf
Processing section "[homes]"
Processing section "[netlogon]"
Processing section "[Profiles]"
Processing section "[printers]"
Processing section "[tmp]"
Processing section "[public]"
Loaded services file OK.
Server role: ROLE_DOMAIN_PDC
Press enter to see a dump of your service definitions

[global]
	workgroup = INET
	netbios name = INET
	server string = Server
	log file = /var/log/samba/log.%m
	max log size = 50
	add user script = /usr/sbin/useradd %u
	delete user script = /usr/sbin/userdel %u
	add group script = /usr/sbin/groupadd %g
	delete group script = /usr/sbin/groupdel %g
	delete user from group script = /usr/sbin/deluser %u %g
	add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
	logon path = \\%L\Profiles\%U
	domain logons = Yes
	os level = 65
	domain master = Yes
	dns proxy = No
	wins support = Yes
	winbind trusted domains only = Yes

[homes]
	comment = Home Directories
	read only = No
	browseable = No

[netlogon]
	comment = Network Logon Service
	path = /usr/local/samba/lib/netlogon
	guest ok = Yes
	share modes = No

[Profiles]
	path = /usr/local/samba/profiles
	guest ok = Yes[align=left][/align]
	browseable = No

[printers]
	comment = All Printers
	path = /var/spool/samba
	printable = Yes
	browseable = No

[tmp]
	comment = Temporary file space
	path = /tmp
	read only = No
	guest ok = Yes

[public]
	comment = Public Stuff
	path = /home/samba
	write list = @staff
	read only = No
	guest ok = Yes
```


Regards,

Umar


----------



## SirDice (Jun 2, 2010)

datbytes said:
			
		

> Any document which could solve the problem


Did you see this: http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/samba-pdc.html


----------



## datbytes (Jun 2, 2010)

Hi,
  Thanks for the document. It clears what i am looking for.
But it still gives me the same problems.

I've tried adding a SMBPASSWD and added an account but unfortunately when i check it even i changed it through
vipw and put the desired variables "$" 
The XP says unable to logon unable to find username or password. Then when i tried doing the debug i saw that the account on WEBMIn console is still an user account. and when i try changing ti to a machine account
it says

```
Access control violation : The 'Workstation trust account' option cannot be enabled for existing users
```

So its taking alot of time and i am still nowhere
i've read so many websites and documents using all the things.



Hehe

Regards,


----------



## datbytes (Jun 2, 2010)

I've reconfigured all the accounts and machine accounts.

and it gives the same



```
Login Failure: Unable to find username or password
```


```
server# net join inet
Password:
Could not connect to server INET
The username or password was not correct.
Could not connect to server INET
The username or password was not correct.
Connection failed: NT_STATUS_LOGON_FAILURE
```


```
server# net user
Password:
Could not connect to server 127.0.0.1
The username or password was not correct.
Connection failed: NT_STATUS_LOGON_FAILURE
```

The closest thing is i managed to get the error unable to connect to thedomain RPC error.

____________________
Now its all gone


----------



## JimW (Jun 3, 2010)

Do you have the following in the *Global* section of your smb.conf file?...


```
security = USER
```

From your testparm output, it doesn't look like a security level is set.

Also.... have you joined the XP machines to the domain (from within the XP machines) prior to attempting a domain user login?


----------



## datbytes (Jun 3, 2010)

JimW said:
			
		

> Do you have the following in the *Global* section of your smb.conf file?...
> 
> 
> ```
> ...



Yes
I've set the Sercurity Level to user

and they do join a domain.

I think there is something wrong with the settings i suppose
the adduser smbpasswd and the machine account because when i tried first time with the 
`smbpasswd -a root`
account
it tried to connect but gave me the remote proceedure error.
So hopefully it was trying to run the add machine script in the config files.

I removed it but now its all gone not letting me in.

I have to restart the config proccess
...
I've checked the 
Webmin => Samba Sharing Server => Samba users and i've got manual user accounts with a tag of machine accounts.
still it says not found.

Cheers


----------



## JimW (Jun 3, 2010)

Are you restarting Samba and Winbindd every time you make a change to the config?

It seems as if you may be missing a step or incorrectly creating your user accounts. Post your actual smb.conf file instead of the testparm output.

Have you looked over the man page for smb.conf?

Maybe also read this article below. It is for Linux, but most of the steps you need to take are the same...

Link...

*Edit to add...*

I just noticed you mentioned Webmin. Is that what you are using to set this system up?

If so.... my personal opinion is that it is probably not the right way to go. Others may disagree, but I think you should do everything manually on the command line. Not with an interface like Webmin or Swat.


----------



## datbytes (Jun 3, 2010)

JimW said:
			
		

> Are you restarting Samba and Winbindd every time you make a change to the config?
> 
> It seems as if you may be missing a step or incorrectly creating your user accounts. Post your actual smb.conf file instead of the testparm output.
> 
> ...



Hi,
   Yes Certainly i do a smd service restart.
I tried to follow the man pages and how tos.
I've used it many times with workgroup options
I was trying to get a domain PDC and roaming profile structure
It messed up 
never connected once went through but gave me error remote proceedure error
i think it tried to use the script add user add machine which failed because of unix and then timedout i suppose
...
I'll get the reall config here and lts see
Ill be taking this issue to the lab for further test and trials
shouldnt say not if i can reach the 
	
	



```
web server/ftpserver,
```
 have the entry for the account which exists for a machine in the smbpass /etc/passwd :/ grr


----------



## klabacita (Jun 5, 2010)

U have the doc about samba+pdc with ldap, u can use that to start.

Samba

Last thing, I see this in your setup:


```
workgroup = INET
netbios name = INET
```

Is wrong in my opinion, u want to call your domain:INET and your machine the same, is wrong, change your netbios name to other like smbpdc.

Last thing, if u are starting to work with samba,start with a simple setup, remove the profiles and netlogon stuff, with less is best, once u understand how this piece of software works u can continue testing more settings.

See u.


----------



## datbytes (Jun 5, 2010)

klabacita said:
			
		

> U have the doc about samba+pdc with ldap, u can use that to start.
> 
> Samba
> 
> ...



Okay, I'll try.
I've changed the action plan and am taking the server into the lab for a new reinstall and everything inclusing IPtables/access bits. then lets see.
Because i did connected. but couldnt run the add user and add machine script so...
everything has messed up.
I'll try to change the PDC name string.


Regards,


----------

