opensslの使い方
サーバ証明書を作る
自己CA構築
CA.shを探して利用する
# /usr/local/misc/CA.sh -newca
./demoCA/cacert.pem: CAの自己署名証明書
./demoCA/careq.pem: CAの署名要求
./demoCA/private/cakey.pem: CAの秘密鍵
一応rootだけCAの秘密鍵を読めるようにする
# chmod 400 ./demoCA/private/cakey.pem
Subversion@Ubuntu10.10
今までsubversionの使い方をよく知らず
ようやく便利さが分かったのでメモ
インスト
$ sudo apt-get install subversion libapach2-lib
設定
$ sudo vi /etc/apache2/mods-enabled/dav_svn.conf
<Location /svn> # Digest認証 AuthName "hoge" AuthType Digest AuthUserFile "<.htdigestのパス>" Require user <ユーザ名> # SSL必須 SSLRequireSSL # SVN DAV svn SVNParentPath /home/svn </Location>
$ sudo apache2ctl restart
SVNクライアント側での基本的な使い方
追加と削除と移動(名前変更)
$ svn move hoge.txt hogedir
$ svn add hoge.txt(リポジトリにファイルを追加
$ svn del hoge.txt(リポジトリのファイルを削除
※commit時に反映
その他
$ svn status(変更状況の確認
$ svn diff(変更箇所の確認
$ svn log(変更履歴の確認
$ svn update(リポジトリの変更をクライアント側に反映
$ svn info(リポジトリの情報を確認
$ svn switch --relocate <旧リポジトリパス> <新リポジトリパス>(リポジトリの変更
奥が深すぎるけど個人使用だとこれだけで十分
ついでにソース内の日本語が文字化けしてたので修正
$ sudo vi /etc/apache2/conf.d/charset
AddDefaultCharset UTF-8
$ sudo apache2ctl restart
基本的なこと@CentOS5.5
インストール
ネットインスト
ftp://ftp.riken.jp/Linux/centos/5.5/os/i386/images/boot.isoでブートCD取得
インスト時にftp.riken.jpと/Linux/centos/5.5/os/i386を指定
基本設定
ユーザの追加
# useradd
# usermod -G wheel
iptables
# vi /etc/iptables.sh
#!/bin/sh ### init iptables -F iptables -X iptables -Z ### policy iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT ACCEPT ### INPUT # established iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # lo iptables -A INPUT -i lo -j ACCEPT # icmp iptables -A INPUT -p icmp -j ACCEPT # SSH iptables -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT # HTTP iptables -A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT ### save /etc/rc.d/init.d/iptables save ### restart /sbin/service iptables restart
# /etc/iptables.sh(chmod +xが必要かも
ホスト名
# vi /etc/sysconfig/network
HOSTNAME=<hostname>
ネットワーク設定
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.0.100 NETMASK=255.255.255.0 GATEWAY=192.168.0.1 NETWORK=192.168.0.0 BROADCAST=192.168.0.255
# /etc/init.d/network restart
RADIUSとLDAPの連携@Ubuntu10.10
FreeRADIUS2からはvirtual serverになってたのか
TLSはなし
RADIUS側の設定
$ sudo vi /etc/freeradius/sites-available/default
authorize { ... ldap ... } authenticate { ... Auth-Type LDAP { ldap } ... }
$ sudo vi /etc/freeradius/sites-available/inner-tunnel
authorize { ... ldap ... } authenticate { ... Auth-Type LDAP { ldap } ... }
$ vi /etc/freeradius/modules/ldap
ldap { server = "<LDAPサーバIP>" identity = "cn=admin,dc=example,dc=com" password = secret basedn = "dc=example,dc=com" filter = "(uid=%{%{Stripped-User-Name}:-%{User-Name}})" ... }
$ vi /etc/freeradius/users
DEFAULT Auth-Type := LDAP Fall-Through = 1
再起動
$ sudo /etc/init.d/freeradius restart
* Stopping FreeRADIUS daemon freeradius ...done. * Starting FreeRADIUS daemon freeradius ...fail!
あれ?
$ suto tail /var/log/freeradius/radius.log
Error: /etc/freeradius/modules/ldap[29]: Failed to link to module 'rlm_ldap': file not found
モジュールないのか…
$ sudo apt-get install freeradius-ldap
もう一度再起動してradtestで確認して成功