FreeBSD-8.1-RELEASE-i386 インストール †
- いろんな用途に使うサーバーのベースになるように、
段階別に dump ファイルを作って その段階までのインストール作業を省く作戦。
インストール †
環境 †
ハードディスク | ad4 ad6 | IPアドレス | 192.168.0.160 |
---|
ネットワークデバイス | re0 re1 | ゲートウェイ | 192.168.0.140 |
---|
ホスト名 | kenji.zenno.net | DNSサーバー | 192.168.0.140 |
---|
インストール前の設定 †
Fdisk | ad4 全体 | |
---|
Boot Manager | Standard | |
---|
Label | ad4s1a / 2G | サーバーの用途を決めてからカスタマイズします |
---|
Distributions | base kernels | 最小インストール |
---|
インストール直後の設定 †
Ethernet | re0 | 192.168.0.160 | 他の項目は上記通り |
---|
SSH | Yes | | |
---|
console | Keymap | Japanese 106 | |
---|
time zone | UTC | Asia Japan JST | 専用機なのでUTC |
---|
User | USER | UID:1000 Group:0 shell:/bin/csh | |
---|
基本設定 †
ssh †
cd $HOME
mkdir .ssh
cd .ssh
cp /back/src/authorized_keys ./
cp /back/src/id_dsa ./
cd ../
chown -R $LOGNAME .ssh
chmod 700 .ssh
chmod 600 .ssh/*
hosts †
cp /etc/hosts /etc/hosts.orig
cat /back/src/hosts.txt >> /etc/hosts
resolv.conf †
cp /etc/resolv.conf /etc/resolv.conf.orig
cp /back/src/resolv.conf /etc/resolv.conf
hosts.allow †
mv /etc/hosts.allow /etc/hosts.allow.orig
echo 'ALL : 127.0.0.1 : allow' >> /etc/hosts.allow
echo 'ALL : 192.168. : allow' >> /etc/hosts.allow
echo 'ALL : 125.53.25.128/255.255.255.192 : allow' >> /etc/hosts.allow
echo 'ALL : ALL : deny' >> /etc/hosts.allow
inetd †
cp /etc/rc.conf /etc/rc.conf.orig
echo 'inetd_enable="YES"' >> /etc/rc.conf
patch -p0 < /back/src/inetd.patch
# patch -p0 < /back/src/rsh.patch
# cp /back/src/rhosts.txt /root/.rhosts
loader †
echo 'autoboot_delay="2"' >> /boot/loader.conf
ntp †
echo 'ntpd_enable="YES"' >> /etc/rc.conf
echo 'ntpd_sync_on_start="YES"' >> /etc/rc.conf
echo 'server ntp.jst.mfeed.ad.jp' > /etc/ntp.conf
ifconfig †
patch -p0 < /back/src/ifconfig.patch
/etc/netstart
- ==> ifconfig.patch <==
--- /etc/rc.conf.orig 2010-09-03 10:32:09.000000000 +0900
+++ /etc/rc.conf 2010-09-03 10:35:11.000000000 +0900
@@ -4,9 +4,12 @@
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
-defaultrouter="192.168.0.140"
+defaultrouter="125.53.25.130"
hostname="kenji.zenno.net"
ifconfig_re0="inet 192.168.0.160 netmask 255.255.255.0"
+ifconfig_re1="inet 125.53.25.160 netmask 255.255.255.192"
+static_routes="vpn"
+ route_vpn="-net 192.168.2.0/24 192.168.0.140"
keymap="jp.106"
sshd_enable="YES"
inetd_enable="YES"
dump [1] †
FreeBSD