Pages

Aug 13, 2004

Solaris2.6インストール備忘録(OpenSSH,OpenSSL最新版setup)

solaris_logo.gif
今更ながらSolaris2.6でサーバを立てなきゃいけないときのToDo。
特にsshdのインストールが激しく面倒なのでその辺のフォローをしてるつもり。


□CDROMからのインストール
□recommend patch clusterのインストール
recommend patch をsunsiteからFTPでダウンロード
□その他パッケージのインストール
以下のパッケージをwww.sunfreeware.comから取得
binutils-2.11.2-sol26-sparc-local
perl_s-5.8.0-sol26-sparc-local
egd-0.8-sol26-sparc-local
prngd-0.9.25-sol26-sparc-local
gcc-2.95.3-sol26-sparc-local
screen-3.9.9-sol26-sparc-local
grep-2.5-sol26-sparc-local
shutils-2.0.15-sol26-sparc-local
less-381-sol26-sparc-local
tcsh-6.07.02-sol26-sparc-local
libgcc-3.3-sol26-sparc-local
top-3.5beta12.5-sol26-sparc-local
openssh-3.7.1p2-sol26-sparc-local
wget-1.8.2-sol26-sparc-local
openssl-0.9.6i-sol26-sparc-local
zlib-1.1.4-sol26-sparc-local
#gzip -d
#pkgadd -d

□sol2.6はデフォルトで/dev/randamがないのでSSHDが起動しない問題の対策
以下のパッケージをhttp://www.cosy.sbg.ac.at/‾andi/SUNrand/から
取得してインストール
ANDIrand-0.7-5.6-sparc-1.pkg
別解として以下の方法でもかまわない
=====================
Note: Several users have pointed out that they may get a "PRNG not seeded" message when trying to start sshd. This seems to be a new issue with openssl 0.9.7 versions. They point out that the OpenSSL FAQ says:
Starting with version 0.9.7, OpenSSL will automatically
look for an EGD socket at /var/run/egd-pool, /dev/egd-pool,
/etc/egd-pool and /etc/entropy.
and if they did a link like
ln -s /var/spool/prngd/pool /dev/egd-pool
=====================
□ホストキーの作成。
# ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N ""
# ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N ""
# ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N ""
□/etc/init.d/sshdを作成
以下内容
=====================
#!/bin/sh
pid=`/usr/bin/ps -e | /usr/bin/grep sshd | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
case $1 in
'start')
/usr/local/sbin/sshd
;;
'stop')
if [ "${pid}" != "" ]
then
/usr/bin/kill ${pid}
fi
;;
*)
echo "usage: /etc/init.d/sshd {start|stop}"
;;
esac
=====================
#以上内容
□rc2.dにシンボリックリンク作成
ln -s /etc/init.d/sshd /etc/rc2.d/S98sshd
□SSHDユーザーと/var/emptyの作成
mkdir /var/empty
chown root:sys /var/empty
chmod 755 /var/empty
groupadd sshd
useradd -g sshd -c 'sshd privsep' -d /var/empty -s /bin/false sshd
以上の作業でリモートからのSSH接続が可能になる。
□不要なサービスをストップ
例)mv /etc/rc2.d/S71rpc /etc/rc2.d/s71rpc
/etc/rc2.d/s71rpc /etc/rc2.d/s85power
/etc/rc2.d/s73nfs.client /etc/rc2.d/s88sendmail
/etc/rc2.d/s74autofs /etc/rc2.d/s92volmgt
/etc/rc2.d/s76nscd /etc/rc2.d/s99dtlogin
/etc/rc2.d/s80lp
/etc/rc3.d/s15nfs.server /etc/rc3.d/s77dmi
/etc/rc3.d/s76snmpdx
□その他細かいとこ書き換え
/etc/default/loginを書き換え
/usr/local/binにパスを通す
/export/homeの作成
/bin/shの確認
/etc/resolv.conf
/etc/defaultrouter
/etc/nodename
dtloginを無効にする
/usr/dt/bin/dtconfig コマンドを使用して設定できます。
/usr/dt/bin/dtconfig -d (オートスタートを無効にする)
/usr/dt/bin/dtconfig -e (オートスタートを有効にする)
/usr/dt/bin/dtconfig -kill (dtlogin を終了させる)
/usr/dt/bin/dtconfig -reset (dtlogin をリスタートさせる)
/usr/dt/bin/dtconfig -p (printer action update)
/usr/dt/bin/dtconfig -inetd (inetd.conf /usr/dt daemons)
/usr/dt/bin/dtconfig -inetd.ow (inetd.conf /usr/openwin daemons)