<?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-2666170339866438578</id><updated>2026-08-09T01:10:59.066+12:00</updated><category term="Linux"/><category term="python"/><category term="perl"/><category term="VirtualBox"/><category term="bash"/><category term="Fedora"/><category term="Oracle Virtual Machine"/><category term="active directory"/><category term="dd"/><category term="isoinfo"/><category term="md5sum"/><category term="openSuSE"/><category term="php"/><category term="samba4"/><category term="sha1sum"/><category term="Apache"/><category term="Firewall"/><category term="Linux Security"/><category term="MySQL"/><category term="Oracle Virtual Server"/><category term="Pana"/><category term="Reverse Proxy"/><category term="Social networking"/><category term="Virtualisation"/><category term="amarok 1.4"/><category term="blogger"/><category term="dnsmasq"/><category term="driver"/><category term="extend"/><category term="facebook"/><category term="high availability"/><category term="iPod"/><category term="iptables"/><category term="mod_python"/><category term="python web-service"/><category term="ssh"/><category term="sysadmin"/><category term="verify"/><category term="yubico"/><category term="yubikey"/><category term=".NET"/><category term="ASUS USB-N10 Nano"/><category term="Active State"/><category term="Audio Books"/><category term="Braodcom 10G Nic"/><category term="Charity"/><category term="Cluster"/><category term="Clusters"/><category term="Customers"/><category term="DELL PowerEdge M620"/><category term="Document Editing"/><category term="F2200"/><category term="F2280"/><category term="Fedora 14"/><category term="IBM"/><category term="Images in wxPython"/><category term="InnoDB"/><category term="Internet"/><category term="Jargon"/><category term="Kernel"/><category term="LAB"/><category term="Latex"/><category term="MYISAM"/><category term="MediaWiki"/><category term="Microsoft PPTP VPN"/><category term="Multiple Volumes"/><category term="Music Player"/><category term="NAT"/><category term="Network Storage"/><category term="OVM"/><category term="OVS"/><category term="Openfiler"/><category term="Oracle XE"/><category term="Password"/><category term="Payment Gateways"/><category term="Pod Cast"/><category term="Redhat"/><category term="Redhat Kickstart"/><category term="SAN"/><category term="SQL Server 2008"/><category term="SSLv3"/><category term="Scite"/><category term="Structured Documents"/><category term="Support Group"/><category term="TCP Printing Services"/><category term="USB"/><category term="VMWare"/><category term="Vista"/><category term="WiFi"/><category term="Windows Comand Line"/><category term="Windows Server 2008"/><category term="Windows XP"/><category term="accidental photo"/><category term="authentication"/><category term="bash progress bar"/><category term="canon"/><category term="chomp"/><category term="christmas"/><category term="css"/><category term="curl"/><category term="customer satisfaction"/><category term="design principals"/><category term="disable"/><category term="dvbt"/><category term="eCommerce"/><category term="encryption"/><category term="fedora 12"/><category term="floating box model"/><category term="flock"/><category term="freeview"/><category term="ghostscript"/><category term="gmail"/><category term="gnupg"/><category term="gpg"/><category term="gpodder"/><category term="gs"/><category term="gtk-pod"/><category term="heartbeat"/><category term="html"/><category term="iSCSI"/><category term="iTunes"/><category term="id3v2"/><category term="isql"/><category term="kde"/><category term="kerberos"/><category term="kvm"/><category term="lame"/><category term="layout"/><category term="ldap"/><category term="linux odbc"/><category term="logging"/><category term="mame"/><category term="mobile phone"/><category term="mod_perl"/><category term="mono"/><category term="mouse"/><category term="mplayer"/><category term="multpath"/><category term="music"/><category term="networking"/><category term="new zealand"/><category term="nokia 3120"/><category term="nslcd"/><category term="odbc"/><category term="old computers"/><category term="osCommerce"/><category term="ovm api"/><category term="ovm webservices"/><category term="ovmm"/><category term="pam"/><category term="paymex"/><category term="paypal"/><category term="pgp"/><category term="podcasts"/><category term="print"/><category term="printer"/><category term="process"/><category term="public-private key authentication"/><category term="python 3 tier architecture."/><category term="python inotify linux filesystem"/><category term="rdp"/><category term="real lve people"/><category term="register globals"/><category term="remote desktop"/><category term="restrict"/><category term="rip wav2mp3"/><category term="rtl8192cu"/><category term="samba"/><category term="scheduled tasks"/><category term="security"/><category term="sed"/><category term="sessman"/><category term="single line"/><category term="soap"/><category term="software design"/><category term="ssl"/><category term="suds"/><category term="synaptics"/><category term="terms of service agreements"/><category term="time calculations"/><category term="touch-pad"/><category term="tutorial"/><category term="twitter"/><category term="typing"/><category term="unix philosophy"/><category term="urllib2"/><category term="virtual ip address"/><category term="webbrowser"/><category term="wget"/><category term="winbind"/><category term="windows to linux rdp"/><category term="work"/><category term="wsapi"/><category term="wsdl"/><category term="wxPython"/><category term="xbox gamepad"/><category term="xbox to usb"/><category term="xrdp"/><category term="yami"/><category term="youtube"/><title type='text'>David Latham</title><subtitle type='html'>Cloud Engineering and Operations Specialist</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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>101</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2666170339866438578.post-1329686442328615007</id><published>2021-05-14T16:13:00.006+12:00</published><updated>2021-05-14T16:48:23.375+12:00</updated><title type='text'>Automatically mount NVME volumes in AWS EC2 on Windows with Cloudformation and Powershell Userdata</title><content type='html'>&lt;h2 style=&quot;text-align: left;&quot;&gt;Introduction&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;This post explains how I go about with AWS Cloudformation and Powershell userdata scripts.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;attaching EBS volumes to Windows EC2 instances&lt;/li&gt;&lt;li&gt;identifying them in the OS&lt;/li&gt;&lt;li&gt;initializing them&lt;/li&gt;&lt;li&gt;formatting them&lt;/li&gt;&lt;li&gt;and assigning labels and drive letters.&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Prerequisites&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;You should know something about Cloudformation and Powershell.&lt;/div&gt;&lt;div&gt;The AWS Image you use for your EC2 instance should be one provided by AWS and should have the following utility already deployed to&amp;nbsp;&lt;span style=&quot;font-family: Ubuntu Mono;&quot;&gt;&lt;b&gt;C:\ProgramData\Amazon\Tools\ebsnvme-id.exe&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;AWS Cloudformation Step&lt;/h2&gt;&lt;div&gt;I typically do not declare EBS Volumes together with the EC2 Instance declaration in Cloudformation but prefer to declare them as separate resources along with their own ebs attachment resources.&amp;nbsp; Here is an example EC2 instance with three additional volume declarations on top of the root volume which is automatically mounted on C:\
 &lt;pre style=&quot;overflow: scroll;&quot;&gt; WindowsServerInstance:
    Type: AWS::EC2::Instance
    Properties:
      BlockDeviceMappings:
        - DeviceName: /dev/sda1
          Ebs:
            VolumeSize: 65
            Encrypted: true
            VolumeType: gp3
      ImageId: !Ref WindowsImageId
      KeyName: !Ref WindowsKeyPairName
      InstanceType: !WindowsServerInstanceType
      CreditSpecification:
        CPUCredits: standard
      IamInstanceProfile: !Ref WindowsServerInstanceProfile
      SecurityGroupIds:
        - !Ref ManagementSecurityGroup
        - !Ref ApplicationSecurityGroup
      SubnetId: !Ref WindowsServerSubnetId
      Tags:
        - Key: Name
          Value: WindowsServerInstance
      UserData:
        Fn::Base64: |
          &amp;lt;powershell&amp;gt;
            mkdir C:\setup
            Read-S3Object -BucketName example-bucket -Key /userdata/windows_bootstrap.ps1 -File C:\setup\bootstrap.ps1
            . C:\setup\bootstrap.ps1
          &amp;lt;/powershell&amp;gt;

  DataVolume:
    Type: AWS::EC2::Volume
    Properties:
      Size: 100
      VolumeType: gp3
      Encrypted: true
      AvailabilityZone: !GetAtt WindowsServerInstance.AvailabilityZone
      Tags:
        - Key: Name
          Value: DataVolume
  DataVolumeAttachment:
    Type: AWS::EC2::VolumeAttachment
    Properties:
      InstanceId: !Ref WindowsServerInstance
      VolumeId: !Ref DataVolume
      Device: /dev/sdb

  BackupVolume:
    Type: AWS::EC2::Volume
    Properties:
      Size: 100
      VolumeType: gp3
      Encrypted: true
      AvailabilityZone: !GetAtt WindowsServerInstance.AvailabilityZone
      Tags:
        - Key: Name
          Value: BackupVolume
  BackupVolumeAttachment:
    Type: AWS::EC2::VolumeAttachment
    Properties:
      InstanceId: !Ref WindowsServerInstance
      VolumeId: !Ref BackupVolume
      Device: /dev/sdc

  ScriptsVolume:
    Type: AWS::EC2::Volume
    Properties:
      Size: 5
      VolumeType: gp3
      Encrypted: true
      AvailabilityZone: !GetAtt WindowsServerInstance.AvailabilityZone
      Tags:
        - Key: Name
          Value: ScriptsVolume
  ScriptsVolumeAttachment:
    Condition: DeployB2BResources
    Type: AWS::EC2::VolumeAttachment
    Properties:
      InstanceId: !Ref WindowsServerInstance
      VolumeId: !Ref ScriptsVolume
      Device: /dev/sdd
&lt;/pre&gt;

  
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When this template builds, a windows instance will be available with 3 additional and un-initialized volumes attached.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The userdata property is configured to pull down a powershell script from S3 as permitted by the WindowsServerInstanceProfile.&amp;nbsp; I&#39;ve not bothered to explain how all that works.&amp;nbsp; I assume if you are reading this, you already know how to allow an EC2 Instance access to objects in S3 via Instance Profiles and Policies.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Userdata Script&lt;/h2&gt;&lt;div&gt;The userdata script below, declares a function and calls the function once for each of the volume attachments.
&lt;pre style=&quot;overflow: scroll;&quot;&gt;### Function to format a disk based on the disk number, label and drive letter.
function setup_disk {
	param (
		$DiskNumber,
		$Label,
		$DriveLetter
	)
	Initialize-Disk &quot;$DiskNumber&quot; -PartitionStyle MBR
	New-Partition -DiskNumber &quot;$DiskNumber&quot; -DriveLetter &quot;$DriveLetter&quot; -UseMaximumSize
	Format-Volume -DriveLetter &quot;$DriveLetter&quot; -FileSystem NTFS -NewFileSystemLabel &quot;$Label&quot; -Confirm:$false
}

# Create a hashtable of disk numbers and block device mappings
$hash = $null
$hash = @{}

get-disk | where partitionstyle -eq &#39;raw&#39; | where-object IsSystem -eq $False| select Number | foreach-Object {
  $num = $_.Number
  $blk = (c:\ProgramData\Amazon\Tools\ebsnvme-id.exe $num | Select-String -Pattern &#39;Device Name: .*$&#39;| ConvertFrom-String -Delimiter &#39;:&#39; | Select P2).P2
  $blk = $blk -replace &#39;^......&#39;

  $hash.add($blk, $num)
}

# Set up each of the volume attachments
setup_disk $hash.sdb &quot;Data&quot; &quot;D&quot;
setup_disk $hash.sdc &quot;Backup&quot; &quot;E&quot;
setup_disk $hash.sdd &quot;Scripts&quot; &quot;I&quot;
&lt;/pre&gt;
  
  
&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Explanation&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The &lt;span style=&quot;font-family: Ubuntu Mono;&quot;&gt;&lt;b&gt;get-disk&lt;/b&gt;&lt;/span&gt; command returns a list of all the disks attached to the system.&amp;nbsp; &amp;nbsp;We can use the get-disk command to iterate through each attached disk that is not a system disk (exclude C:\) and then call the AWS Provided &lt;span style=&quot;font-family: Ubuntu Mono;&quot;&gt;&lt;b&gt;ebsnvme-id.exe &lt;/b&gt;&lt;/span&gt;tool to find out which device name it has and add it to a hashmap called $hash.&amp;nbsp; This just maps Disk Number to Volume Attachment Device Name.&amp;nbsp; Unfortunately Windows does not always enumerate disks in the same order so we have to build this map correctly.&amp;nbsp; As a general rule it is never a good idea to rely on the order of things in computers.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Seeing as though our Cloudformation VolumeAttachment resources declare these device names, we have the mapping we need to proceed.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div&gt;
&lt;pre style=&quot;overflow: scroll;&quot;&gt;PS C:\setup&amp;gt; $hash

Name                           Value
----                           -----
sdb                            2
sdc                            1
sdd                            3
&lt;/pre&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, our little script, calls the &lt;span style=&quot;font-family: Ubuntu Mono;&quot;&gt;&lt;b&gt;setup_disk&lt;/b&gt;&lt;/span&gt; function with the value of the hash for each volume we want and the parameters for Label and Drive Letter.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/1329686442328615007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/1329686442328615007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/1329686442328615007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/1329686442328615007'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2021/05/automatically-mount-nvme-volumes-in-aws.html' title='Automatically mount NVME volumes in AWS EC2 on Windows with Cloudformation and Powershell Userdata'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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><georss:featurename>Auckland, New Zealand</georss:featurename><georss:point>-36.850882700000007 174.7644881</georss:point><georss:box>-65.569870507671212 139.6082381 -8.1318948923288019 -150.0792619</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2666170339866438578.post-3953411213808597071</id><published>2013-12-26T19:14:00.000+13:00</published><updated>2014-01-04T13:03:10.771+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASUS USB-N10 Nano"/><category scheme="http://www.blogger.com/atom/ns#" term="openSuSE"/><category scheme="http://www.blogger.com/atom/ns#" term="rtl8192cu"/><category scheme="http://www.blogger.com/atom/ns#" term="WiFi"/><title type='text'>ASUS USB-N10 Nano on OpenSuse 13.1 Linux</title><content type='html'>Today I bought myself a wifi adapter for my Opensuse desktop PC.  I was tired of running a network cable across the carpet to my modem.&lt;br /&gt;
&lt;br /&gt;
The model I bought was an ASUS USB-N10 Nano from PB Technologies in Henderson.  It was less than $20 so I thought a good deal.  When I bought it, I completely ignored all the printed garbage about support for Windows and Mac and figured, that it will be supported under linux.&lt;br /&gt;
&lt;br /&gt;
It is supported under Linux but it was not too simple to set up on my Opensuse.&lt;br /&gt;
&lt;br /&gt;
In the end and after much google-ing, I found this repository: &lt;br /&gt;
&lt;a href=&quot;https://github.com/pvaret/rtl8192cu-fixes&quot;&gt;https://github.com/pvaret/rtl8192cu-fixes&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The driver that ships with the kernel is not so hot.  The network keeps dropping even though it appears to remain connected.  With this version, things are much more stable.&lt;br /&gt;
&lt;br /&gt;
Also it compiles nicely under the latest kernel.  The proprietry driver from Realtek did not compile under the kernel shipped with Opensuse 13.1.&lt;br /&gt;
&lt;br /&gt;
So here is what I ended up doing:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:text&quot;&gt;~ git clone https://github.com/pvaret/rtl8192cu-fixes.git
~ su - (become root)
# zypper in dkms kernel-devel kernel-headers gcc make
# cd /path/to/git/repo... (you get the picture)
# cd ../ (go to directory above tree) on my system I put this source tree under /usr/local/src/
# dkms add rtl8192cu-fixes
# dkms install 8192cu/1.8
# depmod -a
# cp blacklist-native-rtl8192.conf /etc/modprobe.d
# echo &quot;options 8192cu rtw_power_mgnt=0 rtw_enusbss=0&quot; &gt; /etc/modprobe.d/50-8192cu.conf
# reboot
&lt;/pre&gt;&lt;br /&gt;
And that&#39;s it.  Now if the kernel is ever updated during normal patching, dkms will recompile our driver.&lt;br /&gt;
&lt;br /&gt;
EDIT:&lt;br /&gt;
I have made an RPM package for this driver.  It&#39;s hosted on the openSUSE build service.  Currently I have successfully managed to create rpm&#39;s for Centos, Redhat and Fedora (x86_64) only.  The openSUSE one failed because the build environment does not have DKMS installed and so the install test fails at the very end.&lt;br /&gt;
Anyway - find the packages here: &lt;a href=&quot;https://build.opensuse.org/package/show/home:linuxplayground/8192cu-1.8&quot;&gt;https://build.opensuse.org/package/show/home:linuxplayground/8192cu-1.8&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
so the openSUSE version is here: &lt;a href=&quot;https://drive.google.com/file/d/0B65VMaUtE7xea1RWX21mT2xMcWc/edit?usp=sharing&quot;&gt;8192cu-1.8-1.0.x86_64.rpm&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
These RPM packages will:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;save the source in /usr/src/8192cu-1.8&lt;/li&gt;
&lt;li&gt;Add the source tree to DKMS&lt;/li&gt;
&lt;li&gt;Build the kernel module using dkms build ...&lt;/li&gt;
&lt;li&gt;Install the kenrel module using dkms install ...&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
To uninstall the module and all the dkms source, builds and modules then just execute: #rpm -e 8192cu&lt;br /&gt;
:-)</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/3953411213808597071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/3953411213808597071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/3953411213808597071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/3953411213808597071'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2013/12/asus-usb-n10-nano-on-opensuse-131-linux.html' title='ASUS USB-N10 Nano on OpenSuse 13.1 Linux'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-60721045265838045</id><published>2013-12-20T11:17:00.000+13:00</published><updated>2013-12-20T11:19:57.507+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bash"/><category scheme="http://www.blogger.com/atom/ns#" term="public-private key authentication"/><category scheme="http://www.blogger.com/atom/ns#" term="restrict"/><category scheme="http://www.blogger.com/atom/ns#" term="security"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh"/><title type='text'>Restrict Commands executed via pre-shared SSH keys</title><content type='html'>&lt;h3&gt;Introduction &lt;/h3&gt;Using pre-shared SSH keys is a great way to make logging into remote hosts quick and easy.&amp;nbsp; No pesky passwords to remember.&amp;nbsp; The downside is that if your organization relies on passwords for access control, the pre-shared key will negate any password control you have.&amp;nbsp; For example: If your organization rolls a password for a system account, and the new password is not shared with all the original people, then some people who should not have access any more will continue to have access via their pre-shared key.&lt;br /&gt;
Also, anyone with access to a user&#39;s account on a client host, could access the system account via the pre-shared key on the remote host.&amp;nbsp; This is not ideal.&lt;br /&gt;
&lt;br /&gt;
Sometimes, it is neccessary to allow certain commands only to be executed over SSH from specified client hosts without a password.&amp;nbsp; Especially when thinking about automated tasks.&lt;br /&gt;
&lt;br /&gt;
In my examples, I will demonstrate how we can create a simple remote procedure call type scenario using pre-shared keys and some built in linux security tools that lock things down.&lt;br /&gt;
&lt;br /&gt;
These examples will use the &quot;oracle&quot; user which has been set up on both the client and remote hosts identically.&lt;br /&gt;
&lt;pre class=&quot;brush: text&quot;&gt;[oracle@centos-dev-1 ~]$ id
uid=500(oracle) gid=501(oinstall) groups=501(oinstall) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
&lt;/pre&gt;&lt;br /&gt;
&lt;h2&gt;The Steps&lt;/h2&gt;&lt;h3&gt;Create the public private key on the private host&lt;/h3&gt;Use ssh-keygen to create a public/private key pair without a password.&lt;br /&gt;
&lt;pre class=&quot;brush: text&quot;&gt;[oracle@centos-dev-1 ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa): [ENTER]
Created directory &#39;/home/oracle/.ssh&#39;.
Enter passphrase (empty for no passphrase): [ENTER]
Enter same passphrase again: [ENTER]
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
64:cf:72:de:f7:85:af:fe:36:87:ce:8c:6e:31:8d:ed oracle@centos-dev-1.vbox.local
The key&#39;s randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|        o        |
|       o o       |
|        S +  +   |
|         + .+ o. |
|          . .+o..|
|            .=E++|
|           ooo*+*|
+-----------------+
[oracle@centos-dev-1 ~]$ ls -l .ssh/
total 8
-rw-------. 1 oracle oinstall 1675 Dec 20 10:33 id_rsa
-rw-r--r--. 1 oracle oinstall  412 Dec 20 10:33 id_rsa.pub
&lt;/pre&gt;&lt;br /&gt;
&lt;h3&gt;Share the public key to the remote host&lt;/h3&gt;You can use the ssh-copy-id tool or you could manually do it.  I will use the ssh-copy-id tool to share the key.&lt;br /&gt;
&lt;pre class=&quot;brush: text&quot;&gt;[oracle@centos-dev-1 ~]$ ssh-copy-id -i /home/oracle/.ssh/id_rsa.pub oracle@centos-dev-2
The authenticity of host &#39;centos-dev-2 (192.168.56.102)&#39; can&#39;t be established.
RSA key fingerprint is df:87:48:48:0a:15:fa:ca:e4:a7:41:8e:9e:af:19:b5.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added &#39;centos-dev-2,192.168.56.102&#39; (RSA) to the list of known hosts.
oracle@centos-dev-2&#39;s password: 
Now try logging into the machine, with &quot;ssh &#39;oracle@centos-dev-2&#39;&quot;, and check in:

  .ssh/authorized_keys

to make sure we haven&#39;t added extra keys that you weren&#39;t expecting.

[oracle@centos-dev-1 ~]$ ssh oracle@centos-dev-2
Last login: Thu Dec 19 13:38:03 2013 from centos-dev-1.vbox.local
[oracle@centos-dev-2 ~]$ hostname
centos-dev-2.vbox.local
[oracle@centos-dev-2 ~]$ id
uid=500(oracle) gid=501(oinstall) groups=501(oinstall) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@centos-dev-2 ~]$ exit
logout
Connection to centos-dev-2 closed.
&lt;/pre&gt;At this point, we have successfully enabled transparent ssh logins using a pre-shared public key from centos-dev-1 to centos-dev-2 as the &quot;oracle&quot; user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result was a file created on the remote host called /home/oracle/.ssh/authorized_keys which looks like this:&lt;br /&gt;
&lt;pre class=&quot;brush: text&quot;&gt;[oracle@centos-dev-2 ~]$ hostname
centos-dev-2.vbox.local
[oracle@centos-dev-2 ~]$ id
uid=500(oracle) gid=501(oinstall) groups=501(oinstall) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@centos-dev-2 ~]$ cd /home/oracle/.ssh/
[oracle@centos-dev-2 .ssh]$ ls -l
total 4
-rw-------. 1 oracle oinstall 412 Dec 20 10:35 authorized_keys
[oracle@centos-dev-2 .ssh]$ cat authorized_keys 
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqdZI3PbacEoZ4uIk1hIc9Tl2pmLZtv0Y1/ZowqNOLRRQV84ziiNXoUXa8y+x9DxMzIPxKHdyYy0k0HFl06oIjfP4l3P3GY9L0MM/oYxYNr0UaJz46hDy7p3cKVjmeY/Xn3PsepNY3kAdp4zdNb1Hfs9G/PiB70LTfseJZjqwBJ6edYAt7YztWuO9OgrmDoW7QAdsPTlQGF9iW0gUqH/1UA5hXtGePRq2My9ahXmXOu1hy3H1wFygCBZaxP7A3qohgvVIT76DQ1mxhgLDiQCVkTzxVhHgMmVi4A7C0vpr2G5WxpLblVHWpjnXn/eAdQBQLnFtj/pza1U5K3Dy/GDxMQ== oracle@centos-dev-1.vbox.local
&lt;/pre&gt;&lt;h3&gt;Restrict the public key on the remote host&lt;/h3&gt;Here we edit the /home/oracle/.ssh/authorized_keys file that was created in the previous step to include some restrictions for the key.  We prepend the following to the key:&lt;br /&gt;
&lt;pre class=&quot;brush: text&quot;&gt;from=&quot;centos-dev-1.vbox.local&quot;,command=&quot;/usr/local/bin/remote-commands.sh&quot;,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty 
&lt;/pre&gt;The key now looks like this:&lt;br /&gt;
&lt;pre class=&quot;brush: text&quot;&gt;from=&quot;centos-dev-1.vbox.local&quot;,command=&quot;/usr/local/bin/remote-commands.sh&quot;,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqdZI3PbacEoZ4uIk1hIc9Tl2pmLZtv0Y1/ZowqNOLRRQV84ziiNXoUXa8y+x9DxMzIPxKHdyYy0k0HFl06oIjfP4l3P3GY9L0MM/oYxYNr0UaJz46hDy7p3cKVjmeY/Xn3PsepNY3kAdp4zdNb1Hfs9G/PiB70LTfseJZjqwBJ6edYAt7YztWuO9OgrmDoW7QAdsPTlQGF9iW0gUqH/1UA5hXtGePRq2My9ahXmXOu1hy3H1wFygCBZaxP7A3qohgvVIT76DQ1mxhgLDiQCVkTzxVhHgMmVi4A7C0vpr2G5WxpLblVHWpjnXn/eAdQBQLnFtj/pza1U5K3Dy/GDxMQ== oracle@centos-dev-1.vbox.local
&lt;/pre&gt;The extra options are broken down as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;from=&quot;centos-dev-1&quot; Only allow this key to be used when connections are made from centos-dev-1 host.&lt;/li&gt;
&lt;li&gt;command=&quot;/usr/local/bin/remote-commands.sh&quot; This is a script that will be executed by the owner of this key (oracle) whenever the key is used to establish an ssh connection.  We will write the script soon.&lt;/li&gt;
&lt;li&gt;no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty  These options add extra security and prevent the key being used for anything other than running the command specified in command=&quot;&quot;.&lt;/li&gt;
&lt;/ul&gt;None of this is very useful if the oracle user can simply log into the host using his password and edit this file.  Use the chattr command to lock the file for editing as follows: (NOTE: Only the root user can do this)&lt;br /&gt;
&lt;pre class=&quot;brush: text&quot;&gt;[root@centos-dev-2 ~]# hostname
centos-dev-2.vbox.local
[root@centos-dev-2 ~]# id
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[root@centos-dev-2 ~]# lsattr /home/oracle/.ssh/authorized_keys 
-------------e- /home/oracle/.ssh/authorized_keys
[root@centos-dev-2 ~]# chattr +i /home/oracle/.ssh/authorized_keys 
[root@centos-dev-2 ~]# lsattr /home/oracle/.ssh/authorized_keys 
----i--------e- /home/oracle/.ssh/authorized_keys
[root@centos-dev-2 ~]# rm /home/oracle/.ssh/authorized_keys 
rm: remove regular file `/home/oracle/.ssh/authorized_keys&#39;? y
rm: cannot remove `/home/oracle/.ssh/authorized_keys&#39;: Operation not permitted
[root@centos-dev-2 ~]# ls -l /home/oracle/.ssh/authorized_keys 
-rw-------. 1 oracle oinstall 551 Dec 20 10:41 /home/oracle/.ssh/authorized_keys
[root@centos-dev-2 ~]# su - oracle
[oracle@centos-dev-2 ~]$ cat .ssh/authorized_keys 
from=&quot;centos-dev-1.vbox.local&quot;,command=&quot;/usr/local/bin/remote-commands.sh&quot;,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqdZI3PbacEoZ4uIk1hIc9Tl2pmLZtv0Y1/ZowqNOLRRQV84ziiNXoUXa8y+x9DxMzIPxKHdyYy0k0HFl06oIjfP4l3P3GY9L0MM/oYxYNr0UaJz46hDy7p3cKVjmeY/Xn3PsepNY3kAdp4zdNb1Hfs9G/PiB70LTfseJZjqwBJ6edYAt7YztWuO9OgrmDoW7QAdsPTlQGF9iW0gUqH/1UA5hXtGePRq2My9ahXmXOu1hy3H1wFygCBZaxP7A3qohgvVIT76DQ1mxhgLDiQCVkTzxVhHgMmVi4A7C0vpr2G5WxpLblVHWpjnXn/eAdQBQLnFtj/pza1U5K3Dy/GDxMQ== oracle@centos-dev-1.vbox.local
&lt;/pre&gt;As you can see, once this attribute is set on the file, not even the root user can edit or delete it.  The root user will first need to remove the &quot;immutable&quot; attribute with &quot;chattr -i /home/oracle/.ssh/authorized_keys&quot;.&lt;br /&gt;
&lt;br /&gt;
The oracle user can still read the file which is a requirement of the SSH daemon.&lt;br /&gt;
&lt;h3&gt;Write a command parser on the remote host&lt;/h3&gt;This script will parse the command sent by the ssh client and execute based on some simple tests.&lt;br /&gt;
&lt;pre class=&quot;brush: text&quot;&gt;[oracle@centos-dev-2 ~]$ ls -l /usr/local/bin/remote-commands.sh 
-rwxr-xr-x. 1 root root 315 Dec 19 13:30 /usr/local/bin/remote-commands.sh
[oracle@centos-dev-2 ~]$ cat /usr/local/bin/remote-commands.sh 
#!/bin/sh
#
if [ -z &quot;${SSH_ORIGINAL_COMMAND}&quot; ]; then
        echo &quot;This script can only be executed via SSH remote calls&quot;
        exit
fi

case &quot;$SSH_ORIGINAL_COMMAND&quot; in
  &quot;get hosts&quot;)
    cat /etc/hosts
    ;;
  &quot;get resolv.conf&quot;)
    cat /etc/resolv.conf
    ;;
  &quot;get env&quot;)
        env
        ;;
  *)
   echo &quot;Bad Command&quot; 
    ;;
esac
exit
&lt;/pre&gt;The script is owned by root:root but all users have read and execute permissions on the script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&#39;s it! We are ready to begin our tests now.&lt;br /&gt;
&lt;h3&gt;Test&lt;/h3&gt;The script we write allows clients to execute 3 commands:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;get hosts&lt;/li&gt;
&lt;li&gt;get resolv.conf&lt;/li&gt;
&lt;li&gt;get env&lt;/li&gt;
&lt;/ul&gt;Any other command will be rejected.&lt;br /&gt;
&lt;br /&gt;
Using the key to establish an ssh connection without passing a command will be rejected.  So logins are now disabled.&lt;br /&gt;
Executing the script from the local host will be rejected too.  This script should only be called by remote hosts.&lt;br /&gt;
&lt;h3&gt;Test &quot;get hosts&quot;&lt;/h3&gt;&lt;pre class=&quot;brush: text&quot;&gt;[oracle@centos-dev-1 ~]$ hostname
centos-dev-1.vbox.local
[oracle@centos-dev-1 ~]$ id
uid=500(oracle) gid=501(oinstall) groups=501(oinstall) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@centos-dev-1 ~]$ ssh centos-dev-2 get hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
&lt;/pre&gt;&lt;h3&gt;Test &quot;get resolv.conf&quot;&lt;/h3&gt;&lt;pre class=&quot;brush: text&quot;&gt;[oracle@centos-dev-1 ~]$ hostname
centos-dev-1.vbox.local
[oracle@centos-dev-1 ~]$ id
uid=500(oracle) gid=501(oinstall) groups=501(oinstall) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@centos-dev-1 ~]$ ssh centos-dev-2  resolv.conf
; generated by /sbin/dhclient-script
search vbox.local
nameserver 192.168.56.1
&lt;/pre&gt;&lt;h3&gt;Test &quot;get env&quot;&lt;/h3&gt;My fake oracle environment is nothing like what a real one would look like.  This example is given just to prove that the remote script does execute with all of the expected environment variables.&lt;br /&gt;
&lt;pre class=&quot;brush: text&quot;&gt;[oracle@centos-dev-1 ~]$ hostname
centos-dev-1.vbox.local
[oracle@centos-dev-1 ~]$ id
uid=500(oracle) gid=501(oinstall) groups=501(oinstall) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@centos-dev-1 ~]$ ssh centos-dev-2 get env
SELINUX_ROLE_REQUESTED=
SHELL=/bin/bash
SSH_CLIENT=192.168.56.101 46697 22
SELINUX_USE_CURRENT_RANGE=
USER=oracle
PATH=/usr/local/bin:/bin:/usr/bin
MAIL=/var/mail/oracle
PWD=/home/oracle
LANG=en_US.UTF-8
SELINUX_LEVEL_REQUESTED=
HOME=/home/oracle
SHLVL=2
SSH_ORIGINAL_COMMAND=get env
LOGNAME=oracle
CVS_RSH=ssh
SSH_CONNECTION=192.168.56.101 46697 192.168.56.102 22
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/bin/env
&lt;/pre&gt;&lt;h3&gt;Test some bad commands&lt;/h3&gt;&lt;pre class=&quot;brush: text&quot;&gt;[oracle@centos-dev-1 ~]$ hostname
centos-dev-1.vbox.local
[oracle@centos-dev-1 ~]$ id
uid=500(oracle) gid=501(oinstall) groups=501(oinstall) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@centos-dev-1 ~]$ ssh centos-dev-2 userdel oracle
Bad Command
[oracle@centos-dev-1 ~]$ ssh centos-dev-2 &quot;su -c \&quot;userdel oracle\&quot;&quot;
Bad Command
[oracle@centos-dev-1 ~]$ ssh centos-dev-2 rm -fr /*
Bad Command
&lt;/pre&gt;&lt;h3&gt;Test logging in without a password&lt;/h3&gt;&lt;pre class=&quot;brush: text&quot;&gt;[oracle@centos-dev-1 ~]$ hostname
centos-dev-1.vbox.local
[oracle@centos-dev-1 ~]$ id
uid=500(oracle) gid=501(oinstall) groups=501(oinstall) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@centos-dev-1 ~]$ ssh centos-dev-2
PTY allocation request failed on channel 0
This script can only be executed via SSH remote calls
                                                     Connection to centos-dev-2 closed.
&lt;/pre&gt;&lt;h3&gt;Using SSH to force the requirement for a password&lt;/h3&gt;Because a shared key exists, ssh will automatically try to use it for authentication.  We now need to explicitly declare that no public private key should be used for authentication.&lt;br /&gt;
&lt;pre class=&quot;brush: text&quot;&gt;[oracle@centos-dev-1 ~]$ hostname
centos-dev-1.vbox.local
[oracle@centos-dev-1 ~]$ id
uid=500(oracle) gid=501(oinstall) groups=501(oinstall) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@centos-dev-1 ~]$ ssh -o PubkeyAuthentication=no centos-dev-2
oracle@centos-dev-2&#39;s password: 
Last login: Fri Dec 20 10:35:22 2013 from centos-dev-1.vbox.local
[oracle@centos-dev-2 ~]$ hostname
centos-dev-2.vbox.local
[oracle@centos-dev-2 ~]$ id
uid=500(oracle) gid=501(oinstall) groups=501(oinstall) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@centos-dev-2 ~]$ 
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/60721045265838045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/60721045265838045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/60721045265838045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/60721045265838045'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2013/12/restrict-commands-executed-via-pre.html' title='Restrict Commands executed via pre-shared SSH keys'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-5121670372536471462</id><published>2013-12-12T12:07:00.000+13:00</published><updated>2013-12-12T14:05:27.486+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ovm api"/><category scheme="http://www.blogger.com/atom/ns#" term="ovm webservices"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="soap"/><category scheme="http://www.blogger.com/atom/ns#" term="SSLv3"/><category scheme="http://www.blogger.com/atom/ns#" term="suds"/><category scheme="http://www.blogger.com/atom/ns#" term="urllib2"/><category scheme="http://www.blogger.com/atom/ns#" term="wsapi"/><category scheme="http://www.blogger.com/atom/ns#" term="wsdl"/><title type='text'>Python suds (SOAP Library) does not support SSLv3</title><content type='html'>The Oracle Virtual Machine (OVM) manager exposes a SOAP (wsdl) web-service.  At the time of writing this can be found here: (for version 3.2.x)&lt;br /&gt;
&lt;br /&gt;
https://&amp;lt;hostname&amp;gt;:7002/ovm/core/wsapi/soap?wsdl&lt;br /&gt;
&lt;br /&gt;
You can access this url in your web browser and will be prompted to accept the self signed cert etc.&amp;nbsp; (There is a way to add a real certificate but that&#39;s not what this article is about.)&lt;br/&gt;
&lt;br /&gt;
In order to consume this webservice in python, I thought to try out the (now quite old) &quot;suds&quot; library.&amp;nbsp; Opensuse still ship this library and you can install it with:&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;
zypper in python-suds&lt;br /&gt;
&lt;/pre&gt;
EDIT: I have added the forked library to github here: &lt;a href=&quot;https://github.com/linuxplayground/suds-sslv3-fork&quot;&gt;https://github.com/linuxplayground/suds-sslv3-fork&lt;/a&gt;
&lt;br/&gt;
The problem I found was that when trying to connect to the service, I was receiving an exception error around SSL.&lt;br /&gt;
&lt;br /&gt;
Here is how it looked...
&lt;br /&gt;
The example code:
&lt;pre class=&quot;brush: python&quot;&gt;
#!/usr/bin/python
from suds.client import Client
client = Client(url=&#39;https://ovm:7002/ovm/core/wsapi/soap?wsdl&#39;)
print client
&lt;/pre&gt;
Output:
&lt;pre class=&quot;brush: text&quot;&gt;
david.latham@davidpc:~/bin/ovm-webservices&gt; python broken.py 
Traceback (most recent call last):
  File &quot;broken.py&quot;, line 3, in &lt;module&gt;
    client = Client(url=&#39;https://ovm:7002/ovm/core/wsapi/soap?wsdl&#39;)
  File &quot;/usr/lib/python2.7/site-packages/suds/client.py&quot;, line 112, in __init__
    self.wsdl = reader.open(url)
  File &quot;/usr/lib/python2.7/site-packages/suds/reader.py&quot;, line 152, in open
    d = self.fn(url, self.options)
  File &quot;/usr/lib/python2.7/site-packages/suds/wsdl.py&quot;, line 136, in __init__
    d = reader.open(url)
  File &quot;/usr/lib/python2.7/site-packages/suds/reader.py&quot;, line 79, in open
    d = self.download(url)
  File &quot;/usr/lib/python2.7/site-packages/suds/reader.py&quot;, line 95, in download
    fp = self.options.transport.open(Request(url))
  File &quot;/usr/lib/python2.7/site-packages/suds/transport/https.py&quot;, line 60, in open
    return  HttpTransport.open(self, request)
  File &quot;/usr/lib/python2.7/site-packages/suds/transport/http.py&quot;, line 62, in open
    return self.u2open(u2request)
  File &quot;/usr/lib/python2.7/site-packages/suds/transport/http.py&quot;, line 118, in u2open
    return url.open(u2request, timeout=tm)
  File &quot;/usr/lib64/python2.7/urllib2.py&quot;, line 404, in open
    response = self._open(req, data)
  File &quot;/usr/lib64/python2.7/urllib2.py&quot;, line 422, in _open
    &#39;_open&#39;, req)
  File &quot;/usr/lib64/python2.7/urllib2.py&quot;, line 382, in _call_chain
    result = func(*args)
  File &quot;/usr/lib64/python2.7/urllib2.py&quot;, line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File &quot;/usr/lib64/python2.7/urllib2.py&quot;, line 1184, in do_open
    raise URLError(err)
urllib2.URLError: &lt;urlopen error [Errno 1] _ssl.c:517: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol&gt;
&lt;/pre&gt;

That last line, &quot;SSL23_GET_SERVER_HELLO:unknown protocol&quot; had me stuck for ages.  Eventually I found a blog post that suggested this can be fixed by adding a new HTTPHandler to the URLLIB2 Opener.
&lt;br/&gt;
Rather than mess with the urllib2 library, I decided to download the source for the suds library, and fix the library.
&lt;br/&gt;
Download suds from here:
&lt;pre class=&quot;brush: bash&quot;&gt;
svn co http://svn.fedorahosted.org/svn/suds/trunk
&lt;/pre&gt;

In the source tree add the following httpsconnectionv3.py to /path/to/downloaded/source/suds/transport/httpsconnectionv3.py

&lt;pre class=&quot;brush: python&quot;&gt;
#!/usr/bin/python
import httplib, ssl, urllib2, socket

class HTTPSConnectionV3(httplib.HTTPSConnection):
    def __init__(self, *args, **kwargs):
        httplib.HTTPSConnection.__init__(self, *args, **kwargs)
        
    def connect(self):
        sock = socket.create_connection((self.host, self.port), self.timeout)
        if self._tunnel_host:
            self.sock = sock
            self._tunnel()
        try:
            self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file, ssl_version=ssl.PROTOCOL_SSLv3)
        except ssl.SSLError, e:
            print(&quot;Trying SSLv3.&quot;)
            self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file, ssl_version=ssl.PROTOCOL_SSLv23)
            
class HTTPSHandlerV3(urllib2.HTTPSHandler):
    def https_open(self, req):
        return self.do_open(HTTPSConnectionV3, req)
&lt;/pre&gt;

Then update /path/to/downloaded/source/suds/transport/http.py with the following additions:
&lt;ul&gt;
&lt;li&gt;include the new library in the imports&lt;ul&gt;&lt;li&gt;from httpsconnectionv3 import *&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add the following line to the function &quot;u2handlers&quot; after the line &quot;handlers.append(u2.ProxyHandler(self.proxy))&quot;&lt;ul&gt;&lt;li&gt;handlers.append(HTTPSHandlerV3())&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
Now you are ready to test using this library instead of the default suds library that ships with your OS.
&lt;br/&gt;
The example code but this time you place your example code in the downloaded source tree so that python uses the local library.  OR You can make the above modifications to your installed library which should be somewhere in /usr/lib/python-2.7/site-packages/suds.&lt;br/&gt;
Up to you.
&lt;br/&gt;
Example Code:
&lt;pre class=&quot;brush: python&quot;&gt;
david.latham@davidpc:~/bin/ovm-webservices/ovm_wsapi&gt; cat getVMList.py
#!/usr/bin/python
from suds.client import Client
client = Client(url=&#39;https://ovm:7002/ovm/core/wsapi/soap?wsdl&#39;)
username=&#39;admin&#39;
password=&#39;xxxxxxxx&#39;
loginResponse = client.service.login(username,password)
print &quot;Logging in .... &lt;%s&gt;&quot; % loginResponse
if loginResponse == True:
        vmlist = client.service.vmGetAll()
        for vm in vmlist:
                if vm.vmRunState == &#39;RUNNING&#39; or vm.vmRunState == &#39;STOPPED&#39;:
                        print &quot;%s | %s&quot; % (vm.name, vm.vmRunState)
        logoutResponse = client.service.logout()
        print &quot;Logging out ... &lt;%s&gt;&quot; % logoutResponse
else:
        print &quot;login failure&quot;
&lt;/pre&gt;
Output:
&lt;pre class=&quot;brush: text&quot;&gt;
david.latham@davidpc:~/bin/ovm-webservices/ovm_wsapi&gt; ./getVMList.py 
Logging in .... &lt;True&gt;
puppetmaster | RUNNING
ksplice-test | RUNNING
zimbra-test-el6 | STOPPED
ksplice-client | RUNNING
DB2_Server_RHEL58 | STOPPED
ora133 | STOPPED
secret_host_1 | STOPPED
zimbra-test | RUNNING
sqlsandpit | RUNNING
secret_host_2 | STOPPED
repo_server | RUNNING
Logging out ... &lt;None&gt;
&lt;/pre&gt;

So that fixes suds for sslv3</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/5121670372536471462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/5121670372536471462' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/5121670372536471462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/5121670372536471462'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2013/12/python-suds-soap-library-does-not.html' title='Python suds (SOAP Library) does not support SSLv3'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-5874408426252450683</id><published>2013-07-02T20:58:00.002+12:00</published><updated>2013-07-02T21:12:32.493+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="encryption"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><title type='text'>Simple symmetric / Shared key encryption tutorial</title><content type='html'>I was looking for a way to explain cryptography to my 8 year old son this evening and we devised a simple share key encryption / decryption method. &amp;nbsp;The key is symmetrical because both sides have the same key &amp;nbsp;and the same key is used for both encrypting and decrypting.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We took a simple ceasar cipher and extended it slightly by creating a stronger key. &amp;nbsp;Something like this:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Plain Text = HELLO WORLD&lt;/div&gt;
&lt;div&gt;
Key = [2, -5, 3, 7]&lt;/div&gt;
&lt;div&gt;
to encrypt we take the positional value for each letter and apply the replacement for the next key bit in turn. &amp;nbsp;For example:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Start at keybit = 1 [2]&lt;/div&gt;
&lt;div&gt;
H = 8, H&amp;nbsp;+ 2 = 10, 10 = J&lt;/div&gt;
&lt;div&gt;
keybit = 2 [-5]&lt;/div&gt;
&lt;div&gt;
E = 5, E - 5 = 0 (26), 26 = Z&lt;/div&gt;
&lt;div&gt;
keybit = 3 [3]&lt;/div&gt;
&lt;div&gt;
L = 12, 12&amp;nbsp;+ 3 = 15, 15 = O&lt;/div&gt;
&lt;div&gt;
keybit = 4 [7]&lt;/div&gt;
&lt;div&gt;
L = 12, 12&amp;nbsp;+ 7 = 19, 19 = S&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now start at key bit =1&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
O = 15, 15&amp;nbsp;+ 2 = 17, 17 = Q&lt;/div&gt;
&lt;div&gt;
and so on.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So long as the same key is used for decryption the thing works a treat.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So I explained that simple key can be made and shared between friends then private messages can be sent to and fro and only those with the key will know what the messages mean.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To demonstrate I made a program that he can use to make the process a bit quicker...&lt;/div&gt;
&lt;pre class=&quot;brush: python&quot;&gt;
#!/usr/bin/python

import sys

alphabet = [&#39;A&#39;,&#39;B&#39;,&#39;C&#39;,&#39;D&#39;,&#39;E&#39;,&#39;F&#39;,&#39;G&#39;,&#39;H&#39;,&#39;I&#39;,&#39;J&#39;,&#39;K&#39;,&#39;L&#39;,&#39;M&#39;,&#39;N&#39;,&#39;O&#39;,&#39;P&#39;,&#39;Q&#39;,&#39;R&#39;,&#39;S&#39;,&#39;T&#39;,&#39;U&#39;,&#39;V&#39;,&#39;W&#39;,&#39;X&#39;,&#39;Y&#39;,&#39;Z&#39;,&#39;a&#39;,&#39;b&#39;,&#39;c&#39;,&#39;d&#39;,&#39;e&#39;,&#39;f&#39;,&#39;g&#39;,&#39;h&#39;,&#39;i&#39;,&#39;j&#39;,&#39;k&#39;,&#39;l&#39;,&#39;m&#39;,&#39;n&#39;,&#39;o&#39;,&#39;p&#39;,&#39;q&#39;,&#39;r&#39;,&#39;s&#39;,&#39;t&#39;,&#39;u&#39;,&#39;v&#39;,&#39;w&#39;,&#39;x&#39;,&#39;y&#39;,&#39;z&#39;,&#39; &#39;,&#39;,&#39;,&#39;.&#39;,&#39;!&#39;,&#39;?&#39;,&#39;\&#39;&#39;,&#39;#&#39;,&#39;@&#39;,&#39;$&#39;,&#39;%&#39;,&#39;^&#39;,&#39;&amp;&#39;,&#39;(&#39;,&#39;)&#39;,&#39;-&#39;,&#39;_&#39;,&#39;=&#39;,&#39;+&#39;,&#39;]&#39;,&#39;[&#39;,&#39;{&#39;,&#39;}&#39;,&#39;\\&#39;,&#39;|&#39;,&#39;/&#39;,&#39;&quot;&#39;,&#39;:&#39;,&#39;;&#39;,&#39;&lt;&#39;,&#39;&gt;&#39;,&#39;`&#39;,&#39;~&#39;,&#39;1&#39;,&#39;2&#39;,&#39;3&#39;,&#39;4&#39;,&#39;5&#39;,&#39;6&#39;,&#39;7&#39;,&#39;8&#39;,&#39;9&#39;,&#39;0&#39;]

def encrypt(key, message):
    ciphertext = []
    pos = 0
    for c in message:
        i = alphabet.index(c)
        j = (i + key[pos]) % len(alphabet)
        ciphertext.append(alphabet[j])
        pos += 1
        if pos &gt; len(key)-1: pos = 0
    return &quot;&quot;.join(ciphertext)


if __name__ == &#39;__main__&#39;:
    key = [3,-6,2,-7,23435363, -3243543, 324]
    for line in sys.stdin:
        encrypted = encrypt(key, line.strip())
        print encrypted

# vim:expandtab:ts=4:softtabstop=4:autoindent
&lt;/pre&gt;

And test it as follows

&lt;pre class=&quot;brush: bash&quot;&gt;
dave@davidpc:~/bin/simpleenc&gt; echo &quot;Hello World&quot; | ./encrypt.py 
KYneJ9!dave@davidpc:~/bin/simpleenc&gt; echo &quot;Hello World&quot; | ./encrypt.py 
KYneJ9!rlnWrlnW
&lt;/pre&gt;

The Decrypt program is almost identical (and really shouldn&#39;t be a separate programme at all)

&lt;pre class=&quot;brush: python&quot;&gt;
#!/usr/bin/python

import sys

alphabet = [&#39;A&#39;,&#39;B&#39;,&#39;C&#39;,&#39;D&#39;,&#39;E&#39;,&#39;F&#39;,&#39;G&#39;,&#39;H&#39;,&#39;I&#39;,&#39;J&#39;,&#39;K&#39;,&#39;L&#39;,&#39;M&#39;,&#39;N&#39;,&#39;O&#39;,&#39;P&#39;,&#39;Q&#39;,&#39;R&#39;,&#39;S&#39;,&#39;T&#39;,&#39;U&#39;,&#39;V&#39;,&#39;W&#39;,&#39;X&#39;,&#39;Y&#39;,&#39;Z&#39;,&#39;a&#39;,&#39;b&#39;,&#39;c&#39;,&#39;d&#39;,&#39;e&#39;,&#39;f&#39;,&#39;g&#39;,&#39;h&#39;,&#39;i&#39;,&#39;j&#39;,&#39;k&#39;,&#39;l&#39;,&#39;m&#39;,&#39;n&#39;,&#39;o&#39;,&#39;p&#39;,&#39;q&#39;,&#39;r&#39;,&#39;s&#39;,&#39;t&#39;,&#39;u&#39;,&#39;v&#39;,&#39;w&#39;,&#39;x&#39;,&#39;y&#39;,&#39;z&#39;,&#39; &#39;,&#39;,&#39;,&#39;.&#39;,&#39;!&#39;,&#39;?&#39;,&#39;\&#39;&#39;,&#39;#&#39;,&#39;@&#39;,&#39;$&#39;,&#39;%&#39;,&#39;^&#39;,&#39;&amp;&#39;,&#39;(&#39;,&#39;)&#39;,&#39;-&#39;,&#39;_&#39;,&#39;=&#39;,&#39;+&#39;,&#39;]&#39;,&#39;[&#39;,&#39;{&#39;,&#39;}&#39;,&#39;\\&#39;,&#39;|&#39;,&#39;/&#39;,&#39;&quot;&#39;,&#39;:&#39;,&#39;;&#39;,&#39;&lt;&#39;,&#39;&gt;&#39;,&#39;`&#39;,&#39;~&#39;,&#39;1&#39;,&#39;2&#39;,&#39;3&#39;,&#39;4&#39;,&#39;5&#39;,&#39;6&#39;,&#39;7&#39;,&#39;8&#39;,&#39;9&#39;,&#39;0&#39;]

def decrypt(key, message):
    plaintext = []
    pos = 0
    for c in message:
        i = alphabet.index(c)
        j = (i - key[pos]) % len(alphabet)
        plaintext.append(alphabet[j])
        pos += 1
        if pos &gt; len(key)-1: pos = 0
    return &quot;&quot;.join(plaintext)
        

if __name__ == &#39;__main__&#39;:
    key = [3,-6,2,-7,23435363, -3243543, 324]
    for line in sys.stdin:
        decrypted = decrypt(key, line.strip())
        print decrypted

# vim:expandtab:ts=4:softtabstop=4:autoindent
&lt;/pre&gt;

And the test...
&lt;pre class=&quot;brush: bash&quot;&gt;
dave@davidpc:~/bin/simpleenc&gt; cat &lt;&lt; EOF | ./decrypt.py 
&gt; KYneJ9!rlnW
&gt; EOF
Hello World
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/5874408426252450683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/5874408426252450683' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/5874408426252450683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/5874408426252450683'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2013/07/simple-symmetric-shared-key-encryption.html' title='Simple symmetric / Shared key encryption tutorial'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-1949041906024436997</id><published>2013-05-16T17:05:00.000+12:00</published><updated>2013-05-17T09:58:25.383+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="kerberos"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="nslcd"/><category scheme="http://www.blogger.com/atom/ns#" term="pam"/><category scheme="http://www.blogger.com/atom/ns#" term="samba"/><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="winbind"/><title type='text'>Samba4 Windows AND Linux authentication</title><content type='html'>&lt;h2&gt;
Introduction&lt;/h2&gt;
This post describes all the millions of configuration files you need to set up on a CLIENT LINUX server / machine in order to ssh to it with your domain credentials.  I have this working in a LAB environment with the following&amp;nbsp;caveats:

&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;SELINUX disabled (work on this required)&lt;/li&gt;
&lt;li&gt;Firewall Disabled (not hard to fix this if required)&lt;/li&gt;
&lt;li&gt;DNS Setup not working completely for Forwarding to external Nameserver by Samba4. &amp;nbsp;Don&#39;t know why. (more investigation required)&lt;/li&gt;
&lt;li&gt;You will need to have a user called binduser which has permissions in AD to look up other users. &amp;nbsp;I am sure there is documentation on this around somewhere :)&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;h2&gt;
Install packages&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;yum -y install samba-winbind pam_ldap pam_krb5 nss-pam-ldapd oddjob-mkhomedir bind-utils
&lt;/pre&gt;
&lt;h2&gt;
Configure openldap (/etc/openldap/ldap.conf)&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;[root@linuxclient ~]# cat /etc/openldap/ldap.conf 
#
# LDAP Defaults
#

# See ldap.conf(5) for details
# This file should be world readable but not world writable.

#BASE   dc=example,dc=com
#URI    ldap://ldap.example.com ldap://ldap-master.example.com:666

#SIZELIMIT      12
#TIMELIMIT      15
#DEREF          never

TLS_CACERTDIR /etc/openldap/cacerts
URI ldap://pdc.vbox.local/
BASE dc=vbox,dc=local
&lt;/pre&gt;
&lt;h2&gt;
Configure PAM_LDAP (/etc/pam_ldap.conf)&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;[root@linuxclient ~]# cat /etc/pam_ldap.conf 
uri ldap://pdc.vbox.local/
base dc=vbox,dc=local
binddn cn=binduser,cn=Users,dc=vbox,dc=local
bindpw SECRET
scope sub
nss_base_passwd cn=Users,dc=vbox,dc=local
nss_base_shadow cn=Users,dc=vbox,dc=local
nss_base_group cn=Users,dc=vbox,dc=local
nss_map_objectclass posixAccount user
nss_map objectclass shadowAccount user
nss_map objectclass posixGroup group
nss_map_attribute homeDirectory unixHomeDirectory
nss_map_attribute uniqueMember member
nss_map_attribute shadowLastChange pwdLastSet
pam_login_attribute uid
pam_filter objectClass=user
pam_password md5
pam_member_attribute member
ssl no
tls_cacertdir /etc/openldap/cacerts
am_sasl_mech DIGEST-MD5
&lt;/pre&gt;
&lt;h2&gt;
Configure KRB5 (/etc/krb5.conf)&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;[root@linuxclient ~]# cat /etc/krb5.conf 
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/admind.log

[libdefaults]
 default_realm = VBOX.LOCAL
 dns_lookup_realm = true
 dns_lookup_kdc = true

[domain_realm]
.vbox.local = VBOX.LOCAL
vbox.local = VBOX.LOCAL

[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
validate = false
}

[realms]
VBOX.LOCAL = {
}

VBOX.LOCAL = {
}
&lt;/pre&gt;
&lt;h2&gt;
Configure the NSLC Daemon (/etc/nslcd.conf)&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;[root@linuxclient ~]# cat /etc/nslcd.conf                                                                                                                                                       
binddn cn=binduser,cn=Users,dc=vbox,dc=local                                                                                                                                                  
bindpw SECRET                                                                                                                                                                                
scope sub                                                                                                                                                                                       
base dc=vbox,dc=local                                                                                                                                                                           
scope  group  sub                                                                                                                                                                               
scope  hosts  sub                                                                                                                                                                               
pagesize 1000                                                                                                                                                                                   
referrals off
filter passwd (&amp;amp;(objectClass=user)(!(objectClass=computer)))
map    passwd uid              sAMAccountName
map    passwd homeDirectory    unixHomeDirectory
map    passwd gecos            displayName

filter shadow (&amp;amp;(objectClass=user)(!(objectClass=computer))(uidNumber=*)(unixHomeDirectory=*))
map    shadow shadowLastChange pwdLastSet
map    shadow uid              sAMAccountName

filter group (&amp;amp;(objectClass=group)(gidNumber=*))
map group uniqueMember member

uid nslcd
gid ldap
uri ldap://pdc.vbox.local/
ssl no
tls_cacertdir /etc/openldap/cacerts
&lt;/pre&gt;
&lt;h2&gt;
Configure Authconfig for SSH (/etc/sysconfig/authconfig)&lt;/h2&gt;
set: USEKERBEROS=yes
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;[root@linuxclient ~]# cat /etc/sysconfig/authconfig 
IPADOMAINJOINED=no
USEMKHOMEDIR=yes
USEPAMACCESS=no
CACHECREDENTIALS=yes
USESSSDAUTH=no
USESHADOW=yes
USEWINBIND=no
USESSSD=no
USEDB=no
FORCELEGACY=no
USEFPRINTD=no
USEHESIOD=no
FORCESMARTCARD=no
USELDAPAUTH=no
IPAV2NONTP=no
USELDAP=yes
USECRACKLIB=yes
USEIPAV2=no
USEWINBINDAUTH=yes
USESMARTCARD=no
USELOCAUTHORIZE=yes
USENIS=no
USEKERBEROS=yes
USESYSNETAUTH=no
PASSWDALGORITHM=sha512
USEPASSWDQC=no
&lt;/pre&gt;
&lt;h2&gt;
Update authconfig&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;authconfig --updateall
&lt;/pre&gt;
&lt;h2&gt;
Check PAM Configuration&lt;/h2&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;[root@linuxclient ~]# cat /etc/pam.d/system-auth
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      pam_env.so
auth        sufficient    pam_unix.so nullok try_first_pass
auth        requisite     pam_succeed_if.so uid &amp;gt;= 500 quiet
auth        sufficient    pam_krb5.so use_first_pass
auth        sufficient    pam_winbind.so use_first_pass
auth        required      pam_deny.so

account     required      pam_unix.so broken_shadow
account     sufficient    pam_localuser.so
account     sufficient    pam_succeed_if.so uid &amp;lt; 500 quiet
account     [default=bad success=ok user_unknown=ignore] pam_krb5.so
account     [default=bad success=ok user_unknown=ignore] pam_winbind.so
account     required      pam_permit.so

password    requisite     pam_cracklib.so try_first_pass retry=3 type=
password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password    sufficient    pam_krb5.so use_authtok
password    sufficient    pam_winbind.so use_authtok
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
session     optional      pam_oddjob_mkhomedir.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so
session     optional      pam_krb5.so
&lt;/pre&gt;
&lt;h2&gt;
Configure DNS Settings&lt;/h2&gt;
You need various AD names to resolve.  Especially for kerberos...

&lt;b&gt;Note:&lt;/b&gt; There is a problem here.  The Domain controller must FORWARD dns traffic it knows nothing about.
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;[root@linuxclient ~]# cat /etc/resolv.conf 
#nameserver must be the IP address of the domain controller.
domain vbox.local
nameserver 192.168.56.101
&lt;/pre&gt;
&lt;h2&gt;
Reboot&lt;/h2&gt;
A reboot is required to make sure everything works.</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/1949041906024436997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/1949041906024436997' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/1949041906024436997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/1949041906024436997'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2013/05/samba4-windows-and-linux-authentication.html' title='Samba4 Windows AND Linux authentication'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-1384154017873145012</id><published>2013-05-02T09:27:00.001+12:00</published><updated>2013-05-02T09:34:06.219+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="disable"/><category scheme="http://www.blogger.com/atom/ns#" term="kde"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="mouse"/><category scheme="http://www.blogger.com/atom/ns#" term="openSuSE"/><category scheme="http://www.blogger.com/atom/ns#" term="synaptics"/><category scheme="http://www.blogger.com/atom/ns#" term="touch-pad"/><category scheme="http://www.blogger.com/atom/ns#" term="typing"/><title type='text'>Disable the touch pad while typing on Linux</title><content type='html'>&lt;h2&gt;
The Problem:&lt;/h2&gt;
If you have a Synaptics touch-pad like the one I have on my HP ProBook 6560b, you might want to learn how to disable the touch-pad while typing.  This particular laptop has a touch-pad that is positioned poorly so it is common for your palm to be in contact with the pad while you type.

The solution is to disable it for 2 seconds while typing.  It is a minor inconvenience to have to wait two seconds to use it again but at least your typing is uninterrupted which could be a major inconvenience.&amp;nbsp;
&lt;br /&gt;
&lt;h2&gt;
The solution:&lt;/h2&gt;
Use the syndaemon tool that ships with the synaptics packages.  In my case they shipped by default.  You could always try the gui...

&lt;pre class=&quot;brush: bash&quot;&gt;david.latham@davepc:~&amp;gt; cat bin/touchpad.sh
#!/bin/bash
syndaemon -k -i 2 -d
&lt;/pre&gt;
Now just configure your desktop manager to run this script on start up.  It is a trivial thing to do in KDE under system settings -&amp;gt;  Sartup and Shutdown, Add Script...</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/1384154017873145012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/1384154017873145012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/1384154017873145012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/1384154017873145012'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2013/05/disable-touch-pad-while-typing-on-linux.html' title='Disable the touch pad while typing on Linux'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-3599536260076321840</id><published>2013-03-29T23:01:00.001+13:00</published><updated>2013-03-29T23:07:00.985+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dnsmasq"/><category scheme="http://www.blogger.com/atom/ns#" term="Firewall"/><category scheme="http://www.blogger.com/atom/ns#" term="iptables"/><category scheme="http://www.blogger.com/atom/ns#" term="openSuSE"/><category scheme="http://www.blogger.com/atom/ns#" term="VirtualBox"/><title type='text'>Firewall Script for openSuSE and others</title><content type='html'>openSuSE and, I guess, Fedora have introduced their own firewall (iptables) configuration guis and services that try to make the job of configuring iptables easy. &amp;nbsp;While that might be useful in a standard desktop environment, I found that it didn&#39;t do much for my &lt;a href=&quot;http://david-latham.blogspot.co.nz/2012/05/create-nat-for-virtualbox-host-only.html&quot; target=&quot;_blank&quot;&gt;Virtualbox nat&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I couldn&#39;t create the masqerade rules very easily and I didn&#39;t want all the extensive rules governing types of ICMP traffic and logging. &amp;nbsp;As the &lt;a href=&quot;http://en.opensuse.org/SuSEfirewall2&quot; target=&quot;_blank&quot;&gt;SuSEfirewall2&lt;/a&gt; service GUI didn&#39;t help and the configuration files were too complicated for this old school blogger, I decided to roll my own script.&lt;br /&gt;
&lt;br /&gt;
On my system, I simply disable the SuSEfirewall2 service and then call this script on boot.&lt;br /&gt;
&lt;br /&gt;
You can find this script and any changes I make to it on my &lt;a href=&quot;https://github.com/linuxplayground/firewall&quot; target=&quot;_blank&quot;&gt;github&lt;/a&gt;. &amp;nbsp;Of course, I won&#39;t be putting every rule I have in place online, that would be a crazy security risk. &amp;nbsp;I just wanted to show the basics that can be easily extended by adding more rules into the filter section.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: bash&quot;&gt;#!/bin/bash
IPT=/usr/sbin/iptables

# Stop the system firewall
systemctl stop SuSEfirewall2.service

# Reset all
$IPT -F
$IPT -X
$IPT -t nat -F
$IPT -t nat -X
$IPT -t mangle -F
$IPT -t mangle -X

# set default policies
$IPT -P INPUT DROP
$IPT -P OUTPUT ACCEPT
$IPT -P FORWARD DROP 

$IPT -A INPUT -i lo -j ACCEPT
$IPT -A OUTPUT -o lo -j ACCEPT

# filter all all related and established (reply traffic)
$IPT -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

# filter allow all traffic from vboxnet0 including new traffic.
$IPT -A INPUT -i vboxnet0 -j ACCEPT

# filter custom rules
$IPT -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,RELATED,ESTABLISHED -j ACCEPT

# forward traffic to and from vboxnet0
$IPT -A FORWARD -i vboxnet0 -j ACCEPT
$IPT -A FORWARD -o vboxnet0 -j ACCEPT

# postrouting so traffic from vboxnet appears to be from these devices.
$IPT -t nat -A POSTROUTING -s 192.168.56.0/24 -j MASQUERADE

# final rule to block inbound traffic
$IPT -A INPUT -j DROP
$IPT -A FORWARD -j DROP

# turn on ip_forward
sysctl net.ipv4.ip_forward=1

# turn on dnsmasq
systemctl start dnsmasq
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/3599536260076321840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/3599536260076321840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/3599536260076321840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/3599536260076321840'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2013/03/firewall-script-for-opensuse-and-others.html' title='Firewall Script for openSuSE and others'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-7732528229347708902</id><published>2013-02-09T11:22:00.000+13:00</published><updated>2013-02-11T16:45:03.816+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Virtual Machine"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle XE"/><category scheme="http://www.blogger.com/atom/ns#" term="ovmm"/><category scheme="http://www.blogger.com/atom/ns#" term="Password"/><title type='text'>Reset the Oracle XE database password for OVM 3.1.1.</title><content type='html'>You have installed Oracle OVM with the bundled XE database and after a time, you find that you can no longer log into the OVM Admin console.&lt;br /&gt;
&lt;br /&gt;
You get an error similar to: Unexpected Error logging in.&amp;nbsp; Consult logs...&lt;br /&gt;
&lt;br /&gt;
What has probably happened is that the ovs database password has expired in XE.&amp;nbsp; Now using the XE environment is unsupported and for demo purposes only.&amp;nbsp; In fact the new version of OVM ships with a bundled MySQL database and no longer the XE.&amp;nbsp; Even better, the bundled MySQL database is supported in production environments.&amp;nbsp; So this post is obsolete even before I finish writing it.&lt;br /&gt;
&lt;br /&gt;
To be sure you are facing this problem, grep for OVMDS in /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/servers/AdminServer/logs/AdminServer.log&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;####&amp;lt;Jan 28, 2013 12:19:51 PM NZDT&amp;gt; &amp;lt;Warning&amp;gt; &amp;lt;JDBC&amp;gt; &amp;lt;ovm.e-it.co.nz&amp;gt; &amp;lt;AdminServer&amp;gt; &amp;lt;Odof Tcp Client Thread: /127.0.0.1:54321/128430&amp;gt; &amp;lt;&amp;lt;anonymous&amp;gt;&amp;gt; &amp;lt;&amp;gt; &amp;lt;0000JcuiwIkCslYFLrfP8A1GSLRc000002&amp;gt; &amp;lt;1359328791693&amp;gt; &amp;lt;WL-001129&amp;gt; &amp;lt;Received exception while creating connection for pool &amp;quot;OVMDS&amp;quot;: ORA-28001: the password has expired&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
OK so the XE Database password needs resetting.&lt;br /&gt;
&lt;br /&gt;
First some environment variables:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;[root@ovm logs]# echo $ORACLE_HOME&lt;br /&gt;/u01/app/oracle/product/11.2.0/xe&lt;br /&gt;[root@ovm logs]# echo $PATH&lt;br /&gt;/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/u01/app/oracle/product/11.2.0/xe:/u01/app/oracle/product/11.2.0/xe/bin&lt;br /&gt;[root@ovm logs]# echo $ORACLE_SID&lt;br /&gt;XE&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Now use sqlplus as follows: (OldPassWord is the one you used when you installed OVMM.  The OVMM installer either prompted for this or you selected the option to use the same password for everything during install...  Remember?)&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;[root@ovm bin]# sqlplus ovs/OldPassWord&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 11.2.0.2.0 Production on Sat Feb 9 10:38:48 2013&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2011, Oracle.&amp;nbsp; All rights reserved.&lt;br /&gt;&lt;br /&gt;ERROR:&lt;br /&gt;ORA-28001: the password has expired&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Changing password for ovs&lt;br /&gt;New password: NewPassw0rd&lt;br /&gt;Retype new password: NewPassw0rd&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;Password changed&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; exit&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Now you need to update the password stored in Weblogic that is used to connect to the database.&amp;nbsp; Happily there is an admin tool for this:&lt;br /&gt;
It&#39;s found in:&amp;nbsp;&amp;nbsp; /u01/app/oracle/ovm-manager-3/bin &lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;[root@ovm bin]# ./ovm_admin --modifyds XE localhost 1521 &lt;br /&gt;&lt;br /&gt;Oracle VM Manager Release 3.1.1 Admin tool&lt;br /&gt;&lt;br /&gt;Please enter the Oracle VM Manager database schema : ovs&lt;br /&gt;&lt;br /&gt;Please enter the schema password for ovs : NewPassw0rd&lt;br /&gt;Please re-enter the password : NewPassw0rd&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please enter the password for weblogic : &amp;lt;password you used when you installed ovmm&amp;gt;&lt;br /&gt;&lt;br /&gt;Initializing WebLogic Scripting Tool (WLST) ...&lt;br /&gt;&lt;br /&gt;Welcome to WebLogic Server Administration Scripting Shell&lt;br /&gt;&lt;br /&gt;Type help() for help on available commands&lt;br /&gt;&lt;br /&gt;Connecting to WebLogic server ...&lt;br /&gt;&lt;br /&gt;Connected ...&lt;br /&gt;Modifying Oracle VM Manager Data Store &#39;OVMDS&#39;...&lt;br /&gt;Modified Data Store successfully ...&lt;br /&gt;Exiting...&lt;br /&gt;Restart of Oracle VM Manager is required for Data Store change to take effect ...&lt;/normalpassword&gt;&lt;/newpassw0rd&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;Now restart OVMM.&amp;nbsp; I like to allow a minute between stop and start.&amp;nbsp; This takes a while on my test environment...&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;[root@ovm bin]# /etc/init.d/ovmm stop &amp;amp;&amp;amp; sleep 60 &amp;amp;&amp;amp; /etc/init.d/ovmm start&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Finally you should be able to log into ovm console as you used to.&amp;nbsp; Same username and password you always used.&lt;br /&gt;
&lt;br /&gt;
This process updates the backend XE database password only.&amp;nbsp; Thankfully this should all be old news as the new version ships with MySQL and password resets in MySQL are much simpler.&amp;nbsp; The big question and one which I have not yet figured out the answer to is: Will the new OVMM support an external MySQL database...&amp;nbsp; In Production...
&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;Edit...&lt;/b&gt;&lt;/br&gt;
I had to edit the error message found in the AdminServer log on this blog because of the xml being interpreted instead of displayed...  Fixed now thanks to: &lt;a href=&quot;http://entities.online-toolz.com/tools/text-html-entities-convertor.php&quot;&gt;http://entities.online-toolz.com/tools/text-html-entities-convertor.php&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/7732528229347708902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/7732528229347708902' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/7732528229347708902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/7732528229347708902'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2013/02/reset-oracle-xe-database-password-for.html' title='Reset the Oracle XE database password for OVM 3.1.1.'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-2295896435971612002</id><published>2012-12-21T16:39:00.001+13:00</published><updated>2012-12-24T17:56:55.614+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="active directory"/><category scheme="http://www.blogger.com/atom/ns#" term="extend"/><category scheme="http://www.blogger.com/atom/ns#" term="samba4"/><category scheme="http://www.blogger.com/atom/ns#" term="sysadmin"/><category scheme="http://www.blogger.com/atom/ns#" term="yubico"/><category scheme="http://www.blogger.com/atom/ns#" term="yubikey"/><title type='text'>Extending the AD Schema on Samba4 - Part 2</title><content type='html'>&lt;h2&gt;
Importing LDIF files into Samba4 and Active Directory&lt;/h2&gt;
This is part 2 of the Extending AD Schema on Samba4 series.&amp;nbsp; The examples below are tested using the Samba4 LAB I created.&amp;nbsp; If you want more information on how that works then please read&amp;nbsp; &lt;a href=&quot;http://david-latham.blogspot.co.nz/2012/12/samba4-ga-release-virtualbox-lab.html&quot;&gt;http://david-latham.blogspot.co.nz/2012/12/samba4-ga-release-virtualbox-lab.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
For part one, please read &lt;a href=&quot;http://david-latham.blogspot.co.nz/2012/12/extending-ad-schema-on-samba4.html&quot;&gt;http://david-latham.blogspot.co.nz/2012/12/extending-ad-schema-on-samba4.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately the format of an ldif file for creating new attributes and classes in the Schema Configuration are differ between Samba4 and Microsoft.&lt;br /&gt;
&lt;br /&gt;
The tools are slightly different too.&amp;nbsp; So this article will attempt to make it all clear.&lt;br /&gt;
&lt;br /&gt;
Find all the latest versions of code on this post at&amp;nbsp;&lt;a href=&quot;https://github.com/linuxplayground/yubikey-ldap/tree/master/microsoft-schema&quot;&gt;https://github.com/linuxplayground/yubikey-ldap/tree/master/microsoft-schema&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;
Samba4 - ldbadd &amp;amp; ldbmodify&lt;/h3&gt;
&lt;br /&gt;
As far as I can tell the only way to create a new class with a custom attribute in Samba4 (on the Linux command line) is first add the attribute with ldbadd and then add the class with a seperate ldbadd followed by an ldbmodify command to update the User schema to include the new auxiliary class.&lt;br /&gt;
&lt;br /&gt;
I wrote a README.md file for when this eventually ends up on GIT.&amp;nbsp; Rather than retype it all, I shall just copy it as is:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;YubiKey LDIF Implimentation Into Samba4 Active Directory&lt;br /&gt;=======================================================&lt;br /&gt;&lt;br /&gt;This is an implimentation of the Openldap implimentation by Michal Ludvig &amp;lt;&lt;a href=&quot;http://logix.cz/michal/devel/yubikey-ldap/&quot;&gt;http://logix.cz/michal/devel/yubikey-ldap/&lt;/a&gt;&amp;gt; applied to Samba4 Active Directory.&lt;br /&gt;&lt;br /&gt;CAUTION&lt;br /&gt;-------&lt;br /&gt;This process will permanently modify your schema.&amp;nbsp; If it breaks you will not be able to recover unless from a backup.&amp;nbsp; Please backup your schema files before starting.&amp;nbsp; On a default install they can be found at /usr/local/samba/private/sam.ldb and all the files in /usr/local/samba/private/sam.ldb.d/&lt;br /&gt;&lt;br /&gt;yubikeyid.ldif&lt;br /&gt;--------------&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dn: CN=yubiKeyId,CN=Schema,CN=Configuration,dc=samba4,dc=internal&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; changetype: add&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objectClass: top&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objectClass: attributeSchema&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; attributeID: 1.3.6.1.4.1.40789.2012.11.1.2.1.1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cn: yubiKeyId&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; name: yubiKeyId&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lDAPDisplayName: yubiKeyId&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; description: Yubico YubiKey ID&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; attributeSyntax: 2.5.5.5&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oMSyntax: 22&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; isSingleValued: FALSE&lt;br /&gt;&lt;br /&gt;Add the yubiKeyId attribute into the Schema Configuration first with:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldbadd -H /usr/local/samba/private/sam.ldb \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yubikeyid.lidf \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --option=&quot;dsdb:schema update allowed&quot;=true&lt;br /&gt;&lt;br /&gt;yubikeyuser.ldif&lt;br /&gt;----------------&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dn: CN=yubiKeyUser,CN=Schema,CN=Configuration,dc=samba4,dc=internal&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; changetype: add&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objectClass: top&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objectClass: classSchema&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; governsID: 1.3.6.1.4.1.40789.2012.11.1.2.2.1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cn: yubiKeyUser&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; name: yubiKeyUser&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lDAPDisplayName: yubiKeyUser&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; description: Yubico YubiKey User&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subClassOf: top&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objectClassCategory: 3&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mayContain: yubiKeyId&lt;br /&gt;&lt;br /&gt;Next add the yubiKeyUser class into the Schema Configuration with:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldbadd -H /usr/local/samba/private/sam.ldb \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yubikeyuser.lidf \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --option=&quot;dsdb:schema update allowed&quot;=true&lt;br /&gt;&lt;br /&gt;updateUserClass.ldif&lt;br /&gt;--------------------&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dn: CN=User,CN=Schema,CN=Configuration,DC=samba4,DC=internal&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; changetype: modify&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; add: auxiliaryClass&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; auxiliaryClass: yubiKeyUser&lt;br /&gt;&lt;br /&gt;Apply the User class update with:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldbmodify -H /usr/local/samba/private/sam.ldb \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateUserClass.ldif \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --option=&quot;dsdb:schema update allowed&quot;=true&lt;br /&gt;&lt;br /&gt;Add YubiKeys to Users&lt;br /&gt;---------------------&lt;br /&gt;An example ldif:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dn: CN=David Latham,CN=Users,DC=samba4,DC=internal&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; changetype: modify&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; add: objectClass&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objectClass: yubiKeyUser&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; add: yubiKeyId&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; yubiKeyId: abcdefgh1234&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; yubiKeyId: xyzxyz123456&lt;br /&gt;&lt;br /&gt;Apply it with:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldapmodify -h samba -f addKeyToUser.ldif&lt;br /&gt;&lt;br /&gt;Test it with:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldapsearch -h samba -b &quot;CN=David Latham,CN=Users,DC=samba4,DC=internal&quot; yubiKeyId&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SASL/GSSAPI authentication started&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SASL username: administrator@SAMBA4.INTERNAL&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SASL SSF: 56&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SASL data security layer installed.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # extended LDIF&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # LDAPv3&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # base &lt;cn avid=&quot;avid&quot; internal=&quot;internal&quot; latham=&quot;latham&quot; samba4=&quot;samba4&quot; sers=&quot;sers&quot;&gt; with scope subtree&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # filter: (objectclass=*)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # requesting: yubiKeyId &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # David Latham, Users, samba4.internal&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dn: CN=David Latham,CN=Users,DC=samba4,DC=internal&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; yubiKeyId: abcdefgh1234&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; yubiKeyId: xyzxyz123456&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # search result&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; search: 5&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result: 0 Success&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # numResponses: 2&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # numEntries: 1&lt;br /&gt;&lt;br /&gt;Acknowledgments&lt;br /&gt;===============&lt;br /&gt;Michal Ludvig for defining the schema.&lt;br /&gt;Microsoft Documentation for information on attributeSyntax, oMSyntax and objecClassCategory&lt;/cn&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;Active Directory &amp;amp; the LDIFDE tool&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Use the following ldif file and the ldifde tool as described in the README.md below:&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;YubiKey Implimentation in Microsft Active Directory&lt;br /&gt;===================================================&lt;br /&gt;This is an implimentation of the Openldap implimentation by&lt;b&gt; &lt;/b&gt;Michal Ludvig &amp;lt;&lt;a href=&quot;http://logix.cz/michal/devel/yubikey-ldap/&quot;&gt;http://logix.cz/michal/devel/yubikey-ldap/&lt;/a&gt;&amp;gt;&lt;b&gt; &lt;/b&gt;applied to Microsft Active Directory.&lt;br /&gt;&lt;br /&gt;Notes&lt;br /&gt;-----&lt;br /&gt;In order to manage the Schema from a Windows client, please add the following line to your smb.conf under the [globals] section and restart samba4:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dsdb:schema update allowed = true&lt;br /&gt;&lt;br /&gt;You can use tools like ADSI Edit to manage the keys for users.&lt;br /&gt;There are also tutorials on the internet explaining how to crate a dialogue box / context menu tool for updating custom attributes in the Active Directory Server Admin tool. (dsa.msc)&lt;br /&gt;&lt;br /&gt;For a complete tutorial on all of this look at:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;a href=&quot;http://www.informit.com/articles/article.aspx?p=169630&amp;amp;seqNum=1&quot;&gt;http://www.informit.com/articles/article.aspx?p=169630&amp;amp;seqNum=1&lt;/a&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;Implimentation&lt;br /&gt;--------------&lt;br /&gt;&lt;br /&gt;Log into a Windows Server 2003 as a domain administrator and start a&lt;br /&gt;command prompt.&lt;br /&gt;&lt;br /&gt;Then execute:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldifde -i -f path\to\yubikey-ads.ldif -j .&lt;br /&gt;&lt;br /&gt;You should see something like:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6 entries modified successfully&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The command has completed successfully&lt;br /&gt;&lt;br /&gt;To test if this is all working you could add some kuys using the ADSI Edit&lt;br /&gt;snap-in.&amp;nbsp; &lt;br /&gt;* Browse to your Domain -&amp;gt; CN=Users&lt;br /&gt;* Right mouse click the username you want to edit&lt;br /&gt;* Select Properties&lt;br /&gt;* Scroll down to and select YubiKeyId&lt;br /&gt;* Click Edit&lt;br /&gt;* Add values until you are done&lt;br /&gt;* Click OK until you are finished.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
The LDIF File&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#&lt;br /&gt;# YubiKey LDAP schema for Microsoft Active Directory Server&lt;br /&gt;#&lt;br /&gt;# Install with ldifde -i -f path\to\yubikey-ads.ldif -j .&lt;br /&gt;# on a Windows Command prompt&lt;br /&gt;#&lt;br /&gt;#&lt;br /&gt;# Author: Michal Ludvig&lt;br /&gt;# Consider a small PayPal donation:&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http://logix.cz/michal/devel/yubikey-ldap/&lt;br /&gt;#&lt;br /&gt;# Converted to Microsoft Active Directory Server format by&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; David Latham &lt;david-latham .blogspot.com=&quot;.blogspot.com&quot;&gt;&lt;br /&gt;#&lt;br /&gt;dn: CN=yubiKeyId,CN=Schema,CN=Configuration,DC=samba4,DC=internal&lt;br /&gt;changetype: add&lt;br /&gt;objectClass: top&lt;br /&gt;objectClass: attributeSchema&lt;br /&gt;cn: yubiKeyId&lt;br /&gt;description: Yubico YubiKey ID&lt;br /&gt;attributeID: 1.3.6.1.4.1.40789.2012.11.1.2.1.1&lt;br /&gt;attributeSyntax: 2.5.5.5&lt;br /&gt;isSingleValued: FALSE&lt;br /&gt;oMSyntax: 22&lt;br /&gt;lDAPDisplayName: yubiKeyId&lt;br /&gt;name: yubiKeyId&lt;br /&gt;&lt;br /&gt;dn:&lt;br /&gt;changetype: modify&lt;br /&gt;add: schemaUpdateNow&lt;br /&gt;schemaUpdateNow: 1&lt;br /&gt;-&lt;br /&gt;&lt;br /&gt;dn: CN=yubiKeyUser,CN=Schema,CN=Configuration,DC=samba4,DC=internal&lt;br /&gt;changetype: add&lt;br /&gt;objectClass: top&lt;br /&gt;objectClass: classSchema&lt;br /&gt;cn: yubiKeyUser&lt;br /&gt;description: Yubico YubiKey User&lt;br /&gt;subClassOf: top&lt;br /&gt;governsID: 1.3.6.1.4.1.40789.2012.11.1.2.2.1&lt;br /&gt;mayContain: yubiKeyId&lt;br /&gt;rDNAttID: cn&lt;br /&gt;objectClassCategory: 3&lt;br /&gt;lDAPDisplayName: yubiKeyUser&lt;br /&gt;name: yubiKeyUser&lt;br /&gt;&lt;br /&gt;dn:&lt;br /&gt;changetype: modify&lt;br /&gt;add: schemaUpdateNow&lt;br /&gt;schemaUpdateNow: 1&lt;br /&gt;-&lt;br /&gt;&lt;br /&gt;dn: CN=User,CN=Schema,CN=Configuration,DC=samba4,DC=internal&lt;br /&gt;changetype: modify&lt;br /&gt;add: auxiliaryClass&lt;br /&gt;auxiliaryClass: yubiKeyUser&lt;br /&gt;-&lt;br /&gt;&lt;br /&gt;dn:&lt;br /&gt;changetype: modify&lt;br /&gt;add: schemaUpdateNow&lt;br /&gt;schemaUpdateNow: 1&lt;br /&gt;-&lt;/david-latham&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/2295896435971612002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/2295896435971612002' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/2295896435971612002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/2295896435971612002'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2012/12/extending-ad-schema-on-samba4-part-2.html' title='Extending the AD Schema on Samba4 - Part 2'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-7972433811143021385</id><published>2012-12-21T16:20:00.000+13:00</published><updated>2012-12-21T16:42:16.639+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="active directory"/><category scheme="http://www.blogger.com/atom/ns#" term="extend"/><category scheme="http://www.blogger.com/atom/ns#" term="samba4"/><category scheme="http://www.blogger.com/atom/ns#" term="sysadmin"/><category scheme="http://www.blogger.com/atom/ns#" term="yubico"/><category scheme="http://www.blogger.com/atom/ns#" term="yubikey"/><title type='text'>Extending the AD Schema on Samba4 - Part 1</title><content type='html'>My last post on Samba4 showed how easy it is to install and configure an AD Service on Linux.&amp;nbsp; If you&#39;ve not read it then please have a look. (&lt;a href=&quot;http://david-latham.blogspot.co.nz/2012/12/samba4-ga-release-virtualbox-lab.html&quot;&gt;http://david-latham.blogspot.co.nz/2012/12/samba4-ga-release-virtualbox-lab.html&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
This post show&#39;s how to extend the Samba4 Active Directory Schema.&amp;nbsp; Specifically for YubiKey integration.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;YubiKey&#39;s can be purchased for a relativlely low price from Yubico.&amp;nbsp; Please visit their &lt;a href=&quot;https://www.yubico.com/products/yubikey-hardware/yubikey/&quot; target=&quot;_blank&quot;&gt;website (www.yubico.com)&lt;/a&gt; for more information. &lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
LDAP Integration is very well covered by Michal Ludvig on his website and github.&amp;nbsp; (&lt;a href=&quot;http://www.logix.cz/michal/devel/yubikey-ldap/&quot;&gt;http://www.logix.cz/michal/devel/yubikey-ldap/&lt;/a&gt;) In fact we are planning to leverage his implementation at our work and are considering donating towards what&#39;s obviously a very good cause.&lt;br /&gt;
&lt;br /&gt;
Now seeing as though LDAP and AD are so similar and exhibit many of the same APIs, I began to wonder how this might fit in with Samba4.&amp;nbsp; Eventually we might end up using Samba4 for our domain and so I needed to figure out if I could, somehow, &quot;port&quot; the LDAP Schemas for Yubikey to AD.&amp;nbsp; I think I have managed it with extensive help from another blog.&amp;nbsp;&amp;nbsp; Thanks to Kurt Hudson and his wonderful article on www.informit.com titled, &quot;&lt;a href=&quot;http://www.informit.com/articles/article.aspx?p=169630&amp;amp;seqNum=1&quot; target=&quot;_blank&quot;&gt;Making AD Work Harder | Extending the Active Directory Schema to Track Custom Info&lt;/a&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
I should also acknowledge, once again, the Samba Wiki for a crucial piece of the puzzle in which we allow extensions to the Schema. (&lt;a href=&quot;https://wiki.samba.org/index.php/Samba4/Schema_extenstions&quot;&gt;https://wiki.samba.org/index.php/Samba4/Schema_extenstions&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Step 1: Backup Your Master Server&lt;/h3&gt;
In my case this was fairly simple.&amp;nbsp; I just took a snapshot of my Virtualbox image.&amp;nbsp; You need to do this though.&amp;nbsp; Messing with an AD schema can be fairly dangerous, especially if it&#39;s a Samba4 AD.&amp;nbsp; &lt;a href=&quot;https://wiki.samba.org/index.php/Samba4/Schema_extenstions&quot; target=&quot;_blank&quot;&gt;Samba&#39;s Wiki&lt;/a&gt; makes this quite clear.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Step 2: Enable Schema Extensions&lt;/h3&gt;
This is fairly straight forward and well explained on the Samba Wiki.&amp;nbsp; First edit your smb.conf and add the following line into the [globals] section.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;dsdb:schema update allowed = true&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
Then restart the samba service.. (btw: If you are interested in an init script for Samba4 on Centos 6 then find it at the end of this article.)&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Step 3: Set up Active
Directory Schema Console (on Windows)&lt;/h3&gt;
From here on, we will be working in Windows space.&amp;nbsp; The Active Directory Schema console is not registered by default.&amp;nbsp; So register it and create yourself a console.&lt;br /&gt;
&lt;br /&gt;
In a windows command prompt type:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;regsvr32 schmmgmt.dll&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Then use MMC -&amp;gt; Add Remove Snap-ins -&amp;gt;&amp;nbsp;  Active Directory
Schema snap-in. (follow the instructions on Kurt Hudson&#39;s &lt;a href=&quot;http://www.informit.com/articles/article.aspx?p=169630&amp;amp;seqNum=2&quot; target=&quot;_blank&quot;&gt;page&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Step 4: Add Yubikey Class and Attribute&lt;/h3&gt;
You need an attribute before you can create an object class.&lt;br /&gt;
The details for the Yubikey schema are available on Michal Ludvig&#39;s github site: &lt;a href=&quot;https://raw.github.com/mludvig/yubikey-ldap/master/ldap-schema/yubikey-SunDS.ldif&quot;&gt;https://raw.github.com/mludvig/yubikey-ldap/master/ldap-schema/yubikey-SunDS.ldif&lt;/a&gt;&lt;br /&gt;
The SunDS describes most closely the AD Version used in this article:&lt;br /&gt;
Here it is:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;pre&gt;&lt;i&gt;dn: cn=schema
objectclass: top
#
# YubiKey LDAP schema for Sun Directory Server and OpenDJ
#
# Copy this file to &lt;instance&gt;/config/schema/05-yubikey.ldif
#
# Author: Michal Ludvig &lt;michal logix.cz=&quot;logix.cz&quot;&gt;
# Consider a small PayPal donation:
#         http://logix.cz/michal/devel/yubikey-ldap/
#
# Converted for OpenDJ and Sun Directory Server by
#         Ludovic Poitou &lt;ludovic .poitou=&quot;.poitou&quot; gmail.com=&quot;gmail.com&quot;&gt;
#
attributeTypes: ( 1.3.6.1.4.1.40789.2012.11.1.2.1.1
  NAME &#39;yubiKeyId&#39;
  DESC &#39;Yubico YubiKey ID&#39;
  EQUALITY caseIgnoreIA5Match
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} )
objectClasses: ( 1.3.6.1.4.1.40789.2012.11.1.2.2.1
  NAME &#39;yubiKeyUser&#39;
  DESC &#39;Yubico YubiKey User&#39;
  SUP top
  AUXILIARY
  MAY ( yubiKeyId ) )&lt;/ludovic&gt;&lt;/michal&gt;&lt;/instance&gt;&lt;/i&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
Step 4a: Attribute &lt;/h4&gt;
In the Active Directory Schema Snap-in Console do the following:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Right click the Attributes Node and select Create Attribute on the context menu.&amp;nbsp; A message about the permanence of your operation will show up.&amp;nbsp; Well, jump right in.&amp;nbsp; You backed up in step 1.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Fill in the details as follows:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Common Name = yubiKeyId&lt;/li&gt;
&lt;li&gt; LDAP Display Name = yubiKeyId&lt;/li&gt;
&lt;li&gt;Unique X500 Object ID:&amp;nbsp; = 1.3.6.1.4.1.40789.2012.11.1.2.1.1&lt;/li&gt;
&lt;li&gt;Description = Yubico YubiKey User&lt;/li&gt;
&lt;li&gt;Syntax = Case Insensitive String&lt;/li&gt;
&lt;li&gt;Minimum = 0&lt;/li&gt;
&lt;li&gt;Maximum = 128&lt;/li&gt;
&lt;li&gt;Multi Valued = Ticked&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Click OK to add the attribute to the Attributes list.&amp;nbsp; If you expand the list, and scroll to the bottom, you will find yubiKeyId and you can right click, select properties and see something like this:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQAU8Sflg3tAzUChIkZ2b8ZlGtSqyy3s-sK5Cmo3YYBBEjwpO3L_69kXXMUIuiaVpUzd_3C-_T5bd7OTqTtvbHLVC0CfkepLIt5FC7mHhQz5QlqNesQGTd2I3wkRfEmLwkdBcBkxcEVes/s1600/yubi-key-id-attribute-properties.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQAU8Sflg3tAzUChIkZ2b8ZlGtSqyy3s-sK5Cmo3YYBBEjwpO3L_69kXXMUIuiaVpUzd_3C-_T5bd7OTqTtvbHLVC0CfkepLIt5FC7mHhQz5QlqNesQGTd2I3wkRfEmLwkdBcBkxcEVes/s1600/yubi-key-id-attribute-properties.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;i&gt;Note, I ticked &quot;multi valued&quot; but in the part where I create a dialogue box to enter the key id&#39;s I do not allow for multiple values.&amp;nbsp; That&#39;s on my TO DO List.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Step 4b: Add Yubikey Schema Object Class&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Begin by right mouse clicking Classes and select Create Class in the context menu.&lt;/li&gt;
&lt;li&gt;Fill in the details as follows:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Common Name: yubiKeyUser&lt;/li&gt;
&lt;li&gt;LDAP Display Name: yubiKeyUser&lt;/li&gt;
&lt;li&gt;Unique X500 Object ID:&amp;nbsp; 1.3.6.1.4.1.40789.2012.11.1.2.2.1&lt;/li&gt;
&lt;li&gt;Description: Yubico YubiKey User&lt;/li&gt;
&lt;li&gt;Parent Class: top&lt;/li&gt;
&lt;li&gt;Class Type: Select Auxilary&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Click Next&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Click Add next to Opional:&lt;/li&gt;
&lt;li&gt;Scroll all the way to the bottom and select yubiKeyId&lt;/li&gt;
&lt;li&gt;Click OK&lt;/li&gt;
&lt;li&gt;Click Finish&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Expand the Classes node, scroll to the bottom and right click yubiKeyUser, select Properties to see the following:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB3e6p4ngVSdjRIlPvI50NbStnXV8Azuij1kg7a6l1ZJr-KiIdrEMqsgK7YnKBtVNmcY9wDYyhxYj9i0sexLXWcce2wT8j14Ms6KRo0epKjCBiRTGp9wXnhbWw4t-J-MQGAFKwxek3AGk/s1600/yubi-key-user-props-general.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB3e6p4ngVSdjRIlPvI50NbStnXV8Azuij1kg7a6l1ZJr-KiIdrEMqsgK7YnKBtVNmcY9wDYyhxYj9i0sexLXWcce2wT8j14Ms6KRo0epKjCBiRTGp9wXnhbWw4t-J-MQGAFKwxek3AGk/s1600/yubi-key-user-props-general.JPG&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxWEVOsiRhKWgqYLcoLSeQkR9hnJunlyXiUplBtLwFNdDcr_cH3AGPT-Ck-I730k2fsysMEzzS1LASZmFeiVhceFFDoIag6LsGqVmp4EhiSOR6IPfJ5ZSfYecLbLM70qT6y7WZflcOTpo/s1600/yubi-key-user-props-relationships.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxWEVOsiRhKWgqYLcoLSeQkR9hnJunlyXiUplBtLwFNdDcr_cH3AGPT-Ck-I730k2fsysMEzzS1LASZmFeiVhceFFDoIag6LsGqVmp4EhiSOR6IPfJ5ZSfYecLbLM70qT6y7WZflcOTpo/s1600/yubi-key-user-props-relationships.JPG&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidoTgUrsCHDwEtWFGrDBuwwt__WrChD_aOA6AmNMTVuVjZTJm7eSMwaLFL2EKVQ5ar6QT0K75Mx64Xu5hsDf1T33pzx7hZrbmkQx9OiY7MG0z0eT32Iw1iuzo4-YqQTJK3j_qiES6-DDU/s1600/yubi-key-user-props-attributes.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidoTgUrsCHDwEtWFGrDBuwwt__WrChD_aOA6AmNMTVuVjZTJm7eSMwaLFL2EKVQ5ar6QT0K75Mx64Xu5hsDf1T33pzx7hZrbmkQx9OiY7MG0z0eT32Iw1iuzo4-YqQTJK3j_qiES6-DDU/s1600/yubi-key-user-props-attributes.JPG&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
So that&#39;s the GUI method.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
My next post will show how to import ldif files to make this process easier.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Read part 2 here: &lt;a href=&quot;http://david-latham.blogspot.co.nz/2012/12/extending-ad-schema-on-samba4-part-2.html&quot;&gt;http://david-latham.blogspot.co.nz/2012/12/extending-ad-schema-on-samba4-part-2.html&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/7972433811143021385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/7972433811143021385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/7972433811143021385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/7972433811143021385'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2012/12/extending-ad-schema-on-samba4.html' title='Extending the AD Schema on Samba4 - Part 1'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQAU8Sflg3tAzUChIkZ2b8ZlGtSqyy3s-sK5Cmo3YYBBEjwpO3L_69kXXMUIuiaVpUzd_3C-_T5bd7OTqTtvbHLVC0CfkepLIt5FC7mHhQz5QlqNesQGTd2I3wkRfEmLwkdBcBkxcEVes/s72-c/yubi-key-id-attribute-properties.JPG" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Auckland, New Zealand</georss:featurename><georss:point>-36.8484597 174.76333150000005</georss:point><georss:box>-37.254986699999996 174.11788450000006 -36.4419327 175.40877850000004</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2666170339866438578.post-7805892979952574240</id><published>2012-12-17T17:42:00.001+13:00</published><updated>2012-12-17T17:42:04.876+13:00</updated><title type='text'>Samba4 GA Release - Virtualbox LAB</title><content type='html'>&lt;h2&gt;
Introduction &lt;/h2&gt;
Configuring Samba has always been a pain in the you-know-what.&amp;nbsp; There is always some kind of permission here or there missing or misconfiguration resulting in endless hours of log trawling and frustrated users.&lt;br /&gt;
My profile photo on this blog was taken during just such a time... &lt;br /&gt;
&lt;br /&gt;
So I decided to build a LAB for Samba 4.&amp;nbsp; My LAB is for a fresh install.&amp;nbsp; I have not yet tried an upgrade.&amp;nbsp; Maybe that will come in a later post.&lt;br /&gt;
&lt;br /&gt;
The Samba4 how-to on their WIKI is very good and formed the basis of most of the work.&amp;nbsp; (&lt;a href=&quot;http://wiki.samba.org/index.php/Samba4/HOWTO&quot;&gt;http://wiki.samba.org/index.php/Samba4/HOWTO&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
Lab Environment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;LAB Built on Virtual Box using Ubuntu 12.04 LTS &lt;/li&gt;
&lt;li&gt;Samba Server&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;CentOS 6.3 x86_64 - Text based minimal install&lt;/li&gt;
&lt;li&gt;512mb RAM&lt;/li&gt;
&lt;li&gt;4GB OS (default partition layout from installer)&lt;/li&gt;
&lt;li&gt;8GB Secondary disk&lt;/li&gt;
&lt;li&gt;1xNIC on Host Only Adapter (Use dnsmasq on your host machine as per:&amp;nbsp; &lt;a href=&quot;http://david-latham.blogspot.co.nz/2012/05/create-nat-for-virtualbox-host-only.html&quot;&gt;http://david-latham.blogspot.co.nz/2012/05/create-nat-for-virtualbox-host-only.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;1xNIC on Internal Only Adapter (You will be serving the domain on a subnet assigned to this nic)&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Client&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Windows2003 R2 Standard Edition&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;h3&gt;
Samba OS Build&lt;/h3&gt;
&lt;h4&gt;
Hard Disk Configuration&lt;/h4&gt;
The Samba HOW-TO wiki states that some specific mount attributes are applied to your disks.&amp;nbsp; Here is my fstab.&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;[root@samba ~]# cat /etc/fstab&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# /etc/fstab&lt;br /&gt;# Created by anaconda on Thu Dec 13 13:55:41 2012&lt;br /&gt;#&lt;br /&gt;# Accessible filesystems, by reference, are maintained under &#39;/dev/disk&#39;&lt;br /&gt;# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info&lt;br /&gt;#&lt;br /&gt;/dev/mapper/VolGroup-lv_root /&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ext4 &lt;u&gt;user_xattr,acl,barrier=1&lt;/u&gt; 1 1&lt;br /&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;o font=&quot;font&quot;&gt;ther &quot;system&quot; lines not shown here&amp;gt;&lt;/o&gt;&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;# SAMBA&lt;br /&gt;/dev/mapper/vgsamba-lvwinhome /samba/home ext4 &lt;u&gt;user_xattr,acl,barrier=1&lt;/u&gt; 1 1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h4&gt;
Network Interface Configuration&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;/etc/sysconfig/network&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;NETWORKING=yes&lt;br /&gt;HOSTNAME=samba.example.com&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;/etc/sysconfig/network-scripts/ifcfg-eth0&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;DEVICE=&quot;eth0&quot;&lt;br /&gt;NM_CONTROLLED=&quot;no&quot;&lt;br /&gt;ONBOOT=&quot;yes&quot;&lt;br /&gt;BOOTPROTO=&quot;dhcp&quot;&lt;br /&gt;DHCP_HOSTNAME=samba.vbox.local&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;/etc/sysconfig/network-scripts/ifcfg-eth1&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;DEVICE=&quot;eth1&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;NM_CONTROLLED=&quot;no&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;ONBOOT=&quot;yes&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;BOOTPROTO=&quot;none&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;IPADDR=&quot;10.1.1.1&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;NETMASK=&quot;255.255.255.0&quot;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;h4&gt;
Iptables&lt;/h4&gt;
For Iptables, I went with an open configuration.&amp;nbsp; You should have a good and proper IPTABLES configuration in your production environment.&amp;nbsp; This LAB is about SAMBA4 not IPTABLES.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;/etc/sysconfig/iptables&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;The IPTABLES script below impliments a SNAT on all traffic to the IP Address of eth0.&amp;nbsp; Your IP address might be different.&amp;nbsp; This all depends on how you configured your &lt;i&gt;host only network&lt;/i&gt; in Virtualbox. &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;# Generated by iptables-save v1.4.7 on Thu Dec 13 14:26:37 2012&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;*nat&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;:PREROUTING ACCEPT [0:0]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;:POSTROUTING ACCEPT [0:0]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;:OUTPUT ACCEPT [0:0]&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;-A POSTROUTING -o eth0 -j SNAT --to-source 192.168.56.76 &lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;COMMIT&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;# Completed on Thu Dec 13 14:26:37 2012&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;# Generated by iptables-save v1.4.7 on Thu Dec 13 14:26:37 2012&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;*filter&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;:INPUT ACCEPT [12:1634]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;:FORWARD ACCEPT [0:0]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;:OUTPUT ACCEPT [0:0]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;COMMIT&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;# Completed on Thu Dec 13 14:26:37 2012&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
Enable IPv4 Packet Forwarding&lt;/h4&gt;
Once you do this, routing will take care of itself. &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Set &lt;u&gt;&lt;i&gt;&lt;b&gt;net.ipv4.ip_forward = 1&lt;/b&gt;&lt;/i&gt;&lt;/u&gt; in /etc/sysctl.conf&lt;/li&gt;
&lt;li&gt;execute&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;sysctl -p to read the new value.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;h3&gt;
Software pre-requisites and services &lt;/h3&gt;
&lt;h4&gt;
Software packages &lt;/h4&gt;
First establish the following dependancies.&amp;nbsp; (Note I used the groupinstall &quot;Development tools&quot; for convenience.&lt;br /&gt;
&lt;br /&gt;
Read: &lt;a href=&quot;http://wiki.samba.org/index.php/Samba_4/OS_Requirements&quot; target=&quot;_blank&quot;&gt;http://wiki.samba.org/index.php/Samba_4/OS_Requirements&lt;/a&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;yum -y install libacl-devel libblkid-devel gnutls-devel readline-devel python-devel gdb pkgconfig krb5-workstation zlib-devel setroubleshoot-server setroubleshoot-plugins policycoreutils-python libsemanage-python setools-libs-python setools-libs popt-devel libpcap-devel sqlite-devel libidn-devel libxml2-devel libacl-devel libsepol-devel libattr-devel keyutils-libs-devel cyrus-sasl-devel openssh-clients bind-utils dhcpd tcpdump man manpages wget&lt;/li&gt;
&lt;li&gt;yum -y groupinstall &#39;Development tools&#39;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
NTP &lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Download and install the latest NTP.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;DO NOT USE THE Distro Version as it does not support &quot;signed NTP&quot;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Use the &quot;more complex ntp.conf&quot; (2c)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Instructions here: &lt;a href=&quot;http://wiki.samba.org/index.php/Samba4/HOWTO#Step_10:_Configure_NTP_.28Optional.29&quot;&gt;http://wiki.samba.org/index.php/Samba4/HOWTO#Step_10:_Configure_NTP_.28Optional.29&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Note: I used ./configure --prefix=/ to ensure that NTP would be installed in my path.&amp;nbsp; This version did not ship with any useful init script so I just added the following to my rc.local:&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;# Start NTP Daemon&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;/sbin/ntpd -c /etc/ntp.conf&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
DHCP Server&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;Configure dhcpd to provide ip addresses on the internal network.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;dhcpd should also provide the netbios and wins ip addresses.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;subnet 10.1.1.0 netmask 255.255.255.0 {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; option routers&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10.1.1.1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; option subnet-mask&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 255.255.255.0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; option domain-name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;internal.local&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; option domain-name-servers 10.1.1.1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; option netbios-name-servers 10.1.1.1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; range 10.1.1.10 10.1.1.100;&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;ul&gt;&lt;ul&gt;
&lt;li&gt;Edit /etc/sysconfig/dhcpd and set &lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;DHCPDARGS=eth1&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;service start dhcpd&lt;/li&gt;
&lt;li&gt;chkconfig dhcpd on&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;h4&gt;
DNS Server&lt;/h4&gt;
I did not configure bind or dnsmasq for the Domain.&amp;nbsp; Samba4 Ships with an internal DNS server which is adequate for the purposes of demonstrating Samba4 awesomness.&amp;nbsp; The excellent BIND Nameserver is supported by Samba4 along with dns replication and all that jazz.&amp;nbsp; I have not tried it.&amp;nbsp; If you have, let us know in the comments below how it went.&lt;br /&gt;
&lt;br /&gt;
Once Samba is installed and operational there is a step required to make Samba forward DNS queries to your host&#39;s network as well as make the OS resolv.conf use the correct DNS.&amp;nbsp; This is because dhclient likes to automagially configure your resolv.conf every time you boot.&amp;nbsp; My work-around is just to overwrite it in /etc/rc.local.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;# fix resolv.conf&lt;br /&gt;mv /etc/resolv.conf /etc/resolv.conf.old&lt;br /&gt;cat &amp;gt;&amp;gt; /etc/resolv.conf &amp;lt;&amp;lt; EOF&lt;br /&gt;# Updated by rc.local script&lt;br /&gt;domain samba4.internal&lt;br /&gt;nameserver 10.1.1.1&lt;br /&gt;EOF&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
Install Samba4&lt;/h2&gt;
Installing Samba4 is fairly straightforward once you have all the pre-requisites in place.&amp;nbsp; It&#39;s well documented on the samba4 wiki so I won&#39;t get into it in any great detail here.&lt;br /&gt;
&lt;br /&gt;
I highly recommend completing the file system and kerberos tests outlined in the wiki how-to. (&lt;a href=&quot;http://wiki.samba.org/index.php/Samba4/HOWTO#Step_6:_Testing_Samba4&quot;&gt;http://wiki.samba.org/index.php/Samba4/HOWTO#Step_6:_Testing_Samba4&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;/h2&gt;
&lt;h2&gt;
smb.conf&lt;/h2&gt;
This is my lab smb.conf.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;u&gt;workgroups&lt;/u&gt;, &lt;u&gt;realm&lt;/u&gt;, &lt;u&gt;netbios&lt;/u&gt; and &lt;u&gt;server role&lt;/u&gt; all define the function of this samba instance.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;u&gt;dns forwarder&lt;/u&gt; tells samba where to send dns requests for hosts it knows nothing about.&lt;/li&gt;
&lt;li&gt;The netlogon share is for the logon script.&amp;nbsp; I have a log on script located in it&#39;s path and I set the default logon script in windows for each user to point to this script.&lt;/li&gt;
&lt;li&gt;sysvol is (unused at this stage)&lt;/li&gt;
&lt;li&gt;home is where all the user&#39;s WINDOWS home directories live&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;There are no unix home directories that map to the windows home directories&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;share is where all standard shares will live.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;[root@samba ~]# cd /usr/local/samba/etc&lt;br /&gt;[root@samba etc]# cat smb.conf&lt;br /&gt;# Global parameters&lt;br /&gt;[global]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workgroup = SAMBA4&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; realm = SAMBA4.INTERNAL&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; netbios name = SAMBA&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; server role = active directory domain controller&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dns forwarder = 192.168.56.1&lt;br /&gt;&lt;br /&gt;[netlogon]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = /usr/local/samba/var/locks/sysvol/samba4.internal/scripts&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; read only = No&lt;br /&gt;&lt;br /&gt;[sysvol]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = /usr/local/samba/var/locks/sysvol&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; read only = No&lt;br /&gt;[home]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; comment = Home Directories&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = /samba/home&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; read only = No&lt;br /&gt;[share]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; comment = Office Shares&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = /samba/home/shares&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; read only = No&lt;br /&gt;[root@samba etc]# &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h2&gt;
Configuring File Permissions and Shares&lt;/h2&gt;
Once these shares were configured in this basic way using smb.conf I was able to browse to the folders in my windows client using as follows:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;\\samba\home&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;\\samba\share&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;\\samba\netlogon\logon.bat&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;\\samba\sysvol&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
This was easily the 
most difficult part of the process for me to work out.&amp;nbsp; Once worked out 
though, it&#39;s a piece of cake.&amp;nbsp; Critically your file system must be 
mounted with the acl mount option.&lt;br /&gt;
&lt;br /&gt;
I have figured out 
that the most straight forward way of managing file shares is via 
Windows.&amp;nbsp; ie: Let samba take care of the acl entries in Linux.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
User accounts and home directories&lt;/h2&gt;
&lt;h3&gt;
Home directory ACLs &lt;/h3&gt;
Before creating user accounts its critical to make sure that the windows ACLs are configured correctly for \\samba\home.&amp;nbsp; Mine are as follows:&lt;br /&gt;
&lt;br /&gt;
First remove inheritance.&amp;nbsp; IE: The permissions for \\samba\home must not inherit from \\samba.&amp;nbsp; When removing inheritance hit the remove button and remove any other permissions groups / users listed.&lt;br /&gt;
&lt;br /&gt;
Then add new ones as follows:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Administrators = Full Control&lt;/li&gt;
&lt;li&gt;Everyone = No Control (all boxes unticked)&lt;/li&gt;
&lt;li&gt;Domain Users = Special Permissions as follows&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Traverse Folder and Execute File = TICKED&lt;/li&gt;
&lt;li&gt;All other special permissions = UNTICKED&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h3&gt;
Creating new users&lt;/h3&gt;
Run the dsa.msc snap in.&amp;nbsp; Installation instructions for the dsa.msc are covered in the samba4 wiki howto.&lt;br /&gt;
&lt;br /&gt;Create a new user using the &quot;New -&amp;gt; User&quot; task in the DSA Snapin.&amp;nbsp; The following screenshots show what to do:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNt5z9tY1sdk7yy4DeY2PhT5opDLaeDBU_6GUKTtqJIlcnLYlRYifCJpmhmK6eR64fCxV8wDVH13Jyay6qsq9srKpHc8FbknNKZyvLgmKvASISKQoqrtsC63a9L8rVD3pvTAXvVKpJ3aQ/s1600/dsa-new-user-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Dialogue box showing how to add a user with teh Windows DSA.  First, Last and user name&quot; border=&quot;0&quot; height=&quot;337&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNt5z9tY1sdk7yy4DeY2PhT5opDLaeDBU_6GUKTtqJIlcnLYlRYifCJpmhmK6eR64fCxV8wDVH13Jyay6qsq9srKpHc8FbknNKZyvLgmKvASISKQoqrtsC63a9L8rVD3pvTAXvVKpJ3aQ/s400/dsa-new-user-1.png&quot; title=&quot;Windows DSA - Create a new user&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add user Test User with username test.user&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglzXOj99-y8-fQKzkgrjmwlK58c8M_sCcC8d8M3Jw8X_ItuaPp8A3vbSsG9l1U8U5CezITVwtKJ42iEIZCMuF4uWrjo_hVo9ntTPJQCqAEe3qYkLnYPn45fUL9jpAaVtS3mgW__icmJ4c/s1600/dsa-new-user-2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Dialogue box showing how to add a user with teh Windows DSA.  Password&quot; border=&quot;0&quot; height=&quot;337&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglzXOj99-y8-fQKzkgrjmwlK58c8M_sCcC8d8M3Jw8X_ItuaPp8A3vbSsG9l1U8U5CezITVwtKJ42iEIZCMuF4uWrjo_hVo9ntTPJQCqAEe3qYkLnYPn45fUL9jpAaVtS3mgW__icmJ4c/s400/dsa-new-user-2.png&quot; title=&quot;Windows DSA - Create a new user - Password&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Set a password&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvuo0VrkBaQznrICaE9Oe9TzVBe9b7Oq5MV-SeuwTMX1p_dGrW6kKFOnGbEiJbGwOTwZgekB9SdyxES-jS9Pc1m_V5TJfEv80JLtSGAVTqW-I_oYEYRKSz5SNMUm-rbWSzznopWhaPRWk/s1600/dsa-new-user-3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Dialogue box showing how to add a user with teh Windows DSA.  Confirmation&quot; border=&quot;0&quot; height=&quot;337&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvuo0VrkBaQznrICaE9Oe9TzVBe9b7Oq5MV-SeuwTMX1p_dGrW6kKFOnGbEiJbGwOTwZgekB9SdyxES-jS9Pc1m_V5TJfEv80JLtSGAVTqW-I_oYEYRKSz5SNMUm-rbWSzznopWhaPRWk/s400/dsa-new-user-3.png&quot; title=&quot;Windows DSA - Create a new user - Confirmation&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Confirm details&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1wFireaq6bmNe6Qm5u7py-QXcK8C8NX4l_mG-tyZrBM5YQaa_0Ih9blR7ntcyCoogQ92PZC0AvpsBtI9n0DtZ2o1h71iGExQT0uZc2vMzGkqIwIYbclSWnR1y7SIZfQN8woklZwr175c/s1600/dsa-new-user-4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Dialogue box showing how to configure the user profile in the Windows DSA.  Set the logon path and the home folder&quot; border=&quot;0&quot; height=&quot;336&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1wFireaq6bmNe6Qm5u7py-QXcK8C8NX4l_mG-tyZrBM5YQaa_0Ih9blR7ntcyCoogQ92PZC0AvpsBtI9n0DtZ2o1h71iGExQT0uZc2vMzGkqIwIYbclSWnR1y7SIZfQN8woklZwr175c/s400/dsa-new-user-4.png&quot; title=&quot;Configure user profile in the Windows DSA&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Bring up the Profile tab under properties for this new user.&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Here, on the profile tab you should set the logon script for your user and map the home drive on the connect&amp;nbsp; button.&amp;nbsp; When you apply this, the test.user folder will be created on the share for you.&amp;nbsp; The permissions will also be configured appropriately as per the next screenshot.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifIa06BvaRpsGulvoqarvWJnT4DMA56O4C5VpBcreUcwwsV4N2194TZsK8OFNtTynBntb6RZhpwESH7O2dGvlm0lIjQwia9bofurRfsFE9mgysQ9u2tqsualXVfBh6TLgiQWhSguILRYs/s1600/dsa-new-user-5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Windows Security permissions dialogue box for new user home folder.&quot; border=&quot;0&quot; height=&quot;337&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifIa06BvaRpsGulvoqarvWJnT4DMA56O4C5VpBcreUcwwsV4N2194TZsK8OFNtTynBntb6RZhpwESH7O2dGvlm0lIjQwia9bofurRfsFE9mgysQ9u2tqsualXVfBh6TLgiQWhSguILRYs/s400/dsa-new-user-5.png&quot; title=&quot;Folder security permissions&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Confirm folder security permissions are correct.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;Use a similar approach to managing shared folders for group access.&lt;br /&gt;
&lt;br /&gt;
So far I have not encountered any gotchas with this approach.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/7805892979952574240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/7805892979952574240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/7805892979952574240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/7805892979952574240'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2012/12/samba4-ga-release-virtualbox-lab.html' title='Samba4 GA Release - Virtualbox LAB'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNt5z9tY1sdk7yy4DeY2PhT5opDLaeDBU_6GUKTtqJIlcnLYlRYifCJpmhmK6eR64fCxV8wDVH13Jyay6qsq9srKpHc8FbknNKZyvLgmKvASISKQoqrtsC63a9L8rVD3pvTAXvVKpJ3aQ/s72-c/dsa-new-user-1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2666170339866438578.post-1434308298077388290</id><published>2012-10-13T15:55:00.000+13:00</published><updated>2012-10-13T15:57:14.491+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Braodcom 10G Nic"/><category scheme="http://www.blogger.com/atom/ns#" term="DELL PowerEdge M620"/><category scheme="http://www.blogger.com/atom/ns#" term="driver"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Virtual Machine"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Virtual Server"/><title type='text'>Oracle Cloud Control</title><content type='html'>I had the occasion recently to deploy an OVM stack at a customer site. &amp;nbsp;Initially it was my intention to only deploy Enterprise Manager 12c and take advantage of the cloud control features within. &amp;nbsp;As it turned out, this provides merely a &quot;remote control&quot; function of an existing OVM Manager. &amp;nbsp;With this in mind, I could not find many advantages to using EM12c for Oracle virtual machine management.&lt;br /&gt;
&lt;br /&gt;
The next hurdle was with the hardware. &amp;nbsp;Of course, the physical servers we deployed the OVS 3.1.1.&amp;nbsp;hyper-visor&amp;nbsp;on were not &quot;Oracle Certified.&quot; &amp;nbsp;Specifically&amp;nbsp;DELL PowerEdge M620 Blade Servers. &amp;nbsp;(&lt;a href=&quot;http://www.dell.com/us/enterprise/p/poweredge-m620/pd?~ck=anav&quot;&gt;http://www.dell.com/us/enterprise/p/poweredge-m620/pd?~ck=anav&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
The customer had selected the&amp;nbsp;Broadcom®&amp;nbsp;&amp;nbsp;57810S-k Dual Port 10Gb KR blade NDC on board Network Adapter as well as the Mezzanine&amp;nbsp;Broadcom 5719 Serdes Quad Port 1Gb providing a total of 6 ethernet ports, two of them 10GB.&lt;br /&gt;
&lt;br /&gt;
The storage array is Equalogic iSCSI SAN. &amp;nbsp;(Sorry the exact make / model of the SAN escapes me right now.)&lt;br /&gt;
&lt;br /&gt;
The OVM 3.1.1. Server installation went perfectly well. &amp;nbsp;We selected the 3rd port for management (1st port on the 1g mezzanine card) knowing that ports 1 and 2 were to be used for iSCSI and possibly Live Migration.&lt;br /&gt;
&lt;br /&gt;
The blades were able to be discovered without difficulty into OVM manager. &amp;nbsp;Apon inspection, however, eth0 was showing as DOWN in all three blade servers. &amp;nbsp;The iDRAC console also showed that the link was UP but the OS State was reported as DOWN in each case. &amp;nbsp;I was able to successfully configure eth1 and create a single port bond with the appropriate IP address for the SAN and discover the storage. &amp;nbsp;Just without redundancy at this stage. &amp;nbsp;Of course this had to be resolved before production.&lt;br /&gt;
&lt;br /&gt;
I did some research and discovered that the OEM 3.1.1. hyper-visor is based on RHEL / OL 5.7 and that the broadcom driver (bnx2x) needed an option to force all ports back to legacy state. &lt;br /&gt;
&lt;br /&gt;
From: &lt;a href=&quot;ftp://ftp.supermicro.com/CDR-X9_1.11_for_Intel_X9_platform/Broadcom/Server/Linux/Driver/README.bnx2x.TXT&quot; target=&quot;_blank&quot;&gt;ftp://ftp.supermicro.com/CDR-X9_1.11_for_Intel_X9_platform/Broadcom/Server/Linux/Driver/README.bnx2x.TXT&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;Driver Parameters
=================

Several optional parameters can be supplied as a command line argument
to the insmod or modprobe command. These parameters can also be set in
modprobe.conf. See the man page for more information.

The optional parameter &quot;int_mode&quot; is used to force using an interrupt mode
other than MSI-X. By default, the driver will try to enable MSI-X if it is
supported by the kernel. In case MSI-X is not attainable, the driver will try
to enable MSI if it is supported by the kernel. In case MSI is not attainable,
the driver will use legacy INTx mode. In some old kernels, it&#39;s impossible to
use MSI if device has used MSI-X before and impossible to use MSI-X if device
has used MSI before, in these cases system reboot in between is required.

Set the &quot;int_mode&quot; parameter to 1 as shown below to force using the legacy
INTx mode on all NetXtreme II NICs in the system.

   insmod bnx2x.ko int_mode=1

or

   modprobe bnx2x int_mode=1
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
The way I&amp;nbsp;achieved&amp;nbsp;this was to add a file into /etc/modprobe.d as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;/etc/modprobe.d/bxn2x.conf
options bxn2x int_mode=1
&lt;/pre&gt;
&lt;br /&gt;
Reboot the blades and viola, eth0 shows status UP, ethtool eth0 indicates 10gb speed on the port and the iDRAC console shows all good on the port.&lt;br /&gt;
I then added eth0 to the bond I created earlier and left it in Active / Backup configuration.&lt;br /&gt;
&lt;br /&gt;
I was unable to make multipathing work through the GUI. &amp;nbsp;I suspect that OVM manager only discovers a single path to storage and does not attempt anything further. &amp;nbsp;I am confident that the Active Backup bond configuration will provide sufficient storage redundancy for the storage pool, server pool repository and PVM Guest LUNS.&lt;br /&gt;
&lt;br /&gt;
I hope this helps anyone who is also struggling with this issue.</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/1434308298077388290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/1434308298077388290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/1434308298077388290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/1434308298077388290'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2012/10/oracle-cloud-control.html' title='Oracle Cloud Control'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-4038858446522912545</id><published>2012-05-14T13:41:00.002+12:00</published><updated>2012-05-14T13:42:20.267+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LAB"/><category scheme="http://www.blogger.com/atom/ns#" term="Openfiler"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Virtual Machine"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Virtual Server"/><category scheme="http://www.blogger.com/atom/ns#" term="OVM"/><category scheme="http://www.blogger.com/atom/ns#" term="OVS"/><category scheme="http://www.blogger.com/atom/ns#" term="VirtualBox"/><title type='text'>Oracle Virtual Machine (OVM) LAB on VirtualBox</title><content type='html'>Oracle Virtual Machine (OVM) 3.1.1. was released on the 8th May 2012 and finally it&#39;s supported on VirtualBox.&amp;nbsp; This is great news for anyone who wants to give installing an OVM Lab a go.&lt;br /&gt;
&lt;br /&gt;
I gave it a go.&lt;br /&gt;
&lt;br /&gt;
I created 3 VirtualBox guests:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Openfiler for iSCSI with a 40GB virtual disk for chopping up into LUNs and iSCSI.&lt;/li&gt;
&lt;li&gt;Oracle Linux 6.0 on which I installed OVM 3.1.1. in Demo mode.&amp;nbsp; This guest has 4GB of RAM assigned to it and a 25GB HD.&amp;nbsp; Probably a bit big, but OVM is a large application with an Oracle XE database and Oracle Weblogic services installed, I thought better safe than sorry.&lt;/li&gt;
&lt;li&gt;Oracle Virtual Server 3.1.1.&amp;nbsp; This guest had just a 4GB HD and 1536MB of RAM which I figured would be just enough to get 1 virtual machine up and running on it.&lt;/li&gt;
&lt;/ol&gt;
My VirtualBox is configured with a couple of host only networks:&lt;br /&gt;
&lt;br /&gt;
vboxnet0 =&amp;gt; 192.168.56.0/24 =&amp;gt; Management network.&amp;nbsp; I also have dnsmasq configured on this network to serve IP addresses via DHCP to clients on this network.&amp;nbsp; Dnsmasq is installed on my laptop for this specific purpose.&amp;nbsp; See previous blog post...&lt;br /&gt;
vboxnet1 =&amp;gt; 192.168.57.0/24 =&amp;gt; Used for the storage network.&lt;br /&gt;
vboxnet2 =&amp;gt; 192.168.58.0/24 =&amp;gt; Production network for virtual machines.&lt;br /&gt;
&lt;br /&gt;
So I set up openfiler to offer 2x8GB LUNS, 1x2GB LUN for the cluster storage network on my server pool and 10GB NFS Share for the repository.&lt;br /&gt;
&lt;br /&gt;
The installation of OVS and OVM on Oracle Linux all went by without a hitch.&amp;nbsp; I made sure that each VirtualBox guest set their own hostnames against dnsmasq using the DHCP_HOSTNAME parameter on /etc/sysconfig/network.&amp;nbsp; This meant that all guests resolve nicely on DNS which is a prerequisite for a successful OVM LAB.&lt;br /&gt;
&lt;br /&gt;
The new OVM3.1.1. GUI is actually quite nice.&amp;nbsp; It&#39;s more polished and intuitive than 3.0.3. and more of the Right Mouse Button menus are enabled.&lt;br /&gt;
&lt;br /&gt;
I also made sure that SELINUX and IPTABLES was disabled in both OVS and the OVM guests.&lt;br /&gt;
&lt;br /&gt;
Server discovery went fine.&amp;nbsp; No problems at all.&amp;nbsp; Just enter the agent password and hostname of the OVS server.&lt;br /&gt;
&lt;br /&gt;
Storage discovery was a little tricky.&amp;nbsp; The NFS Share (Filesystem share) was no problem.&amp;nbsp; OVM was able to find and mount it wouthout any difficulty.&amp;nbsp; The only trouble I had there was making sure that Openfiler was configured correctly.&amp;nbsp; But that&#39;s not relevant to the OVM LAB really.&lt;br /&gt;
&lt;br /&gt;
The iSCSI discovery had me stumped for quite some time.&amp;nbsp; I could discover the iSCSI target presented by Openfiler without issue but could not get OVM to show me any LUNS. (Physical Disks)&amp;nbsp; After much trial and error I finally figured out that my OVS server did not have the multipathd service running.&amp;nbsp; Once I enabled and started multipathd (no change to default configuration), I was able to refresh the iSCSI storage in OVM and the physical disks were presented.&amp;nbsp; To recap: First perform iSCSI storage discovery using the OVS guest as the Storage Manager.&amp;nbsp; Then start multipathd on the OVS guest, then refresh the iSCSI storage on OVM and your LUNs will appear.&lt;br /&gt;
&lt;br /&gt;
I was able to create a server pool, assign the repository, assign the 2GB iSCSI LUN to the pool for it&#39;s cluster configuration data and actually configure a virtual machine.&amp;nbsp; I configured an Ubuntu VM with just 512MB of ram and one iSCSI LUN.&lt;br /&gt;
&lt;br /&gt;
Finally after so much success, my LAB failed me at the most crucial stage.&amp;nbsp; Starting the virtual machine. - It would not start.&amp;nbsp; It turns out that VirtualBox does not present hardware acceleration to it&#39;s guests.&amp;nbsp; So my OVS guest was running without any hardware acceleration in the virtual CPU.&amp;nbsp; OVM was not able to start the VM.&amp;nbsp; What a shame but there&amp;nbsp; you go.&lt;br /&gt;
&lt;br /&gt;
The good news is that many of the minor irritations in OVM3.0.3 seem to be cleared up and folks are able to now use VirtualBox for their LABs but they can&#39;t start OVM Virtual Machines if their OVS is actually a VirtualBox guest.&lt;br /&gt;
&lt;br /&gt;
Next step... Commandeer an old server somewhere, install OVS, bind it to the right LAN and carry on.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/4038858446522912545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/4038858446522912545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/4038858446522912545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/4038858446522912545'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2012/05/oracle-virtual-machine-ovm-lab-on.html' title='Oracle Virtual Machine (OVM) LAB on VirtualBox'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-3536474315932799053</id><published>2012-05-09T18:07:00.000+12:00</published><updated>2013-03-29T23:05:07.437+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dnsmasq"/><category scheme="http://www.blogger.com/atom/ns#" term="Firewall"/><category scheme="http://www.blogger.com/atom/ns#" term="iptables"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft PPTP VPN"/><category scheme="http://www.blogger.com/atom/ns#" term="NAT"/><category scheme="http://www.blogger.com/atom/ns#" term="VirtualBox"/><title type='text'>Create a NAT for VirtualBox Host Only Network</title><content type='html'>VirtualBox does a fairly good job with the built in NAT feature on the virtual network device.  But there are some drawbacks:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&amp;nbsp;You can&#39;t easily monitor the network on the built in NAT.&amp;nbsp; So if your VM is misbehaving, you couldn&#39;t use tcpdump to troubleshoot.&lt;/li&gt;
&lt;li&gt;The built in NAT reaches directly to the Internet in a transparent manner.&amp;nbsp; If you wanted to control access to the Internet you would have to switch to a bridge device or go with host-only.&lt;/li&gt;
&lt;li&gt;Most importantly for me, it does not support GRE packets very well.&amp;nbsp; This means that if you want to access a Microsoft PPTP VPN from your VM, it won&#39;t work with the VirtualBox built in NAT. (Well it didn&#39;t for me anyway)&lt;/li&gt;
&lt;/ol&gt;
&lt;b&gt;&lt;i&gt;EDIT: An updated script for the firewall component is described in a new post found here:&amp;nbsp;&lt;a href=&quot;http://david-latham.blogspot.co.nz/2013/03/firewall-script-for-opensuse-and-others.html&quot;&gt;http://david-latham.blogspot.co.nz/2013/03/firewall-script-for-opensuse-and-others.html&lt;/a&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
So with some simple tweaks to your host, you can NAT the VirtualBox host only network and enjoy some extra features.&lt;br /&gt;
&lt;br /&gt;
In VirtualBox create a default host-only network.&amp;nbsp; This is done in File -&amp;gt; Preferences -&amp;gt; Network.&amp;nbsp; Click the green icon with a PLUS sign in it.&amp;nbsp; A new network is created called vboxnet0.&amp;nbsp; Then click the little screwdriver icon to edit the vboxnet0 settings.&amp;nbsp; Select the DHCP Server tab and make sure &quot;Enable Server&quot; is unticked.&amp;nbsp; It will be ticked by default.&lt;br /&gt;
&lt;br /&gt;
Make sure that the DHCP server is not enabled.&amp;nbsp; This is important because you will configure DHCP with dnsmasq on the next step.&lt;br /&gt;
&lt;br /&gt;
Then install dnsmasq.&amp;nbsp; You need this for DNS.&amp;nbsp; I like that with dnsmasq, and dhcp client id&#39;s specified on the VM&#39;s, I can do things like &quot;ssh vm_hostname&quot; from the host pc.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;sudo apt-get install dnsmasq&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Accept the defaults.&lt;br /&gt;
&lt;br /&gt;
dnsmasq uses a config.d approach for configuration so create a file called: /etc/dnsmasq.d/virtualbox as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;# cat /etc/dnsmasq.d/virtualbox &lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;interface=vboxnet0&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;dhcp-range=192.168.56.2,192.168.56.150&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Restart dnsmasq:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;sudo /etc/init.d/dnsmasq restart&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Now configure IPTABLES.&amp;nbsp; I took a lazy approach and added these commands to /etc/rc.local&lt;br /&gt;
I have not bothered to learn how to do this with ubunut&#39;s default UFW becasue I don&#39;t much like UFW and so don&#39;t use it.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;sudo ufw disable&lt;/span&gt;&lt;/span&gt; (if you&#39;re interested ...)&lt;br /&gt;
&lt;br /&gt;
Add the following lines to /etc/rc.local (before the last line which is &quot;exit 0&quot;)&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;# Flush IPTABLES&lt;br /&gt;iptables -F&lt;br /&gt;iptables -t nat -F&lt;br /&gt;# Loopack&lt;br /&gt;iptables -A INPUT -i lo -j ACCEPT&lt;br /&gt;iptables -A OUTPUT -o lo -j ACCEPT&lt;br /&gt;&lt;br /&gt;# Allow all from virtualbox&lt;br /&gt;iptables -A INPUT -s 192.168.56.0/24 -j ACCEPT&lt;br /&gt;&lt;br /&gt;# Accept SSH&amp;nbsp; If you have openssh installed that is.&lt;br /&gt;iptables -A INPUT -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT&lt;br /&gt;&lt;br /&gt;# Accept DNS&lt;br /&gt;#iptables -A INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;#iptables -A INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;&lt;br /&gt;# Accept DHCP&lt;br /&gt;#iptables -A INPUT -p tcp --dport 67 -j ACCEPT&lt;br /&gt;#iptables -A INPUT -p udp --dport 67 -j ACCEPT&lt;br /&gt;&lt;br /&gt;# Masquerade virtualbox network&lt;br /&gt;iptables -t nat -A POSTROUTING -s 192.168.56.0/24 -j MASQUERADE&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;#turn on ip forwarding.&amp;nbsp; Can be done in /etc/syctl.conf - As I said - lazy.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;sysctl -w net.ipv4.ip_forward=1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then reboot your computer.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;sudo reboot&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Now change the nic on your VirtualBox vm to a Host Only network and start the VM.&amp;nbsp; If you did everything right, your VM will start, obtain a lease from dnsmasq and have access to the internet.&lt;br /&gt;
&lt;br /&gt;
The firewall rules above allow everything from VirtualBox to go out on the internet.&amp;nbsp; If you wanted to lock things down a bit, you could add more rules to do so and remove the line that accepts everything from the 192.168.56.0/24 subnet.&lt;br /&gt;
&lt;br /&gt;
Oh and your Microsoft PPTP VPN will work now.&amp;nbsp; Even if you use wireless...&lt;br /&gt;
&lt;br /&gt;
Have fun!&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/3536474315932799053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/3536474315932799053' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/3536474315932799053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/3536474315932799053'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2012/05/create-nat-for-virtualbox-host-only.html' title='Create a NAT for VirtualBox Host Only Network'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-5126593337481969494</id><published>2012-04-29T20:37:00.000+12:00</published><updated>2012-12-24T17:54:25.596+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IBM"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="multpath"/><category scheme="http://www.blogger.com/atom/ns#" term="perl"/><category scheme="http://www.blogger.com/atom/ns#" term="SAN"/><title type='text'>Parsing the Multipath</title><content type='html'>Having worked a little with XIV I have come to like the &quot;xiv_devlist&quot; tool.&amp;nbsp; &quot;xiv_devlist&quot; lists all the attached disks on the SAN and the number of paths that are currently active.&amp;nbsp; This is very useful when you want to ensure that all the paths to storage are active.&lt;br /&gt;
&lt;br /&gt;
Find latest up-to-date code for this post on my Github profile:&amp;nbsp;&lt;a href=&quot;https://github.com/linuxplayground/mpath_devlist&quot;&gt;https://github.com/linuxplayground/mpath_devlist&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It surprised me to find that there are no useful tools to parse the output from Multipath.&lt;br /&gt;
&lt;br /&gt;
Here is an example:&lt;br /&gt;
&lt;br /&gt;
multipath -ll&lt;br /&gt;
&lt;pre&gt;mpath2 (3600507680191014a3800000000000100) dm-7 IBM,2145                       
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]                       
\_ round-robin 0 [prio=100][active]                                            
 \_ 0:0:1:8  sdaa 65:160 [active][ready]                                       
 \_ 1:0:1:8  sdbk 67:224 [active][ready]                                       
\_ round-robin 0 [prio=20][enabled]                                            
 \_ 1:0:0:8  sdas 66:192 [active][ready]                                       
 \_ 0:0:0:8  sdi  8:128  [active][ready]                                       
mpath0 (3600507680191014a380000000000010a) dm-17 IBM,2145                      
[size=50G][features=1 queue_if_no_path][hwhandler=0][rw]                       
\_ round-robin 0 [prio=100][active]                                            
 \_ 1:0:1:0  sdbc 67:96  [active][ready]                                       
 \_ 0:0:1:0  sds  65:32  [active][ready]                                       
\_ round-robin 0 [prio=20][enabled]                                            
 \_ 1:0:0:0  sdak 66:64  [active][ready]                                       
 \_ 0:0:0:0  sda  8:0    [active][ready]                                       
mpath18 (3600507680191014a38000000000000ff) dm-24 IBM,2145                     
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]                       
\_ round-robin 0 [prio=100][active]                                            
 \_ 1:0:0:7  sdar 66:176 [active][ready]                                       
 \_ 0:0:0:7  sdh  8:112  [active][ready]                                       
\_ round-robin 0 [prio=20][enabled]                                            
 \_ 1:0:1:7  sdbj 67:208 [active][ready]                                       
 \_ 0:0:1:7  sdz  65:144 [active][ready]                                       
mpath17 (3600507680191014a38000000000000fe) dm-23 IBM,2145                     
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]                       
\_ round-robin 0 [prio=100][active]
 \_ 1:0:0:6  sdaq 66:160 [active][ready]
 \_ 0:0:0:6  sdg  8:96   [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 1:0:1:6  sdbi 67:192 [active][ready]
 \_ 0:0:1:6  sdy  65:128 [active][ready]
mpath16 (3600507680191014a3800000000000109) dm-22 IBM,2145
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 1:0:0:5  sdap 66:144 [active][ready]
 \_ 0:0:0:5  sdf  8:80   [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 1:0:1:5  sdbh 67:176 [active][ready]
 \_ 0:0:1:5  sdx  65:112 [active][ready]
mpath9 (3600507680191014a380000000000010c) dm-14 IBM,2145
[size=1.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 0:0:1:15 sdah 66:16  [active][ready]
 \_ 1:0:1:15 sdbr 68:80  [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 1:0:0:15 sdaz 67:48  [active][ready]
 \_ 0:0:0:15 sdp  8:240  [active][ready]
mpath15 (3600507680191014a3800000000000108) dm-21 IBM,2145
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 1:0:1:4  sdbg 67:160 [active][ready]
 \_ 0:0:1:4  sdw  65:96  [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 1:0:0:4  sdao 66:128 [active][ready]
 \_ 0:0:0:4  sde  8:64   [active][ready]
mpath8 (3600507680191014a380000000000010b) dm-13 IBM,2145
[size=1.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 1:0:0:14 sday 67:32  [active][ready]
 \_ 0:0:0:14 sdo  8:224  [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 0:0:1:14 sdag 66:0   [active][ready]
 \_ 1:0:1:14 sdbq 68:64  [active][ready]
mpath14 (3600507680191014a3800000000000107) dm-20 IBM,2145
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 1:0:0:3  sdan 66:112 [active][ready]
 \_ 0:0:0:3  sdd  8:48   [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 1:0:1:3  sdbf 67:144 [active][ready]
 \_ 0:0:1:3  sdv  65:80  [active][ready]
mpath7 (3600507680191014a3800000000000105) dm-12 IBM,2145
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 1:0:0:13 sdax 67:16  [active][ready]
 \_ 0:0:0:13 sdn  8:208  [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 0:0:1:13 sdaf 65:240 [active][ready]
 \_ 1:0:1:13 sdbp 68:48  [active][ready]
mpath13 (3600507680191014a3800000000000106) dm-19 IBM,2145
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 1:0:1:2  sdbe 67:128 [active][ready]
 \_ 0:0:1:2  sdu  65:64  [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 1:0:0:2  sdam 66:96  [active][ready]
 \_ 0:0:0:2  sdc  8:32   [active][ready]
mpath6 (3600507680191014a3800000000000104) dm-11 IBM,2145
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 0:0:1:12 sdae 65:224 [active][ready]
 \_ 1:0:1:12 sdbo 68:32  [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 1:0:0:12 sdaw 67:0   [active][ready]
 \_ 0:0:0:12 sdm  8:192  [active][ready]
mpath12 (3600507680191014a38000000000000fd) dm-18 IBM,2145
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 1:0:0:1  sdal 66:80  [active][ready]
 \_ 0:0:0:1  sdb  8:16   [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 1:0:1:1  sdbd 67:112 [active][ready]
 \_ 0:0:1:1  sdt  65:48  [active][ready]
mpath5 (3600507680191014a3800000000000103) dm-10 IBM,2145
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 1:0:0:11 sdav 66:240 [active][ready]
 \_ 0:0:0:11 sdl  8:176  [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 0:0:1:11 sdad 65:208 [active][ready]
 \_ 1:0:1:11 sdbn 68:16  [active][ready]
mpath11 (3600507680191014a380000000000010e) dm-16 IBM,2145
[size=1.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 0:0:1:17 sdaj 66:48  [active][ready]
 \_ 1:0:1:17 sdbt 68:112 [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 1:0:0:17 sdbb 67:80  [active][ready]
 \_ 0:0:0:17 sdr  65:16  [active][ready]
mpath4 (3600507680191014a3800000000000102) dm-9 IBM,2145
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 0:0:1:10 sdac 65:192 [active][ready]
 \_ 1:0:1:10 sdbm 68:0   [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 1:0:0:10 sdau 66:224 [active][ready]
 \_ 0:0:0:10 sdk  8:160  [active][ready]
mpath10 (3600507680191014a380000000000010d) dm-15 IBM,2145
[size=1.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 1:0:0:16 sdba 67:64  [active][ready]
 \_ 0:0:0:16 sdq  65:0   [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 0:0:1:16 sdai 66:32  [active][ready]
 \_ 1:0:1:16 sdbs 68:96  [active][ready]
mpath3 (3600507680191014a3800000000000101) dm-8 IBM,2145
[size=40G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=100][active]
 \_ 1:0:0:9  sdat 66:208 [active][ready]
 \_ 0:0:0:9  sdj  8:144  [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 0:0:1:9  sdab 65:176 [active][ready]
 \_ 1:0:1:9  sdbl 67:240 [active][ready]
&lt;/pre&gt;
&lt;br /&gt;
So if you wanted to check that there are 4 active / ready paths to each &quot;mpath&quot; disk, you would have to visually scan through the whole output above.&lt;br /&gt;
&lt;br /&gt;
A simple perl script that takes the output from multipath -ll as its input, can make this task much simpler.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;dave@davidpc:~/devel/paths$ cat paths.txt | ./mpath_list.pl 
00      PATH    UID                                     DM-ID   ACTIVE  RESULT
2       mpath2  3600507680191014a3800000000000100       dm-7    4 of 4  OK
0       mpath0  3600507680191014a380000000000010a       dm-17   4 of 4  OK
18      mpath18 3600507680191014a38000000000000ff       dm-24   4 of 4  OK
17      mpath17 3600507680191014a38000000000000fe       dm-23   4 of 4  OK
16      mpath16 3600507680191014a3800000000000109       dm-22   4 of 4  OK
9       mpath9  3600507680191014a380000000000010c       dm-14   4 of 4  OK
15      mpath15 3600507680191014a3800000000000108       dm-21   4 of 4  OK
8       mpath8  3600507680191014a380000000000010b       dm-13   4 of 4  OK
14      mpath14 3600507680191014a3800000000000107       dm-20   4 of 4  OK
7       mpath7  3600507680191014a3800000000000105       dm-12   4 of 4  OK
13      mpath13 3600507680191014a3800000000000106       dm-19   4 of 4  OK
6       mpath6  3600507680191014a3800000000000104       dm-11   4 of 4  OK
12      mpath12 3600507680191014a38000000000000fd       dm-18   4 of 4  OK
5       mpath5  3600507680191014a3800000000000103       dm-10   4 of 4  OK
11      mpath11 3600507680191014a380000000000010e       dm-16   4 of 4  OK
4       mpath4  3600507680191014a3800000000000102       dm-9    4 of 4  OK
10      mpath10 3600507680191014a380000000000010d       dm-15   4 of 4  OK
3       mpath3  3600507680191014a3800000000000101       dm-8    4 of 4  OK
&lt;/pre&gt;
&lt;br /&gt;
And the perl script that creates this output:
&lt;br /&gt;
EDIT: Revised script (2012-04-29) Added size, Removed flag variable from script.
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;#!/usr/bin/env perl
use Term::ANSIColor;

$count = 0;
print &quot;00\tPATH\tUID\t\t\t\t\tDM-ID\tSIZE\t\tACTIVE\tRESULT\n&quot;;
while(&amp;lt;STDIN&amp;gt;) {
        my ($line) = $_;
        chomp($line);
        if( $line =~ /^mpath(\d+)/ ) {
                my( $id ) = $1;
                /^(\w*) \((\w*)\)\s*(dm-\d*)/;
                if( $count &amp;gt; 0 ) { print $count, &quot; of 4\t&quot;;
                        if( $count == 4) {
                                print  color &#39;bold green&#39;; print &quot;OK\n&quot;; print color &#39;reset&#39;;
                        } else {
                                print color &#39;bold red&#39;; print &quot;PROBLEM\n&quot;; print color &#39;reset&#39;;
                        }
                        $count = 0;
                }
                my ($pname) = $1;
                my ($puid)  = $2;
                my ($pdmid) = $3;
                print $id,&quot;\t&quot;,$pname,&quot;\t&quot;,$puid,&quot;\t&quot;,$pdmid,&quot;\t&quot;;
        }
        if ( $line =~ m/^\[(.*?)\]/ ) {
                print $1,&quot;\t&quot;;
        }
        if ( $line =~ /^\s\\_.*active\]\[ready/ ) {
                $count += 1;
        }
}
if( $count &amp;gt; 0 ) { print $count, &quot; of 4\t&quot;;
        if( $count == 4) {
                print  color &#39;bold green&#39;; print &quot;OK\n&quot;; print color &#39;reset&#39;;
        } else {
                print color &#39;bold red&#39;; print &quot;PROBLEM\n&quot;; print color &#39;reset&#39;;
        }

        $count = 0;
}
print color &#39;reset&#39;;
exit 0;
&lt;/pre&gt;
&lt;br /&gt;
TO DO:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Call &quot;multipath -ll&quot; from inside the perl script thus remove the requirement to pipe the results of multipath -ll into the script.&lt;/li&gt;
&lt;li&gt;Make sure multipath -ll is a valid system call. &lt;/li&gt;
&lt;li&gt;Add a summary of the results, IE: 18 paths found, ALL GOOD.&lt;/li&gt;
&lt;li&gt;Add a check to ensure user is root at the beginning of the script and exit with message if not. &lt;/li&gt;
&lt;li&gt;Sort output results in order of mpath number.&lt;/li&gt;
&lt;/ol&gt;
</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/5126593337481969494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/5126593337481969494' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/5126593337481969494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/5126593337481969494'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2012/04/parsing-multipath.html' title='Parsing the Multipath'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-6402544192938324897</id><published>2012-04-15T00:26:00.000+12:00</published><updated>2012-04-15T00:27:14.225+12:00</updated><title type='text'>Policing my network</title><content type='html'>Policing my network - well not actually policing it, just locking it down.&lt;br /&gt;
&lt;br /&gt;
I have decided it&#39;s time to worry about what my kids might find on the Internet - my oldest is approaching 7 and beginning to spend more time on the &#39;puter.&lt;br /&gt;
&lt;br /&gt;
So here is the plan.&amp;nbsp; Not completely implemented just yet but getting there.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Enable mac address filtering on the router.&amp;nbsp; Only devices I know about are allowed to connect to the wireless router and a password is still required to gain access and an IP address on my LAN.&amp;nbsp; - DONE!&amp;nbsp; It works great and a quick visit to my router admin page shows me who is currently using it.&amp;nbsp;&amp;nbsp; Look this is just good sense.&amp;nbsp; If you are not doing mac address filtering book-mark this blog right now, and go and configure your router!&lt;/li&gt;
&lt;li&gt;Have a conversation with the child about the dangers and pitfalls of the Internet.&amp;nbsp; NOT DONE YET!&amp;nbsp; - I am kind of dreading this bit.&amp;nbsp; How do I explain to a child that it&#39;s bad to do something in such a way that they don&#39;t immediately go and do it.&amp;nbsp; (It&#39;s what I would have done if my parents warned me about porn on the Internet and then gave me access to the Internet.)&amp;nbsp; Kind of like God telling Adam and Eve not to eat the forbidden fruit then showing them where it is...&lt;/li&gt;
&lt;li&gt;Create an account with openDNS (&lt;a href=&quot;http://www.opendns.com/&quot;&gt;http://www.opendns.com/&lt;/a&gt;) - start off with the free one.&amp;nbsp; - DONE!&amp;nbsp; Testing at the moment on my own PC.&amp;nbsp; Tried visiting a couple of porn sites I remember from my bachelor days and yes - openDNS is blocking them.&amp;nbsp;&amp;nbsp; ----&amp;nbsp; I Should note, however, that it did nothing to prevent google from showing me all sorts of scary (sic) stuff when running a search on google images.&amp;nbsp; I guess this bit will just have to be covered by GOOD PARENTING! (Discussed in Step 2 - easier said than done...)&lt;/li&gt;
&lt;li&gt;Impliment openDNS or similar on border router (ADSL router).&amp;nbsp; Now nothing in the network will have access to said scary stuff except google image searches that is.&lt;/li&gt;
&lt;li&gt;Build small Linux desktop for child. -- Here it is.&amp;nbsp; The bit about Linux.&amp;nbsp; I intend to revive an old P100 or something slow like that I have lying around with a stable 12.04 (LTS) version of Ubuntu but with LXDE desktop to keep things sane.&amp;nbsp; Then I will configure PAM to restrict login times for the boy&#39;s user account, and then show some pop up warning (called by cron) so the boy has a chance to log out gracefully.&amp;nbsp; Because we don&#39;t want him on the thing all the time.&amp;nbsp; I have heard that kids will be up all night (just like me - it&#39;s now 00:25 in the morning) using their &#39;puters. &lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
So here are some links that might be useful.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.opendns.com/&quot;&gt;www.opendns.com&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.informit.com/articles/article.aspx?p=165226&quot;&gt;http://www.informit.com/articles/article.aspx?p=165226&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
So as I progress through all this, I will post here about how it all goes.&lt;br /&gt;
&lt;br /&gt;
Of course, if I was LOADED,$$$, I would buy the boy a MAC.&amp;nbsp; Apparently they have this sort of functionality built in.</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/6402544192938324897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/6402544192938324897' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/6402544192938324897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/6402544192938324897'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2012/04/policing-my-network.html' title='Policing my network'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-6720838257901411803</id><published>2012-02-18T16:03:00.001+13:00</published><updated>2012-02-18T16:03:26.401+13:00</updated><title type='text'>OGG to MP3 Conversion with ID3 tags</title><content type='html'>&lt;span style=&quot;font-family: inherit;&quot;&gt;I spend ages every time I need to do this to remember the correct format of the command:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;here it is at last:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #494949; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;/usr/bin/find -type f -name &quot;*.ogg&quot; | while read file; do echo &quot;working on $file&quot;; /usr/bin/gst-launch filesrc location=&quot;${file}&quot; ! oggdemux ! vorbisdec ! audioconvert ! lame quality=4 ! id3v2mux ! filesink location=&quot;`/usr/bin/dirname &quot;$file&quot;`/`/usr/bin/basename &quot;$file&quot; .ogg`.mp3&quot; 2&amp;gt;&amp;amp;1 &amp;amp;&amp;amp; /bin/rm &quot;$file&quot;; done | /usr/bin/tee -a $HOME/ogg2mp3results.txt&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #494949; font-family: inherit;&quot;&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #494949; font-family: inherit;&quot;&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;Find all the files&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #494949; font-family: inherit;&quot;&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;Convert them into mp3 with quality = 4 which is something like 44000khz and br=127kbit&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #494949; font-family: inherit;&quot;&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;Save them with an mp3 extension next to the original ogg&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #494949; font-family: inherit;&quot;&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;Remove the ogg file&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #494949; font-family: inherit;&quot;&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;Tee the output into a log.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #494949; font-family: inherit;&quot;&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #494949; font-family: inherit;&quot;&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;HA!&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/6720838257901411803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/6720838257901411803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/6720838257901411803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/6720838257901411803'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2012/02/ogg-to-mp3-conversion-with-id3-tags.html' title='OGG to MP3 Conversion with ID3 tags'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-2035395986736988125</id><published>2011-08-31T22:12:00.006+12:00</published><updated>2011-08-31T22:48:55.612+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="InnoDB"/><category scheme="http://www.blogger.com/atom/ns#" term="iSCSI"/><category scheme="http://www.blogger.com/atom/ns#" term="Multiple Volumes"/><category scheme="http://www.blogger.com/atom/ns#" term="MYISAM"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Network Storage"/><category scheme="http://www.blogger.com/atom/ns#" term="Redhat"/><title type='text'>Configuring MySQL on Redhat Linux while utilising network (iSCSI) storage.</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;Challenges:&lt;/span&gt;&lt;br /&gt;MySQL only allows a single location to be specified as the default data store for all databases. &lt;br /&gt;&lt;br /&gt;Consider the following typical scenario:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A database server running one instance of MySQL has its datastore located at /mysql/databases.&lt;/li&gt;&lt;li&gt;This server will contain multiple databases for multiple applications.&lt;/li&gt;&lt;li&gt;The database tables are a mixture of InnoDB and MYISAM storage engines.&lt;/li&gt;&lt;li&gt;The storage is provided by a SAN and separate storage volumes (iSCSI targets) are provisioned for each database.&lt;/li&gt;&lt;/ul&gt;In this scenario, you would want all your MYISAM files (*.MYI, *.MYD, *.frm) and all your InnoDB table spaces to be contained on the same iSCSI volume on a per-database basis.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is easily achieved by mounting the iSCSI target on a sub-folder of /mysql/databases.  For example:&lt;br /&gt;&lt;br /&gt;Mount iqn.openfiler.com:2006-06:blog-db-storage on /mysql/databases/blog&lt;br /&gt;&lt;br /&gt;Here is a sequence of steps that need to be carried out to make this work.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;in /etc/my.cnf set datastore=/mysql/databases&lt;/li&gt;&lt;li&gt;in /etc/my.cnf set innodb_file_per_table (&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/innodb-multiple-tablespaces.html&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/innodb-multiple-tablespaces.html&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;Configure SELINUX and user/group rights appropriately for MySQL.  There is heaps on this on the internet but please comment if you would like me to add some detail here.&lt;/li&gt;&lt;li&gt;Start the mysqld service&lt;/li&gt;&lt;li&gt;configure the mysql root password if necessary&lt;br /&gt;&lt;/li&gt;&lt;li&gt;login to mysql as root&lt;/li&gt;&lt;li&gt;create the blog database (create database blog;)  This creates the blog directory in /mysql/databases/blog  At this point there is nothing inside it.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;log out of mysql.&lt;/li&gt;&lt;li&gt;Mount your iscsi storage volume on /mysql/databases/blog&lt;/li&gt;&lt;li&gt;Configure your system so that the iscsi storage volume has a persistence and is always mounted on this location.  Redhat have a great tutorial on how to do this.  Basically it involves checking the WID of your iscsi target and then applying that to a udev rule that creates a consistently named block device under /dev&lt;/li&gt;&lt;li&gt;Now go ahead and create your tables.  All the MYISAM and InnoDB tables will be created inside the /mysql/databases/blog directory.&lt;/li&gt;&lt;/ol&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Code / Scripts:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I am happy to provide scripts or code if people want.  The following links should get you started.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Links:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/innodb-multiple-tablespaces.html&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/innodb-multiple-tablespaces.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/option-files.html&quot;&gt;http://dev.mysql.com/doc/refman/5.5/en/option-files.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization/sect-Virtualization-Virtualized_block_devices-Configuring_persistent_storage_in_Red_Hat_Enterprise_Linux_5.html#form-Virtualization-Configuring_persistent_storage_in_Red_Hat_Enterprise_Linux_6-Single_path_configuration&quot;&gt;http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization/sect-Virtualization-Virtualized_block_devices-Configuring_persistent_storage_in_Red_Hat_Enterprise_Linux_5.html#form-Virtualization-Configuring_persistent_storage_in_Red_Hat_Enterprise_Linux_6-Single_path_configuration&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/2035395986736988125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/2035395986736988125' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/2035395986736988125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/2035395986736988125'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2011/08/configuring-mysql-on-redhat-linux-while.html' title='Configuring MySQL on Redhat Linux while utilising network (iSCSI) storage.'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-5559689326043721312</id><published>2011-08-29T21:18:00.007+12:00</published><updated>2011-08-29T22:19:39.715+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="customer satisfaction"/><category scheme="http://www.blogger.com/atom/ns#" term="Customers"/><category scheme="http://www.blogger.com/atom/ns#" term="process"/><title type='text'>MUST FOLLOW PROCESS...</title><content type='html'>&lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;MUST FOLLOW PROCESS.... MUST FOLLOW PROCESS...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Starting with the premise that we need our customers to be happy with us, what do we need to do as an organisation to keep them that way?&lt;br /&gt;&lt;br /&gt;We are working through steps to improve our customer satisfaction at work by carefully considering how our daily work routines, processes and actions impact our customers.&lt;br /&gt;&lt;br /&gt;Consider this fairly typical example of how an organisation might respond to a customer request:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;[NOTE: This is a little bit (A LOT) satirical and not meant to in anyway be a real representation of an actual process.  It&#39;s designed to highlight how strict adherence to process can lead to unhappy customers.]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A customer needs a new type of widget.  Your organisation sells gadgets that are very similar to widgets so they approach you to design and build one for them.  They are willing to pay for the service but they need this new widget to work for them.&lt;br /&gt;&lt;br /&gt;Luckily your organisation has a process to handle this type of request.  It&#39;s called Customer Request Acceptance Process.  It is a sequence of actions scraped out of a managerial text book written in the early 1900&#39;s.&lt;br /&gt;&lt;br /&gt;So the sales rep in your organisation finds the appropriate template and begins...&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The sales rep spends 2 hours working out how best to express his customer&#39;s requirements on the template.  The template is designed to be all encompassing providing options for everything.  Clearly (from looking at the template) anything not covered by it&#39;s fields are not valid for submission.  &lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 102, 0);&quot;&gt;[Templates have their place but be careful of over detailing them - they get confusing.  A good place to start is a subject and details box.  Leave the rest to the technical guys to nut out.]&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The working group that handle inbound requests receive the completed form and instantly find gaps in information.  They make assumptions about some of the more obvious omissions and request clarification from the sales rep on the others.  &lt;span style=&quot;font-style: italic; font-weight: bold; color: rgb(0, 102, 0);&quot;&gt;[Leave the mind reading to the professionals]&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The sales rep is very confident that he understands 90% of the questions and answers them straight away and on the other 10% he seeks clarification.&lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt; &lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;[More mind reading...]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Finally the requirements are gathered (from the sales rep and via a series of mini assumptions about unimportant details)&lt;/li&gt;&lt;li&gt;A quote is hastily written up and the sales rep informed.  The sales rep sells the solution to the customer. &lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 102, 0);&quot;&gt;[the solution has to be sold???  I thought the customer asked for it in the first place.  Be careful! If you have to **sell** the solution to a customer request then it&#39;s probably not what they wanted.]&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The tech team receive the go-ahead and begin work on the widget.  The widget is FANTASTIC.  It&#39;s so damn clever, some individuals are already talking about it to their contacts in an effort to drum up even more revenue. &lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 102, 0);&quot;&gt;[Woooah there Silver, Does it work for the customer?  Has anyone asked them?]&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The widget is delivered more or less on schedule. &lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 102, 0);&quot;&gt;[Good work guys - go eat pizza and have a celebration.]&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The customer finds that it sort-of does what it&#39;s supposed to do but they don&#39;t complain because they have come to expect this sort of thing from the organisation.&lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 102, 0);&quot;&gt;[What???  This is acceptable to you Mr. Customer?  Find another provider already!]&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Your organisation sends the customer a survey asking how happy they are and soon it becomes apparent that they are not. &lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 102, 0);&quot;&gt;[By sending a survey out you send a message saying that you need to know what&#39;s wrong before you can fix it.  If you don&#39;t fix it your customer will assume your are being cynical about the whole survey thing and not bother answering it.]&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;My point with this extremely obvious example is that:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;a happy customer is very simply a customer that you talk to all the time!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So while your organisation might have a process and tools to manage that process, it&#39;s useless if you don&#39;t know what your customer really wants.&lt;br /&gt;&lt;br /&gt;Some customers are not too good at telling us what they really want. &lt;br /&gt;Most of the time, I suggest that we are not placing the appropriate individuals in our organisations together.  IE: Customer end user of WIDGET next to the provider technical person designing the WIDGET.  It makes sense that these two should work closely together. &lt;br /&gt;&lt;br /&gt;Providers should develop fast prototypes and be less precious about the their solutions in case they end up not being fit for purpose.  Every time a mistake is corrected, your product is improved.&lt;br /&gt;&lt;br /&gt;It is impossible to gather all the requirements in one go.  Requirements have a way of evolving as the design takes shape.&lt;br /&gt;&lt;br /&gt;No amount of technology based tools to manage your processes will help you if your processes do not include the customer at every step.&lt;br /&gt;&lt;br /&gt;Every step in your process that does not include the customer results in your product diverging further from the customer&#39;s requirements.&lt;br /&gt;&lt;br /&gt;We should all evaluate all the time how what we do impacts the customer.  If you don&#39;t know how your job impacts your customers, you should make it your number one concern to find out.  Customers pay your salary.  Not your boss or your manager.&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/5559689326043721312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/5559689326043721312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/5559689326043721312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/5559689326043721312'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2011/08/must-follow-process.html' title='MUST FOLLOW PROCESS...'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-590308651690282409</id><published>2011-07-21T22:59:00.002+12:00</published><updated>2011-07-21T23:04:14.190+12:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Security"/><title type='text'>REBLOG!!! Sticky bit, suid and guid</title><content type='html'>I have to reblog this article in it&#39;s full just in case the original author removes it.&lt;br /&gt;&lt;br /&gt;Here is the original.&lt;br /&gt;http://bashscript.blogspot.com/2010/03/unixlinux-advanced-file-permissions.html&lt;br /&gt;&lt;br /&gt;Here in plain text to ** FORCE ** it into my rubbish layout.&lt;br /&gt;&lt;br /&gt;UNIX/Linux Advanced File Permissions - SUID,SGID and Sticky Bit&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   After you have worked for a while with Linux you discover probably&lt;br /&gt;that there is much more to file permissions than just the &quot;rwx&quot; bits.&lt;br /&gt;When you look around in your file system you will see &quot;s&quot; and &quot;t&quot;&lt;br /&gt;&lt;br /&gt;$  ls -ld /tmp&lt;br /&gt;drwxrwxrwt 29 root root 36864 Mar 21 19:49 /tmp&lt;br /&gt;&lt;br /&gt;$  which passwd&lt;br /&gt;/usr/bin/passwd&lt;br /&gt;&lt;br /&gt;$  ls -l /usr/bin/passwd&lt;br /&gt;-rwsr-xr-x 1 root root 22984 Jan  6  2007 /usr/bin/passwd&lt;br /&gt;&lt;br /&gt; What is this &quot;s&quot; and &quot;t&quot; bit? The vector of permission bits is really&lt;br /&gt;4 * 3 bits long. Yes there are 12 permission bits,not just 9.The first&lt;br /&gt;three bits are special and are frequently zero. And you almost always&lt;br /&gt;learn about the trailing 9 bits first.Some people stop there and never&lt;br /&gt;learn those first three bits.&lt;br /&gt;&lt;br /&gt; The forth permission bit is used only when a special mode of a file&lt;br /&gt;needs to be set. It has the value 4 for SUID, 2 for SGID and 1 for the&lt;br /&gt;sticky bit. The other 3 bits have their usual significance.&lt;br /&gt;&lt;br /&gt; Here we will discuss about the 3 special attributes other than the&lt;br /&gt;common read/write/execute:&lt;br /&gt;&lt;br /&gt;     1.Set-User-Id (SUID)&lt;br /&gt;        2.Set-Group-Id (SGID)&lt;br /&gt;        3.Sticky Bit&lt;br /&gt;&lt;br /&gt;Set-User_Id (SUID): Power for a Moment:  &lt;br /&gt;&lt;br /&gt; By default, when a user executes a file, the process which results in&lt;br /&gt;this execution has the same permissions as those of the user. In fact,&lt;br /&gt;the process inherits his default group and user identification.&lt;br /&gt;&lt;br /&gt; If you set the SUID attribute on an executable file, the process res-&lt;br /&gt;ulting in its execution doesn&#39;t use the user&#39;s identification but the&lt;br /&gt;user identification of the file owner.&lt;br /&gt;&lt;br /&gt; The SUID mechanism,invented by Dennis Ritchie,is a potential security&lt;br /&gt;hazard. It lets a user acquire hidden powers by running such a file&lt;br /&gt;owned by root.&lt;br /&gt;&lt;br /&gt;$ ls -l /etc/passwd /etc/shadow /usr/bin/passwd&lt;br /&gt;-rw-r--r-- 1 root root  2232 Mar 15 00:26 /etc/passwd&lt;br /&gt;-r-------- 1 root root  1447 Mar 19 19:01 /etc/shadow&lt;br /&gt;&lt;br /&gt; The listing shows that passwd is readable by all, but shadow is unre-&lt;br /&gt;adable by group and others. When a user running the program belongs to&lt;br /&gt;one of these two categories (probably, others), so access fails in the&lt;br /&gt;read test on shadow. suppose normal user wants to change his password,&lt;br /&gt;How can he do that? He can do that by running /usr/bin/passwd. Many&lt;br /&gt;UNIX/Linux programs have a special permission mode that lets users&lt;br /&gt;update sensitive system files –like /etc/shadow --something they can&#39;t&lt;br /&gt;do directly with an editor. This is true of the passwd program.&lt;br /&gt;&lt;br /&gt;$ ls -l /usr/bin/passwd&lt;br /&gt;-rwsr-xr-x 1 root root 22984 Jan  6  2007 /usr/bin/passwd&lt;br /&gt;&lt;br /&gt;The s letter in the user category of the permission field represents a&lt;br /&gt;special mode known as the set-user-id (SUID). This mode lets a process&lt;br /&gt;have the privileges of the owner of the file during the instance of&lt;br /&gt;the program. Thus when a non privileged user executes passwd, the eff-&lt;br /&gt;ective UID of the process is not the user&#39;s, but of root&#39;s – the owner&lt;br /&gt;of the program. This SUID privilege is then used by passwd to edit&lt;br /&gt;/etc/shadow.&lt;br /&gt;&lt;br /&gt;What is effective user-id:&lt;br /&gt;&lt;br /&gt; Every process really has two user IDs: the effective user ID and the&lt;br /&gt;real user ID. (Of course, there&#39;s also an effective group ID and real&lt;br /&gt;group ID.Just about everything that&#39;s true about user IDs is also true&lt;br /&gt;about group IDs) Most of the time,the kernel checks only the effective&lt;br /&gt;user ID. For example, if a process tries to open a file, the kernel&lt;br /&gt;checks the effective user ID when deciding whether to let the process&lt;br /&gt;access the file.&lt;br /&gt;&lt;br /&gt;  Save the following script under the name reids.pl and make it&lt;br /&gt;executable (chmod 755 reids.pl). &lt;br /&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;# print real UID&lt;br /&gt;print &quot;Real UID: $&lt;\n&quot;;&lt;br /&gt;# print real GID&lt;br /&gt;print &quot;Real GID: $(\n&quot;;&lt;br /&gt;# print effective UID&lt;br /&gt;print &quot;Effective UID: $&gt;\n&quot;;&lt;br /&gt;# print effective GID&lt;br /&gt;print &quot;Effective GID: $)\n&quot;;&lt;br /&gt;&lt;br /&gt;check file permissions:&lt;br /&gt;&lt;br /&gt;$ ls -l reids.pl&lt;br /&gt;-rwxr-xr-x 1 venu venu 203 Mar 24 10:40 reids.pl&lt;br /&gt;&lt;br /&gt;Note: For security reasons the s-bit works only when used on binaries&lt;br /&gt;(compiled code) and not on scripts (an exception are perl scripts).&lt;br /&gt;Scripts,i.e. programs that cannot be executed by the kernel directory&lt;br /&gt;but need an interpreter such as the Bourne shell or Java,can have&lt;br /&gt;their setuid bit set, but it doesn&#39;t have any effect. There are some&lt;br /&gt;platforms that honor the s bits even on scripts ( some System V vari-&lt;br /&gt;ants, for example), but most systems don&#39;t because it has proven such&lt;br /&gt;a security headache - most interpreters simply aren&#39;t written with&lt;br /&gt;much security in mind. Set the SUID bit on shell script is useless,&lt;br /&gt;that&#39;s why I am using perl script here.&lt;br /&gt;&lt;br /&gt; When you run the script you will see that the process that runs it&lt;br /&gt;gets your user-ID and your group-ID:&lt;br /&gt;&lt;br /&gt;$ ./reids.pl&lt;br /&gt;Real UID: 500&lt;br /&gt;Real GID: 500 500&lt;br /&gt;Effective UID: 500&lt;br /&gt;Effective GID: 500 500&lt;br /&gt;&lt;br /&gt;Note: If you get an error like this:&lt;br /&gt;Can&#39;t do setuid (cannot exec sperl)&lt;br /&gt;&lt;br /&gt;In Debian install perl-suid using following command:&lt;br /&gt;apt-get install perl-suid&lt;br /&gt;&lt;br /&gt;In Centos install perl-suidperl using following command:&lt;br /&gt;yum install perl-suidperl&lt;br /&gt;&lt;br /&gt; Now change owner ship to  another user (Do it as an administrator).&lt;br /&gt;&lt;br /&gt;# chown king /home/venu/reids.pl&lt;br /&gt;# ls -l /home/venu/reids.pl&lt;br /&gt;-rwxr-xr-x 1 king venu 203 Mar 24 10:40 /home/venu/reids.pl&lt;br /&gt;&lt;br /&gt;Now run the script again.&lt;br /&gt;&lt;br /&gt;$ ./reids.pl&lt;br /&gt;Real UID: 500&lt;br /&gt;Real GID: 500 500&lt;br /&gt;Effective UID: 500&lt;br /&gt;Effective GID: 500 500&lt;br /&gt;&lt;br /&gt; What you observed, the output of the program depends only on the user&lt;br /&gt;that runs it and not the one who owns the file.&lt;br /&gt;&lt;br /&gt;How to assign SUID permission: &lt;br /&gt;&lt;br /&gt; The SUID for any file can be set (mostly by the superuser) with a&lt;br /&gt;special syntax of the chmod command. This syntax uses the character s&lt;br /&gt;as the permission. Now add SUID permission to the script reids.pl :&lt;br /&gt;&lt;br /&gt;# chmod u+s /home/venu/reids.pl     (Do it from root account)&lt;br /&gt;&lt;br /&gt;Now return from the super user mode to the usual non privileged mode.&lt;br /&gt;&lt;br /&gt;$ ls -l reids.pl&lt;br /&gt;-rwsr-xr-x 1 king venu 203 Mar 24 10:40 reids.pl&lt;br /&gt;&lt;br /&gt; To assign SUID in an absolute manner, simply prefix 4 to whatever&lt;br /&gt;octal string you would otherwise use (like 4755 instead of 755).&lt;br /&gt;&lt;br /&gt; The file reids.pl is owned by king and has the s-bit set where norma-&lt;br /&gt;lly the x is for the owner of the file. This causes the file to be&lt;br /&gt;executed under the user-ID of the user that owns the file rather than&lt;br /&gt;the user that executes the file. If venu runs the program then this&lt;br /&gt;looks as follows:&lt;br /&gt;&lt;br /&gt;$ perl reids.pl&lt;br /&gt;Real UID: 500&lt;br /&gt;Real GID: 500 500&lt;br /&gt;Effective UID: 503&lt;br /&gt;Effective GID: 500 500&lt;br /&gt;&lt;br /&gt; Effective user id of process is 503, this is not the venu&#39;s , but of&lt;br /&gt;king&#39;s - the owner of the program. As you can see this is a very powe-&lt;br /&gt;rful feature especially if root owns the file with s-bit set. Any user&lt;br /&gt;can then do things that normally only root can do.&lt;br /&gt;&lt;br /&gt;Caution:    When you write a SUID program then you must make sure that&lt;br /&gt;it can only be used for the purpose that you intended it to be used.&lt;br /&gt;As administrator, you must keep track of all SUID programs owned by&lt;br /&gt;root that a user may try to create or copy. The find command easily&lt;br /&gt;locate them:&lt;br /&gt;&lt;br /&gt;# find /home -perm -4000 -print | mail root&lt;br /&gt;&lt;br /&gt;  The extra octal bit (4) signifies the SUID mode, but find treats the&lt;br /&gt;  &quot;–&quot; before 4000 as representing any other permissions.&lt;br /&gt;&lt;br /&gt;Set-Group_Id (SGID):&lt;br /&gt;&lt;br /&gt; The set-group-id (SGID) is similar to SUID except that a program with&lt;br /&gt;SGID set allows the user to have the same power as the group which&lt;br /&gt;owns the program. The SGID bit is 2,and some typical examples could be&lt;br /&gt;chmod g+s reids.pl or chmod 2755 reids.pl.&lt;br /&gt;You can remove SGID bit using following commands:&lt;br /&gt;&lt;br /&gt;$ chmod g-s reids.pl&lt;br /&gt;$ chmod 755 reids.pl       (Absolute manner)&lt;br /&gt;&lt;br /&gt; It is really useful in case you have a real multi-user setup where&lt;br /&gt;users access each others files. As a single homeuser I haven&#39;t really&lt;br /&gt;found a lot of use for SGID. But the basic concept is the same as the&lt;br /&gt;SUID,Similar to SUID, SGID also grants privileges and access rights to&lt;br /&gt;the process running the command, but instead of receiving those of the&lt;br /&gt;file&#39;s owner it receives those of the file&#39;s group. In other words,the&lt;br /&gt;process group owner will be set to the file&#39;s group. &lt;br /&gt;&lt;br /&gt; I explain it with an example. I have created two user accounts king &lt;br /&gt;and venu with same home directory project. king belongs to king and&lt;br /&gt;development groups, venu belongs to venu and development groups.&lt;br /&gt;&lt;br /&gt;# groups king venu&lt;br /&gt;king : king development&lt;br /&gt;venu : venu development&lt;br /&gt;&lt;br /&gt;venu&#39;s default group is venu and king&#39;s default group is king.&lt;br /&gt;&lt;br /&gt; Login as king and create reids.pl  file again and make it executable&lt;br /&gt;(using  chmod 755 reids.pl) .&lt;br /&gt;&lt;br /&gt;$ id&lt;br /&gt;uid=503(king) gid=503(king) groups=501(development),503(king)&lt;br /&gt;$ ls -l reids.pl&lt;br /&gt;-rwxr-xr-x 1 king development 203 Mar 25 19:00 reids.pl&lt;br /&gt;&lt;br /&gt;Now login as venu and run the program:&lt;br /&gt;&lt;br /&gt;$ id&lt;br /&gt;uid=501(venu) gid=504(venu) groups=501(development),504(venu)&lt;br /&gt;$ perl reids.pl&lt;br /&gt;Real UID: 501&lt;br /&gt;Real GID: 504 504 501&lt;br /&gt;Effective UID: 501&lt;br /&gt;Effective GID: 504 504 501&lt;br /&gt;&lt;br /&gt;The effective GID of the process is the venu&#39;s,but not of the king&#39;s &lt;br /&gt;-the owner of the program.&lt;br /&gt;&lt;br /&gt;Now login as king and assign SGID bit to reids.pl program:&lt;br /&gt;&lt;br /&gt;$ chmod 2755 reids.pl; ls -l reids.pl&lt;br /&gt;-rwxr-sr-x 1 king development 203 Mar 25 19:00 reids.pl&lt;br /&gt;&lt;br /&gt;Now login as venu and run the reids.pl program:&lt;br /&gt;&lt;br /&gt;$ perl reids.pl&lt;br /&gt;Real UID: 501&lt;br /&gt;Real GID: 504 504 501&lt;br /&gt;Effective UID: 501&lt;br /&gt;Effective GID: 501 504 501&lt;br /&gt;&lt;br /&gt; Real GID and Effective GID are different,here Effective GID is the&lt;br /&gt;king&#39;s - the owner of the program.&lt;br /&gt;&lt;br /&gt;Set SGID on a directory:&lt;br /&gt;&lt;br /&gt; When SGID is set on a directory it has a special meaning. Files crea-&lt;br /&gt;ted in a directory with SGID set will inherit the same group ownership&lt;br /&gt;as the directory itself,not the group of the user who created the file.&lt;br /&gt;If the SGID is not set the file&#39;s group ownership corresponds to the&lt;br /&gt;user&#39;s default group.&lt;br /&gt;&lt;br /&gt; In order to set the SGID on a directory or to remove it, use the&lt;br /&gt;following commands:&lt;br /&gt;&lt;br /&gt;$ chmod g+s directory     or     $ chmod 2755 directory&lt;br /&gt;$ chmod g-s directory     or     $ chmod 755 directory&lt;br /&gt;&lt;br /&gt; As I mentioned earlier venu and king&#39;s home directory is same that is&lt;br /&gt;/home/project. I changed group ownership of /home/project directory&lt;br /&gt;to development.&lt;br /&gt;&lt;br /&gt;# ls -ld /home/project/&lt;br /&gt;drwxrwxr-x 16 root development 4096 Mar 26 00:22 /home/project/&lt;br /&gt;&lt;br /&gt;Now login as king and create a temp file.&lt;br /&gt;&lt;br /&gt;$ whoami&lt;br /&gt;king&lt;br /&gt;$ pwd&lt;br /&gt;/home/project/&lt;br /&gt;$ touch temp; ls -l temp&lt;br /&gt;-rw-r--r-- 1 king king 0 Mar 26 12:34 temp&lt;br /&gt;&lt;br /&gt; You can see from the ls output that the group owner for project is&lt;br /&gt;development, and that the SGID bit has not been set on the directory&lt;br /&gt;yet. When king creates a file in project, the group for the file is&lt;br /&gt;king (king&#39;s primary gid).&lt;br /&gt;&lt;br /&gt; Set SGID bit on project directory. For that login as administrator&lt;br /&gt;and set SGID bit using following command:&lt;br /&gt;&lt;br /&gt;# chmod g+s /home/project/&lt;br /&gt;# ls -ld /home/project/&lt;br /&gt;drwxrwsr-x 15 root development 4096 Mar 26 12:34 /home/project/&lt;br /&gt;&lt;br /&gt; From the ls output above, you know the SGID bit is set because of the&lt;br /&gt;s in the third position of the group permission set,which replaces the&lt;br /&gt;x in the group permissions.&lt;br /&gt;&lt;br /&gt;Now login as king and create temp2 file.&lt;br /&gt;&lt;br /&gt;$ whoami&lt;br /&gt;king&lt;br /&gt;$ touch temp2; ls -l temp2&lt;br /&gt;-rw-r--r-- 1 king development 0 Mar 26 13:49 temp2&lt;br /&gt;&lt;br /&gt; Notice the group ownership for temp2 file. It inherits group permiss-&lt;br /&gt;ion from the parent directory.&lt;br /&gt;&lt;br /&gt; Enabling SGID on a directory is extremely useful when you have a&lt;br /&gt;group of users with different primary groups working on the same set&lt;br /&gt;of files.&lt;br /&gt;&lt;br /&gt;        For system security reasons it is not a good idea to set many&lt;br /&gt;program&#39;s set user or group ID bits any more than necessary,since this&lt;br /&gt;can allow an unauthorized user privileges in sensitive system areas.If&lt;br /&gt;the program has a flaw that allows the user to break out of the inten-&lt;br /&gt;ded use of the program, then the system can be compromised.&lt;br /&gt;&lt;br /&gt;Sticky bit:&lt;br /&gt;&lt;br /&gt; The sticky bit(also called the saved text bit) is the last permission&lt;br /&gt;bit remaining to be discussed. It applies to both regular files and&lt;br /&gt;directories. When applied to a regular file, it ensures that the text&lt;br /&gt;image of a program with the bit set is permanently kept in the swap&lt;br /&gt;area so that it can be reloaded quickly when the program&#39;s turn to use&lt;br /&gt;the CPU arrives. Previously, it made sense to have this bit set for&lt;br /&gt;programs like vi and emacs. Today,machines with ultra-fast disk drives&lt;br /&gt;and lots of cheap memory don&#39;t need this bit for ordinary files and&lt;br /&gt;that is also useless.&lt;br /&gt;&lt;br /&gt; However, the sticky bit become a useful security feature when used&lt;br /&gt;with a directory. The UNIX/Linux system allows users to create files&lt;br /&gt;in /tmp, but none can delete files not owned by him. That&#39;s possible&lt;br /&gt;because sticky bit set for /tmp directory.&lt;br /&gt;&lt;br /&gt; The /tmp directory is typically world-writable and looks like this&lt;br /&gt;in a listing:&lt;br /&gt;&lt;br /&gt;# ls -ld /tmp&lt;br /&gt;drwxrwxrwt 32 root root 36864 Mar 27 12:38 /tmp&lt;br /&gt;&lt;br /&gt; Everyone can read,write and access the directory.The t indicates that&lt;br /&gt;only the user (root and owner of the directory,of course) that created&lt;br /&gt;a file in this directory can delete that file.&lt;br /&gt;&lt;br /&gt; In order to set or to remove the sticky bit, use the following&lt;br /&gt;commands:&lt;br /&gt;&lt;br /&gt;$ chmod +t directory     or    $ chmod 1754 directory&lt;br /&gt;$ chmod -t directory     or    $ chmod  754 directory&lt;br /&gt;&lt;br /&gt; Note: 754 permissions for a directory are powerful enough to guard&lt;br /&gt;your directories from intruders with malicious intentions, that&#39;s why&lt;br /&gt;I used 754 as default,if yow want you can change it.&lt;br /&gt;&lt;br /&gt;Example: &lt;br /&gt;&lt;br /&gt;I logged in as king and created a temp file.&lt;br /&gt;&lt;br /&gt;$ whoami&lt;br /&gt;king&lt;br /&gt;$ pwd&lt;br /&gt;/home/project/&lt;br /&gt;$ touch temp; ls -l&lt;br /&gt;-rw-r--r-- 1 king  king           0 Mar 27 13:44 temp&lt;br /&gt;&lt;br /&gt;Now logged in as venu and try to delete temp file.&lt;br /&gt;&lt;br /&gt;$ whoami&lt;br /&gt;venu&lt;br /&gt;$ rm temp&lt;br /&gt;rm: remove write-protected regular empty file `temp&#39;? Y&lt;br /&gt;$ ls temp&lt;br /&gt;ls: temp: No such file or directory&lt;br /&gt;&lt;br /&gt;So what happened? venu deleted file owned by king.&lt;br /&gt;&lt;br /&gt;Assign sticky bit to the project directory.As a owner of the directory&lt;br /&gt;or administrator.&lt;br /&gt;&lt;br /&gt;# chmod +t /home/project&lt;br /&gt;# ls -ld /home/project/&lt;br /&gt;drwxrwxr-t 15 root development 4096 Mar 27 13:46 /home/project/&lt;br /&gt;&lt;br /&gt; From the ls output above, you know the sticky bit is set because of&lt;br /&gt;the t in the third position of the other permission set,which replaces&lt;br /&gt;the x in the other permissions.&lt;br /&gt;&lt;br /&gt;Now repeat same steps again,then you get the following message:&lt;br /&gt;&lt;br /&gt;$ whoami&lt;br /&gt;venu&lt;br /&gt;$ ls -l temp&lt;br /&gt;-rw-r--r-- 1 king king 0 Mar 27 17:36 temp&lt;br /&gt;$ rm temp&lt;br /&gt;rm: remove write-protected regular empty file `temp&#39;? y&lt;br /&gt;rm: cannot remove `temp&#39;: Operation not permitted&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Observation: Login as normal user and create a file.&lt;br /&gt;[venu@localhost ~]$ touch sample&lt;br /&gt;[venu@localhost ~]$ ls -l sample &lt;br /&gt;-rw-rw-r-- 1 venu venu 0 Dec 21 03:41 sample&lt;br /&gt;&lt;br /&gt;Now change permissions to 644&lt;br /&gt;&lt;br /&gt;[venu@localhost ~]$ chmod 644 sample &lt;br /&gt;[venu@localhost ~]$ ls -l sample &lt;br /&gt;-rw-r--r-- 1 venu venu 0 Dec 21 03:41 sample&lt;br /&gt;&lt;br /&gt;Now assign SUID permission.&lt;br /&gt;&lt;br /&gt;[venu@localhost ~]$ chmod u+s sample &lt;br /&gt;[venu@localhost ~]$ ls -l sample &lt;br /&gt;-rwSr--r-- 1 venu venu 0 Dec 21 03:41 sample&lt;br /&gt;&lt;br /&gt;After setting SUID, if you see &#39;S&#39; then it means that the file has no &lt;br /&gt;executable permissions for that user.&lt;br /&gt;&lt;br /&gt;Now remove SUID permission and change permissions to 744. Then assign &lt;br /&gt;SUID permission. You should see a smaller &#39;s&#39; in the executable permi-&lt;br /&gt;ssion position.&lt;br /&gt;&lt;br /&gt;[venu@localhost ~]$ chmod u-s sample &lt;br /&gt;[venu@localhost ~]$ chmod 744 sample &lt;br /&gt;[venu@localhost ~]$ chmod u+s sample &lt;br /&gt;[venu@localhost ~]$ ls -l sample &lt;br /&gt;-rwsr--r-- 1 venu venu 0 Dec 21 03:41 sample&lt;br /&gt;&lt;br /&gt;Same is applicable for SGID and Stickybit.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Posted by venu k at 10:51 AM&lt;br /&gt;Labels: Article</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/590308651690282409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/590308651690282409' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/590308651690282409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/590308651690282409'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2011/07/reblog-sticky-bit-suid-and-guid.html' title='REBLOG!!! Sticky bit, suid and guid'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-1509074336704699866</id><published>2011-03-01T12:14:00.002+13:00</published><updated>2011-03-01T12:20:08.186+13:00</updated><title type='text'>Switch Google Desktop Search to search desktop by default</title><content type='html'>I recently installed the latest version of Google Desktop.  I found, however, that when searching either from the sidebar searchbox or the Ctrl Ctrl popup box, GD would always select Search Web by default.&lt;br /&gt;&lt;br /&gt;This can now be changed using a small registry edit on Windows XP it is:&lt;br /&gt;HKEY_CURRENT_USER\Software\Google\Google Desktop\Deskbar\ change search_type to &quot;Search Desktop&quot;&lt;br /&gt;&lt;br /&gt;That&#39;s it.  Hopefully this will save some of you some time.</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/1509074336704699866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/1509074336704699866' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/1509074336704699866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/1509074336704699866'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2011/03/switch-google-desktop-search-to-search.html' title='Switch Google Desktop Search to search desktop by default'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-2074376349478379090</id><published>2011-01-05T17:35:00.003+13:00</published><updated>2011-01-05T17:40:46.637+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="design principals"/><category scheme="http://www.blogger.com/atom/ns#" term="software design"/><category scheme="http://www.blogger.com/atom/ns#" term="unix philosophy"/><title type='text'>Some programming guidlines</title><content type='html'>This is a very simple post. I found these principals very useful in solving a problem I have with a particular project I am currently working on...&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Unix_philosophy&quot;&gt;http://en.wikipedia.org/wiki/Unix_philosophy&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;1.Small is beautiful.&lt;br /&gt;2.Make each program do one thing well.&lt;br /&gt;3.Build a prototype as soon as possible.&lt;br /&gt;4.Choose portability over efficiency.&lt;br /&gt;5.Store data in flat text files.&lt;br /&gt;6.Use software leverage to your advantage.&lt;br /&gt;7.Use shell scripts to increase leverage and portability.&lt;br /&gt;8.Avoid captive user interfaces.&lt;br /&gt;9.Make every program a filter.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Have a read. It&#39;s well worth remembering these guidelines. Even if you have read them before, it might be useful to refresh your memmory.</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/2074376349478379090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/2074376349478379090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/2074376349478379090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/2074376349478379090'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2011/01/some-programming-guidlines.html' title='Some programming guidlines'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-4698141050409864266</id><published>2010-12-15T03:18:00.001+13:00</published><updated>2010-12-15T03:21:31.241+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python web-service"/><category scheme="http://www.blogger.com/atom/ns#" term="ssl"/><title type='text'>Python Basic HTTPS webservice</title><content type='html'>The basic webservice module in my previous posting does not support https or ssl encryption.&lt;br /&gt;&lt;br /&gt;Here is how I finally managed to work it out:&lt;br /&gt;&lt;br /&gt;&lt;pre class=&#39;prettyprint&#39;&gt;&lt;br /&gt;# Basic https web server&lt;br /&gt;&lt;br /&gt;import socket, ssl&lt;br /&gt;&lt;br /&gt;host = &#39;&#39;&lt;br /&gt;port = 8080&lt;br /&gt;&lt;br /&gt;sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)&lt;br /&gt;sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)&lt;br /&gt;sock.bind((host, port))&lt;br /&gt;sock.listen(1)&lt;br /&gt;&lt;br /&gt;while 1:&lt;br /&gt;    osock, caddr = sock.accept()&lt;br /&gt;    csock = ssl.wrap_socket(osock,&lt;br /&gt;                                server_side=True,&lt;br /&gt;                                certfile=&quot;servercert.cer&quot;,&lt;br /&gt;                                keyfile=&quot;serverkey.key&quot;,&lt;br /&gt;                                ssl_version=ssl.PROTOCOL_SSLv23)&lt;br /&gt;                                &lt;br /&gt;    cfile = csock.makefile(&#39;rw&#39;, 0)&lt;br /&gt;&lt;br /&gt;    # Protocol exchange - read request&lt;br /&gt;    msg = &quot;GO AWAY!&quot;&lt;br /&gt;    while 1:&lt;br /&gt;        line = cfile.readline().strip()&lt;br /&gt;        if line == &quot;GET /echotest HTTP/1.1&quot;:&lt;br /&gt;            msg = &quot;ECHOTEST OK&quot;&lt;br /&gt;        if line == &#39;&#39;:&lt;br /&gt;            cfile.write(&quot;HTTP/1.0 200 OK\n\n&quot;)&lt;br /&gt;            cfile.write(&quot;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Eh?&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&quot;)&lt;br /&gt;            cfile.write(&quot;&amp;lt;h1&amp;gt;%s&amp;lt;/h1&amp;gt;&quot; % msg)&lt;br /&gt;            cfile.close()&lt;br /&gt;            csock.close()&lt;br /&gt;            osock.close()&lt;br /&gt;            break&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/4698141050409864266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/4698141050409864266' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/4698141050409864266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/4698141050409864266'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2010/12/python-basic-https-webservice.html' title='Python Basic HTTPS webservice'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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-2666170339866438578.post-3221041641936240519</id><published>2010-11-08T17:36:00.005+13:00</published><updated>2010-11-08T17:40:40.211+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Fedora 14"/><category scheme="http://www.blogger.com/atom/ns#" term="Pana"/><title type='text'>Compile Pana (Amarok 1.4 clone) on Fedora 14 x86_64</title><content type='html'>After meeting all the various dependencies, I had to make one small actual code change to the source code.  I would have liked to submit it on the Pana website but could not find a way to do that.&lt;br /&gt;&lt;br /&gt;Anyway here is the patch.&lt;br /&gt;&lt;pre class=&#39;prettyprint&#39;&gt;&lt;br /&gt;[dave@fedora junk]$ diff [source tree]/pana/src/osd.h [source tree]/pana/src/osd.h.original&lt;br /&gt;40c40&lt;br /&gt;&amp;lt;         void show( const QString &amp;text, QImage newImage = QImage() );&lt;br /&gt;---&lt;br /&gt;&amp;gt;         void show( const QString &amp;text, QImage newImage = QImage::QImage() );&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://david-latham.blogspot.com/feeds/3221041641936240519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2666170339866438578/3221041641936240519' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/3221041641936240519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2666170339866438578/posts/default/3221041641936240519'/><link rel='alternate' type='text/html' href='http://david-latham.blogspot.com/2010/11/compile-pana-amarok-14-clone-on-fedora.html' title='Compile Pana (Amarok 1.4 clone) on Fedora 14 x86_64'/><author><name>David Latham</name><uri>http://www.blogger.com/profile/10594846478482645782</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>