Difference between revisions of "PDC"

From Amahi Wiki
Jump to: navigation, search
 
(70 intermediate revisions by 10 users not shown)
Line 1: Line 1:
open a terminal on your hda, or, if you use putty, open a connection to your hda.
+
== Please read this page carefully ==
First, backup your smb.conf file, in case you run into problems you can easily revert back.
+
Since we are getting several users with problems using "wrong" versions, please be aware that:
* cp /etc/samba/smb.conf /etc/samba/smb_old.conf
+
* Only the following versions of Windows will support connecting to a domain:
next we need to modify the smb file, i use nano for this, you may use any editor you feel confortable with
+
  Windows 2000 Professional
* nano /etc/samba/smb.conf
+
  Windows XP Professional
change the apropriate parts in the smb.conf
+
  Windows XP 64bit Professional
for convienence i'll post my complete smb.conf as a sample for you.
+
  Windows Vista business
=======================================================================
+
  Windows Vista Ultimate
;# This file is automatically generated any manual changes WILL BE OVERWRITTEN
+
  Windows 7 Professional
;# Amahi configuration, generated on Sun Jul 05 18:15:27 +0200 2009
+
  Windows 7 Enterprise
[global]
+
  Windows 7 Ultimate
workgroup = {YOUR_DOMAIN}
+
* Any Version of windows NOT listed is NOT supported
server string = PDC (%v)
+
* Mac OSX does support joining a windows network
netbios name = hda
+
* Linux supports samba shares
printing = cups
+
* Windows 7 needs tweaking:
printcap name = cups
+
Open Notepad Copy the following code into notepad:
load printers = yes
+
<pre>Windows Registry Editor Version 5.00
cups options = raw
+
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters]
log file = /var/log/samba/%m.log
+
"DNSNameResolutionRequired"<nowiki>=</nowiki>dword:00000000
max log size = 150
+
"DomainCompatibilityMode"<nowiki>=</nowiki>dword:00000001
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
+
 
 +
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Netlogon\Parameters]
 +
"Update"<nowiki>=</nowiki>"no"
 +
"DisablePasswordChange"<nowiki>=</nowiki>dword:00000000
 +
"MaximumPasswordAge"<nowiki>=</nowiki>dword:0000001e
 +
"RequireSignOrSeal"<nowiki>=</nowiki>dword:00000001
 +
"RequireStrongKey"<nowiki>=</nowiki>dword:00000001
 +
"SealSecureChannel"<nowiki>=</nowiki>dword:00000001
 +
"SignSecureChannel"<nowiki>=</nowiki>dword:00000001</pre>
 +
 
 +
*Save the file as a .reg NOT a .txt, and double-click it, select Run if asked to run or cancel, then windows will warn that you are adding things to the registry click yes as it is safe, then click ok, it will get entered into the registry.
 +
* Windows 7 issues / change log:
 +
** There is a warning kicked up that can be ignored. it complains about DNS not beeing set correctly. reboot and you are there
 +
** as of 06/02/2010 roaming profiles work under windows 7
 +
 
 +
== Making Amahi a PDC - Primary Domain Controller ==
 +
 
 +
*First you need to enable PDC options for the amahi server.
 +
to do this go to your dashboard, then select Setup, then Settings, then tick the box that says '''Advanched Features'''
 +
After you've done this go to '''Shares''' then '''Settings'''
 +
now you'll see the option called '''PDC''' enable it for Amahi to act as a windows PDC Server.
 +
 
 +
 
 +
* To '''join''' a machine to the domain, it has to be done by logging in once as [[Open_Terminal_as_root|root]]. Unfortunately, Amahi does not currently automatically create a root samba user. Type the following into terminal:
 +
 
 +
<pre>smbpasswd -a root
 +
smbpasswd -e root
 +
service smb restart
 +
service nmb restart</pre>
 +
 
 +
*This creates a user named root then it enables it, if your running Ubuntu 12.04 you will get a error saying smb: unrecogized service or nmb: unrecogized service, you can restart samba through the dashboard then Setup, then servers, click on Samba and click restart.
 +
 
 +
==Complete Domain Setup with A Windows Box==
 +
Thanks to obnox for explaining all this to robbiet480 who got his PDC working with the same directions<br>
 +
1. On the Windows Box
 +
* Windows 7 users need to use the registry script above
 +
* Go to network connections
 +
* Double click your main network connection
 +
* Open the TCP/IP properties window
 +
* Click advanced
 +
* go to the WINS tab
 +
* Add your Amahi IP to the list
 +
* force enable NetBIOS Name,  
 +
2. On the Amahi box
 +
* If you havent ran this already
 +
* Open a terminal (set the samba password for the root user. You need to remember this for later!):
 +
<pre>smbpasswd -a root
 +
smbpasswd -e root
 +
service smb restart
 +
service nmb restart</pre>
 +
* if your running Ubuntu 12.04 you will get a error saying smb: unrecogized service or nmb: unrecogized service, you can restart samba through the dashboard then Setup, then servers, click on Samba and click restart.
 +
3. Back to windows!
 +
* Open the System window by right clicking on My Computer in the Start Menu
 +
* Go to the "Computer Name" tab
 +
* Note down the Computer Name
 +
4. Back to Amahi!
 +
* Open a terminal
 +
sudo useradd -s /bin/false -d /dev/null ComputerNameNotedEarlier$
 +
sudo smbpasswd -a -m ComputerNameNotedEarlier
 +
* Remember the $ on the first line but not the second!
 +
* This code authorizes your computer to connect
 +
5. Back to windows again!
 +
* Open the System window by right clicking on My Computer in the Start Menu
 +
* Go to the "Computer Name" tab
 +
* Click Change
 +
* Type in the domain IN ALL CAPS (default domain name is 'WORKGROUP' this may not work but can be changed in your HDA dashboard, under Setup > Shares > Settings then click on the domain name )
 +
* Enter root username and password that you setup above / earlier.
 +
* Restart the computer
 +
* Login w/ your user or root from the Windows login screen.
 +
* You are done!
 +
 
 +
== How to Join a Domain with a Non-root User ==
 +
 
 +
 
  
;# below options are added to make amahi a pdc #
 
os level = 65
 
preferred master = yes
 
domain master = yes
 
local master = yes
 
domain logons = yes
 
logon path = \\hda\profiles
 
;automatically maps the home directory of the user, can be any drive letter you want. \\hda is the Samba server netbios name
 
logon drive = q:
 
logon home = \\hda\%u
 
;# end pdc options #
 
  
time server = yes
+
==== Old Development Notes ====
unix extensions = yes
 
veto files = /*.eml/*.nws/riched20.dll/*.{*}/
 
security = user
 
username map script = /usr/share/hda-platform/hda-usermap
 
large readwrite = yes
 
encrypt passwords = yes
 
dos charset = CP850
 
unix charset = UTF8
 
display charset =  LOCALE
 
guest account = nobody
 
map to guest = Bad User
 
wins support = yes
 
printer admin = root, @ntadmin, administrator
 
  
;# The homes share #
+
'''WARNING: These settings apply to the beta test only!!'''
[homes]
+
'''Other users see the old directives'''
read only = no
 
browseable = no
 
;# end [homes] #
 
  
;# The netlogon share required for domain logons #
+
Browse to your HDA dashboard.
[netlogon]
+
Select setup, then shares, then settings, then check PDC.
comment = Network Logon Service
+
now your new smb.conf is beeing generated!
path = /var/hda/domain-settings/netlogon
+
create the following file:
guest ok = yes
+
nano /var/hda/domain-settings/netlogon/logon.bat
writable = no
+
and add the following to it:
share modes = no
+
<pre>;Sync Windows clock with Samba clock
;# end [netlogon] #
+
net time /set /yes
 +
;Mount a samba share into x:
 +
net use u: \\hda\BACKUP /persistent:no
 +
net use v: \\hda\AFBEELDINGEN /persistent:no
 +
net use w: \\hda\DOCUMENTEN /persistent:no
 +
net use x: \\hda\SOFTWARE /persistent:no
 +
net use y: \\hda\VIDEOS /persistent:no
 +
net use z: \\hda\MUZIEK /persistent:no</pre>
  
;# The profiles share needed to store your roaming profiles #
+
save the file.
[Profiles]
+
next go to the workstation that you want to add to the domain.
comment = Roaming Profile Share
+
Select start, control panel, system, and click computer name.
path = /var/hda/domain-settings/profiles/%u
+
then select network-id and follow the wizard.
read only = No
+
when it asks you for a username/password, supply the root username/password you created on the PDC.
profile acls = Yes
+
This is needed because Windows will otherwise be unable to join the Domain.
;# [end profiles share] #
+
once windows welcomes you to the new domain, you can restart your computer, and login with any user you created through the hda tab!
 +
  
[print$]
+
---------
path = /var/lib/samba/drivers
 
read only = yes
 
force group = root
 
write list = @ntadmin root
 
force group = root
 
create mask = 0664
 
directory mask = 0775
 
guest ok = yes
 
  
[printers]
+
==== Old Directions ====
path = /var/spool/samba
 
writeable = yes
 
browseable = yes
 
printable = yes
 
public = yes
 
=======================================================================
 
  
 +
Open a terminal on your hda, or, if you use putty, open a connection to your hda.<br>
 +
Login as root:
 +
su -
 +
First, backup your smb.conf file, in case you run into problems you can easily revert back.<br>
 +
cp /etc/samba/smb.conf /etc/samba/smb_old.conf
 +
next we need to modify the smb file, i use nano for this, you may use any editor you feel confortable with
 +
nano /etc/samba/smb.conf
 +
change the apropriate parts in the smb.conf.<br>
 
Save your smb.conf  
 
Save your smb.conf  
  
 
So at this point we need to create the corresponding directories:
 
So at this point we need to create the corresponding directories:
- mkdir /var/hda/domain-settings
+
<pre>mkdir /var/hda/domain-settings
- mkdir /var/hda/domain-settings/netlogon
+
mkdir /var/hda/domain-settings/netlogon
* mkdir /var/hda/domain-settings/profiles
+
mkdir /var/hda/domain-settings/profiles</pre>
  
Each time you want a user to join the domain, a user needs to be added, this can be done through the users tab on the amahi dashboard.
+
Each time you want a user to join the domain, a user needs to be added, this can be done through the users tab on the amahi dashboard.<br>
aditionally, a profile directory needs to be created.
+
aditionally, a profile directory needs to be created.<br>
* mkdir /var/hda/domain-settings/profiles/nol
+
mkdir /var/hda/domain-settings/profiles/JanJacobs
nol is the user i created through the users tab of the amahi dashboard.
+
JanJacobs is the user i created through the users tab of the amahi dashboard.<br>
 
Since we are logging in as root, we need to change the ownership of the previously created directory to the corresponding owner:
 
Since we are logging in as root, we need to change the ownership of the previously created directory to the corresponding owner:
chown -R nol /var/hda/domain-settings/profiles/nol
+
chown -R JanJacobs /var/hda/domain-settings/profiles/JanJacobs
Now, this still doesnt allow us to login, because in samba, machines need to be added too!
+
Now, this still doesnt allow us to login, because in samba, machines need to be added too!<br>
 
this can be done automaticly, but for the time beeing we do it manually, amahi may facilitate this for you in the future.
 
this can be done automaticly, but for the time beeing we do it manually, amahi may facilitate this for you in the future.
* useradd -s /bin/false -d /dev/null computername$
+
useradd -s /bin/false -d /dev/null computername$
* smbpasswd -a -m computername
+
smbpasswd -a -m computername
Now as you can see there are some differences, when we added the Windows pc to Linux, we added the name computername$,  
+
Now as you can see there are some differences, when we added the Windows pc to Linux, we added the name computer name$,
this tells Linux that it is a machine, not a name. Next when we added the Samba password, we invoked the -m,  
+
this tells Linux that it is a machine, not a name.<br>
this again tells Samba that we are adding a pc, not a person.  
+
Next when we added the Samba password, we invoked the -m,  
Also, you probably noticed that it did not prompt for a password, it just added computername$.  
+
this again tells Samba that we are adding a pc, not a person.<br>
When you logon to the domain, Samba will read the password from your Windows password.
+
Also, you probably noticed that it did not prompt for a password, it just added computername$. <br>
 +
When you logon to the domain, Samba will read the password from your Windows password.<br>
 
Now that this done, all what is left to do is restart Samba,
 
Now that this done, all what is left to do is restart Samba,
this also has to be done for each computer you intend to login with.
+
this also has to be done for each computer you intend to login with.<br>
no we dont add the $ sign, since all we do is adding an existing linux user to the samba password file.
+
no we dont add the $ sign, since all we do is adding an existing linux user to the samba password file.<br>
we tell samba its a machine simply by adding the -m switch to the command.
+
we tell samba its a machine simply by adding the -m switch to the command.<br>
At this point i have network logins working, using roaming profiles.
+
At this point i have network logins working, using roaming profiles.<br>
  
 
now its time to restart samba.
 
now its time to restart samba.
* /etc/init.d/smb restart
+
/etc/init.d/smb restart
  
Now you need to  setup your Windows pc for domain logins.  
+
Now you need to  setup your Windows pc for domain logins.<br>
***Note the first time that you join a Samba domain from Windows, you will need to join the domain by using root as the name, and your root password for the password.  
+
(Note the first time that you join a Samba domain from Windows, you will need to join the domain by using root as the name, and your root password for the password.<br>
After rebooting, any valid user will be able to access the domain.
+
After rebooting, any valid user will be able to access the domain.)

Latest revision as of 02:19, 1 February 2019

Please read this page carefully

Since we are getting several users with problems using "wrong" versions, please be aware that:

  • Only the following versions of Windows will support connecting to a domain:
 Windows 2000 Professional
 Windows XP Professional
 Windows XP 64bit Professional
 Windows Vista business
 Windows Vista Ultimate
 Windows 7 Professional
 Windows 7 Enterprise
 Windows 7 Ultimate
  • Any Version of windows NOT listed is NOT supported
  • Mac OSX does support joining a windows network
  • Linux supports samba shares
  • Windows 7 needs tweaking:

Open Notepad Copy the following code into notepad:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters]
"DNSNameResolutionRequired"=dword:00000000
"DomainCompatibilityMode"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Netlogon\Parameters]
"Update"="no"
"DisablePasswordChange"=dword:00000000
"MaximumPasswordAge"=dword:0000001e
"RequireSignOrSeal"=dword:00000001
"RequireStrongKey"=dword:00000001
"SealSecureChannel"=dword:00000001
"SignSecureChannel"=dword:00000001
  • Save the file as a .reg NOT a .txt, and double-click it, select Run if asked to run or cancel, then windows will warn that you are adding things to the registry click yes as it is safe, then click ok, it will get entered into the registry.
  • Windows 7 issues / change log:
    • There is a warning kicked up that can be ignored. it complains about DNS not beeing set correctly. reboot and you are there
    • as of 06/02/2010 roaming profiles work under windows 7

Making Amahi a PDC - Primary Domain Controller

  • First you need to enable PDC options for the amahi server.

to do this go to your dashboard, then select Setup, then Settings, then tick the box that says Advanched Features After you've done this go to Shares then Settings now you'll see the option called PDC enable it for Amahi to act as a windows PDC Server.


  • To join a machine to the domain, it has to be done by logging in once as root. Unfortunately, Amahi does not currently automatically create a root samba user. Type the following into terminal:
smbpasswd -a root
smbpasswd -e root
service smb restart
service nmb restart
  • This creates a user named root then it enables it, if your running Ubuntu 12.04 you will get a error saying smb: unrecogized service or nmb: unrecogized service, you can restart samba through the dashboard then Setup, then servers, click on Samba and click restart.

Complete Domain Setup with A Windows Box

Thanks to obnox for explaining all this to robbiet480 who got his PDC working with the same directions
1. On the Windows Box

  • Windows 7 users need to use the registry script above
  • Go to network connections
  • Double click your main network connection
  • Open the TCP/IP properties window
  • Click advanced
  • go to the WINS tab
  • Add your Amahi IP to the list
  • force enable NetBIOS Name,

2. On the Amahi box

  • If you havent ran this already
  • Open a terminal (set the samba password for the root user. You need to remember this for later!):
smbpasswd -a root
smbpasswd -e root
service smb restart
service nmb restart
  • if your running Ubuntu 12.04 you will get a error saying smb: unrecogized service or nmb: unrecogized service, you can restart samba through the dashboard then Setup, then servers, click on Samba and click restart.

3. Back to windows!

  • Open the System window by right clicking on My Computer in the Start Menu
  • Go to the "Computer Name" tab
  • Note down the Computer Name

4. Back to Amahi!

  • Open a terminal
sudo useradd -s /bin/false -d /dev/null ComputerNameNotedEarlier$
sudo smbpasswd -a -m ComputerNameNotedEarlier
  • Remember the $ on the first line but not the second!
  • This code authorizes your computer to connect

5. Back to windows again!

  • Open the System window by right clicking on My Computer in the Start Menu
  • Go to the "Computer Name" tab
  • Click Change
  • Type in the domain IN ALL CAPS (default domain name is 'WORKGROUP' this may not work but can be changed in your HDA dashboard, under Setup > Shares > Settings then click on the domain name )
  • Enter root username and password that you setup above / earlier.
  • Restart the computer
  • Login w/ your user or root from the Windows login screen.
  • You are done!

How to Join a Domain with a Non-root User

Old Development Notes

WARNING: These settings apply to the beta test only!! Other users see the old directives

Browse to your HDA dashboard. Select setup, then shares, then settings, then check PDC. now your new smb.conf is beeing generated! create the following file:

nano /var/hda/domain-settings/netlogon/logon.bat

and add the following to it:

;Sync Windows clock with Samba clock
net time /set /yes
;Mount a samba share into x:
net use u: \\hda\BACKUP /persistent:no
net use v: \\hda\AFBEELDINGEN /persistent:no
net use w: \\hda\DOCUMENTEN /persistent:no
net use x: \\hda\SOFTWARE /persistent:no
net use y: \\hda\VIDEOS /persistent:no
net use z: \\hda\MUZIEK /persistent:no

save the file. next go to the workstation that you want to add to the domain. Select start, control panel, system, and click computer name. then select network-id and follow the wizard. when it asks you for a username/password, supply the root username/password you created on the PDC. This is needed because Windows will otherwise be unable to join the Domain. once windows welcomes you to the new domain, you can restart your computer, and login with any user you created through the hda tab!



Old Directions

Open a terminal on your hda, or, if you use putty, open a connection to your hda.
Login as root:

su -

First, backup your smb.conf file, in case you run into problems you can easily revert back.

cp /etc/samba/smb.conf /etc/samba/smb_old.conf

next we need to modify the smb file, i use nano for this, you may use any editor you feel confortable with

nano /etc/samba/smb.conf

change the apropriate parts in the smb.conf.
Save your smb.conf

So at this point we need to create the corresponding directories:

mkdir /var/hda/domain-settings
mkdir /var/hda/domain-settings/netlogon
mkdir /var/hda/domain-settings/profiles

Each time you want a user to join the domain, a user needs to be added, this can be done through the users tab on the amahi dashboard.
aditionally, a profile directory needs to be created.

mkdir /var/hda/domain-settings/profiles/JanJacobs

JanJacobs is the user i created through the users tab of the amahi dashboard.
Since we are logging in as root, we need to change the ownership of the previously created directory to the corresponding owner:

chown -R JanJacobs /var/hda/domain-settings/profiles/JanJacobs

Now, this still doesnt allow us to login, because in samba, machines need to be added too!
this can be done automaticly, but for the time beeing we do it manually, amahi may facilitate this for you in the future.

useradd -s /bin/false -d /dev/null computername$
smbpasswd -a -m computername

Now as you can see there are some differences, when we added the Windows pc to Linux, we added the name computer name$, this tells Linux that it is a machine, not a name.
Next when we added the Samba password, we invoked the -m, this again tells Samba that we are adding a pc, not a person.
Also, you probably noticed that it did not prompt for a password, it just added computername$.
When you logon to the domain, Samba will read the password from your Windows password.
Now that this done, all what is left to do is restart Samba, this also has to be done for each computer you intend to login with.
no we dont add the $ sign, since all we do is adding an existing linux user to the samba password file.
we tell samba its a machine simply by adding the -m switch to the command.
At this point i have network logins working, using roaming profiles.

now its time to restart samba.

/etc/init.d/smb restart

Now you need to setup your Windows pc for domain logins.
(Note the first time that you join a Samba domain from Windows, you will need to join the domain by using root as the name, and your root password for the password.
After rebooting, any valid user will be able to access the domain.)