標準端末
標準端末とは,旧情報実験機に使用する標準的な設定の端末のことです. 標準端末の設定をきちんとしておけば,多くの端末の設定は標準端末の ファイルをコピーするだけで済みます.
ソフトウェアのインストール
ldap クライアント
- ldap-utils を入れる
# apt-get install ldap-utils
- libpam-ldap を入れる
# apt-get install libpam-ldap
- LDAP server URI:
- ldap://ldap.hokudai.in-cps
- Distinguished name of the search base:
- dc=jupiter,dc=hokudai,dc=in-cps
- LDAP version to use:
- 3 Allow LDAP admin account to behave like local root?
- No
- Does the LDAP database require login?
- No
- 設定をやり直したい場合:
# dpkg-reconfigure libpam-ldap
- libnss-ldap を入れる
# apt-get install libnss-ldap
- LDAP account for root:
- cn=admin,dc=jupiter,dc=hokudai,dc=in-cps
- LDAP root account password:
- *********** (LDAP の rootdn のパスワードを入れる)
- nsswitch.conf を直さないと有効になりません (教えてくれるだけ)
- OK
- 設定をやり直したい場合:
# dpkg-reconfigure libnss-ldap
- /etc/pam_ldap.conf を修正
bind_policy: soft
- /etc/libnss-ldap.conf を修正
bind_policy: soft
- /etc/ldap/ldap/conf を修正
BASE dc=jupiter,dc=hokudai,dc=in-cps URI ldap://ldap.hokudai.in-cps
- 確認
- ldapsearch してみる
ldapsearch -xLLL -H ldap://ldap.hokudai.in-cps -D'cn=admin,dc=jupiter,dc=hokudai,dc=in-cps' -W Enter LDAP Password: ********** dn: dc=jupiter,dc=hokudai,dc=in-cps objectClass: top objectClass: dcObject objectClass: organization .....
ずらっと何か出ればOK
- ldapsearch してみる
- よくあるエラー
- No such object (32)
- ldap.conf の設定が悪いから直せという意味 (typo のことが多い)
- ldap_bind: Invalid credentials (49)
- パスワードが違いますという意味
- 認証切り替え
- ローカルユーザーを vipw, vipw -s, vigr, vigr -s で削除
- /etc/nsswitch.conf 修正
passwd: compat ldap group: compat ldap shadow: compat ldap
- /etc/init.d/nscd restart
- ls -l /home してみる
- uid, gid が数字なら設定が間違ってるのでやりなおし。 LDAPの uid, gid と ローカルの uid,gid が 一致していない場合には数字でOK
- chown -R でホームディレクトリの所有者を更新する
-
chown: invalid user: `...'
が出るようなら設定が間違ってるのでやりなおし
-
autofs-ldap
- 準備
- ディレクトリ作成
# cd / # mv home home.dist # mkdir nfsad # ln -s /nfsad /home
- ディレクトリ作成
- インストール
apt-get install autofs5-ldap
- 設定
- /etc/default/autofs
MASTER_MAP_NAME="ou=auto.master,ou=automount,ou=admin,dc=jupiter,dc=hokudai,dc=in-cps" LDAP_URI="ldap://ldap.hokudai.in-cps" SEARCH_BASE="ou=automount,ou=admin,dc=jupiter,dc=hokudai,dc=in-cps"
- 最後の方の "# Other common LDAP nameing" の部分の
コメントを外す
MAP_OBJECT_CLASS="automountMap" ENTRY_OBJECT_CLASS="automount" MAP_ATTRIBUTE="ou" ENTRY_ATTRIBUTE="cn" VALUE_ATTRIBUTE="automountInformation"
- /etc/default/autofs
- /etc/nsswitch.conf 編集
automount: files ldap
- タブ文字を使うとだめ?
/etc/init.d/autofs restart
- /var/log/syslog を見る
- よくあるエラー
- automount[2423]: syntax error in nsswitch config near [ syntax error ]
- nsswitch.conf が間違ってるので直せという意味
- svc: failed to register lockdv1 RPC service (errno 97).
- なぜか出る。放っておいても害はないようなので放置
- lookup_init: lookup(ldap): failed to find available server
- autofs ファイルが間違ってるという意味
exim4の設定
- インストール
apt-get install exim4
- 設定
dpkg-reconfigure exim4-config
- General type of mail configuration:
- mail sent by smarthost; received via SMTP or fetchmail
- System mail name:
- qjohoXX.hokudai.in-cps (ホスト名を入れる)
- IP-addresses to listen on for incoming SMTP connections:
- 127.0.0.1 ; ::1 (変更無し)
- Other destinations for which mail is accepted:
- [空にする]
- Machines to relay mail for:
- [空にする]
- IP address or host name of the outgoing smarthost:
- jupiter.hokudai.in-cps
- Hide local mail name in outgoing mail?
- No
- Keep number of DNS-queries minimal (Dial-on-Demand)?
- No
- Delivery method for local mail:
- mbox format in /var/mail/
- Split configuration into small files?
- No
- 確認
- テストメールを出す
$ mail root@hokudai.in-cps Subject: test test . CC:
- mailq で何か出たら設定が悪いのでやり直し
- exim4 -Mg [qid] でキューを取り消す
- テストメールを出す
- jupiter の /var/mail/mail を cat して 出したメールが配信されていれば OK
cron の設定
- 一日一回システム統計情報を出すように設定
- mkdir /etc/cron.local する
- cron.local に移動して
bzcat ~[local_user_name]/cronlocal.tar.bz2 | tar xvf -
を実行してファイルを展開する - /etc/crontab に登録
13 4 * * * root cd / && run-parts --report /etc/cron.local/daily | mail -s "`hostname -f` daily run outputs" root@hokudai.in-cps 43 4 * * 7 root cd / && run-parts --report /etc/cron.local/weekly | mail -s "`hostname -f` weekly run outputs" root@hokudai.in-cps
- daily は 4 時 (実験機番号) 分に設定する
- weekly は 4 時 (実験機番号+30) 分に設定する
- 確認
- 翌日になってメールがくれば OK ...
X(vnc)
- デスクトップパソコンではないので,普通の X は必要ないのですが,
vnc のサーバーとしての X を入れます
apt-get install tightvncserver xtightvncviewer
- フォントの類
apt-cache search font
で調べて適当に入れる.特に日本語のフォントはできるだけ入れる
グラフィック
- ImageMagick, netpbm, gmt, gnuplot, tgif, gimp, inkscape 等 使いそうなものを入れる
動画
- mplayer, mencoder,ffmeg 等を入れる.
emacs環境
- emacs, xemacs の両方入れる
- xemacs で scim 入力をすると文字が化けるので注意
TeX環境
- ptex 等を適当に.
日本語環境
- nkf, kterm, scim, anthy, ...
ブラウザ
- iceweasel, java, icedove, ...
その他
- build-essential を入れておくと便利です.
- sudo 入れてもいいけど,sudoers を管理するのが
面倒なのでいらない
- su と ssh でいいじゃん
- gnome は重すぎるので入れない.
- 代わりに twm, fvwm, afterstep, fluxbox, ...
確認
適当に入れたソフトを動かしてみる
login する
- ssh で入ってみる.だめなら ビデオカードをつけてコンソールから入る
vnc を使ってみる
- vncserver を実行して,他のコンピューターから適当な vncviewer で ipアドレス:5901 につないでみる
serial 化
シリアルコンソールの設定をする
tftp サーバーの設定
- /tftpboot/debian32/pxelinux.cfg/0A001000 を編集する
serial 0 9600 default debian prompt 1 noescape 0 allowoptions 0 timeout 60 label debian kernel vmlinuz append concole=ttyS0,9600n8 root=/dev/nfs netboot=nfs initrd=initrd.img nfsroot=10.0.1.1:/system/debian32 ip=eth0 rw
nfs サーバーの設定
- /system/debian32/etc/inittab に追加
s0:2345:respawn:/sbin/agetty -L -f /etc/issue 9600 ttyS0 vt100
確認
- ターゲットマシンの COM1 と,動いている適当な機械の 空いているシリアルポートをつなぐ.
- linux なら cu -l /dev/ttyS0, windows なら teraterm 等のソフト
でシリアルポートに通信をしながらターゲットマシンの電源をつける.
- 9600bps, 8ビット, パリティなし, ストップビット有り に設定
- 適切なブートシーケンスが表示されればOK.
- 文字が化けるようなら接続速度が悪いのでつなぎ直す