2013年5月10日金曜日

Ubuntu 13.04 で VMware workstation 8を動作させる

Ubuntu13.04では、VMware Workstation 8 for Linuxを動作させる場合に、
vmciモジュールがビルドできないため、動作しない。

vmciのパッチがこちらにあるので、この手順に従ってvmciを作り直すことで
動作するようになる。

http://communities.vmware.com/message/2235951#2235951

2013年4月11日木曜日

OpenLDAPのuniqueオーバーレイ

OpenLDAPを利用するときに、LDAPのエントリの重複を禁止したい場合があります。

このような場合に、uniqueオーバーレイを利用することができます。


例えば、uid属性の値の重複を dc=example,dc=com配下で禁止したい場合、slapd.confに次のような設定を行います。
overlay unique
unique_uri ldap:///dc=example,dc=com?uid?sub

重複を禁止する範囲をベースDNとscope(上記の場合 sub)で調整することができます。

また、適用範囲をフィルタで制限することも可能です。

詳細は、slapo-uniqueのmanページを参照してください。

uniqueオーバーレイのman

2012年11月20日火曜日

Solaris10のldapclient設定時の認証失敗

OpenLDAPをLDAPサーバーとして、Solaris10をLDAPクライアントとした場合、sshログインなどを試した場合に、次のメッセージが出力されて認証に失敗する場合がある。

Nov 20 22:12:14 yasuma73 sshd[3958]: [ID 316739 auth.error] pam_ldap: no legal authentication method configured

これは、LDAPサーバーに平文パスワードを登録している場合に出力される警告で、CRYPT形式でパスワードを格納すれば問題なく認証可能となる。

2012年10月19日金曜日

Samba4 RC3をDCとしてセットアップ

環境

CentOS6.3環境にSamba4をAD DCとしてセットアップする手順をまとめる。

SNTP対応xntpdの設定


CentOS6のxntpdは、sntpに対応していないため、CentOS6のxntpdパッケージをもとに、xntpd-4.2.6をsntp対応のxntpdパッケージとして再ビルドする。

パッケージングの手順は省略...

作成したxntpのパッケージをインストールする。
# rpm -Uhv ntp*rpm

/etc/ntp.confに以下を追加

server 127.127.1.1
fudge 127.127.1.1  stratum 12
ntpsigndsocket /var/run/ntp_signd/
restrict default mssntp

ntpdを再起動
# /sbin/service ntpd restart

Bind9.8のインストール

DLZに対応したbind-9.8.3-P2パッケージをインストール
  • bind-9.8.3-P2.el6.x86_64.rpm
  • bind-libs-9.8.3-P2.el6.x86_64.rpm
  • bind-license-9.8.3-P2.el6.noarch.rpm
  • bind-utils-9.8.3-P2.el6.x86_64.rpm

Samba4のセットアップ

samba4パッケージに必要な次のパッケージをインストール

# yum install xinetd  

最初にsamba3パッケージ関連を削除

# rpm -e samba-client samba-common samba-winbind-clients libsmbclient --nodeps

samba4パッケージ一式をインストール。

Samba4のprovisioning


# /usr/bin/samba-tool domain provision
Realm [EXAMPLE.COM]: 
Domain [EXAMPLE]: 
Server Role (dc, member, standalone) [dc]: 
DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]: BIND9_DLZ
Administrator password: 
Retype password: 
Looking up IPv4 addresses
More than one IPv4 address found. Using 192.168.2.8
Looking up IPv6 addresses
No IPv6 address will be assigned
Setting up share.ldb
Setting up secrets.ldb
Setting up the registry
Setting up the privileges database
Setting up idmap db
Setting up SAM db
Setting up sam.ldb partitions and settings
Setting up sam.ldb rootDSE
Pre-loading the Samba 4 and AD schema
Adding DomainDN: DC=example,DC=com
Adding configuration container
Setting up sam.ldb schema
Setting up sam.ldb configuration data
Setting up display specifiers
Adding users container
Modifying users container
Adding computers container
Modifying computers container
Setting up sam.ldb data
Setting up well known security principals
Setting up sam.ldb users and groups
Setting up self join
Adding DNS accounts
Creating CN=MicrosoftDNS,CN=System,DC=example,DC=com
Creating DomainDnsZones and ForestDnsZones partitions
Populating DomainDnsZones and ForestDnsZones partitions
See /etc/samba/named.conf for an example configuration include file for BIND
and /etc/samba/named.txt for further documentation required for secure DNS updates
Setting up sam.ldb rootDSE marking as synchronized
Fixing provision GUIDs
A Kerberos configuration suitable for Samba 4 has been generated at /etc/samba/krb5.conf
Once the above files are installed, your Samba4 server will be ready to use
Server Role:           active directory domain controller
Hostname:              samba4
NetBIOS Domain:        EXAMPLE
DNS Domain:            example.com
DOMAIN SID:            S-1-5-21-858491299-1320590862-3958657269
A phpLDAPadmin configuration file suitable for administering the Samba 4 LDAP server has been created in /etc/samba/phpldapadmin-config.php.

Bindの設定

/etc/samba/named.txtに記載されている設定などをDNSに行う。

DLZ機能を利用可能とするための設定を /etc/named.confに追加する。
include "/etc/samba/named.conf";

Bind9.8.3を利用しているので、 /etc/named.confのoptionsセクションに、以下の設定を追加。

tkey-gssapi-keytab "/etc/samba/dns.keytab";

namedがファイルを読み込めるように、次のコマンドを実行

# chgrp named /etc/samba/dns.keytab
# chmod g+r /etc/samba/dns.keytab


namedが127.0.0.1以外のインターフェースもLISTENする用に、次の設定を /etc/named.confから削除
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };

namedを再起動
# /sbin/service named start

/var/log/messagesに次のように、DLZドライバの読み込みが行われている。

Oct 19 21:03:09 samba4 named[27126]: Loading 'AD DNS Zone' using driver dlopen
Oct 19 21:03:10 samba4 named[27126]: samba_dlz: started for DN DC=example,DC=com
Oct 19 21:03:10 samba4 named[27126]: samba_dlz: starting configure
Oct 19 21:03:10 samba4 named[27126]: samba_dlz: configured writeable zone 'example.com'
Oct 19 21:03:10 samba4 named[27126]: samba_dlz: configured writeable zone '_msdcs.example.com'

samba4を起動

sambaサービスを起動する。

# /sbin/service samba start

確認のため、別サーバーからアクセスしてみる。

$ smbclient -L samba4
Enter yasuma's password: 
Anonymous login successful
Domain=[EXAMPLE] OS=[Unix] Server=[Samba 4.0.0rc3]

Sharename       Type      Comment
---------       ----      -------
netlogon        Disk      
sysvol          Disk      
IPC$            IPC       IPC Service (Samba 4.0.0rc3)
Anonymous login successful
Domain=[EXAMPLE] OS=[Unix] Server=[Samba 4.0.0rc3]

Server               Comment
---------            -------

Workgroup            Master
---------            -------

DNSの確認のため、SRVレコードを確認してみる。

# dig @127.0.0.1 _ldap._tcp.example.com SRV

/etc/resolv.confを次の設定に変更する。

domain example.com
nameserver 192.168.2.8 (DCのIPアドレス)

Kerberosの設定

provisioning時に作成された/etc/samba/krb5.confをOSの/etc/krb5.confにコピーする。

# cp /etc/samba/krb5.conf /etc/krb5.conf

Kerberosの設定が正しいか次のコマンドで確認する。
  • レルム(EXAMPLE.COM)の部分は、大文字
  • パスワードはsamba4のprovisioning時に設定したものを入力する。

# kinit administrator@EXAMPLE.COM
Password for administrator@EXAMPLE.COM: 
Warning: Your password will expire in 41 days on Fri Nov 30 20:52:00 2012

正常にチケットが取得できていれば、次のklistコマンドでチケットが表示される。
# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: administrator@EXAMPLE.COM

Valid starting     Expires            Service principal
10/19/12 21:17:22  10/20/12 07:17:22  krbtgt/EXAMPLE.COM@EXAMPLE.COM
renew until 10/20/12 21:17:18

DNSの動的更新の確認

DNSのTSIG/GSSを利用した動的更新が動作することを確認するため、次のコマンドを実行して、正常にDNSの更新が行われることを確認する。

# /usr/sbin/samba_dnsupdate --verbose --all-names 
IPs: ['fe80::a00:27ff:fe8d:c1f0%eth1', 'fe80::a00:27ff:fea2:fee8%eth0', '192.168.2.8', '10.0.2.15']
Calling nsupdate for A example.com 192.168.2.8
Outgoing update query:

以上で、Samba4が正常にドメインコントローラーとしてセットアップ完了しているはず。

Samba4に必要なパッケージ

Bind 9.8以降(DLZ対応)

http://wiki.samba.org/index.php/Samba4/HOWTO#Step_7:_Configure_DNS

SNTP対応xntpd

MS-SNTP対応が必要とのこと。
http://www.whitemiceconsulting.com/2010/12/configuration-of-ntp-for-samba4.html

パッケージを用意する方法はこちら。
http://wiki.samba.org/index.php/Samba4/HOWTO#Step_10:_Configure_NTP_.28Optional.29


2012年5月11日金曜日

RHEL6のsudoのLDAP対応

RHEL6になって、LDAPクライアントの設定がnslcd.confなどに変更になった影響を受けて
sudoのLDAP連携が動作しなくなっていた。

この問題がRHEL6.3に含まれる sudo-1.7.4p5-8 で解決されていることを確認した。

RHEL6.3からのsudoでは、/etc/sudo-ldap.confにLDAP連携の設定を記載することで、
LDAPからsudo用エントリを参照することが可能になった。

/etc/sudo-ldap.conf
uri ldap://ldap1.example.com
sudoers_base ou=SUDOers,dc=example,dc=com

2012年3月14日水曜日

LightWorksインストール

オープンソースで公開される予定と噂の動画編集ソフトのLightWorksを使ってみたいと思って、
インストールなどの手順を調査中。

現在はベータ版ということで、ユーザー登録をすればこちらからダウンロード可能。
http://www.lightworksbeta.com/

ただし、標準ではコーデックがほとんど入っていないので、インストール前に次の2つをあらかじめインストールしておく必要あり。

-Matrox VFW codecs
- QuickTime
http://www.apple.com/quicktime/download/

オープンソース化されるにあたり、商用コーデックが含まれなくなるので、コンバーターツールもインストールしておくことがお勧めの様子。
http://lightworks.wikidot.com/formats

とりあえず、こちらのサイトで紹介されているMediaCoder2011をインストールしてみた。
インストール時にレジストリスキャンソフトのインストールも促されるが、不要なので、インストールしませんを選択しておいた。