User Tools

Site Tools


Sidebar

vps:vps4th2nd_02

This is an old revision of the document!


jailer設定

FreeBSD 11.0-RELEASE amd64 導入

FreeBSD-12.0-RELEASE amd64 をカスタムOSインストールガイド - FreeBSD 11 / FreeBSD 12に従い、導入を行う。

インストール前設定

カスタムインストールで用意されている OS を選択するとネットワーク設定は自動で行われる。

項目 設定値
Keymap SelectionContinue with default keymap
Set Hostnameホスト名
Distribution Select[ ]base-dbg
[ ]kernel-dbg
[ ]lib32-dbg
[*]lib32
[ ]ports
[*]src
[ ]tests
Mirror Selection近場を指定。
PartitioningAuto (UFS)
PartitionEntire Disk
Partition SchemeBSD
Partition Editor提示された内容で Finish → Commit

インストール後設定

項目 設定値
New Passwordrootパスワードを設定
Time Zone SelectorAsia
Countries in AsiaJapan
Time & Date日付を確認後 <Set Date>
時刻を確認後 <Set Time>
System Configuration[*]local_unbound
[ ]sshd
[ ]moused
[ ]ntpdata
[*]ntpd
[ ]powerd
[ ]dumpdev
System Hardening[ ]Hide processes running as other users
[ ]Hide processes running as other groups
[ ]Disable reading kernel message buffer for unprivileged users
[ ]Disable process debugging facilities for unprivileged users
[ ]Randomize the PID of newly created processes
[ ]Insert stack guard page ahead of the growable segments
[*]Clean the /tmp filesystem on system startup
[*]Disable opening Syslogd network socket (disables remote logging)
[ ]Disable Sendmail service
Add User AccountsNo

unbound.conf 設定

参照先DNSサーバが DNSSEC をサポートしていない場合1)、 /var/unbound/unbound.conf 内の auto-trust-anchor-file 行をコメントアウトする。

# auto-trust-anchor-file: /var/unbound/root.key

編集後、service を再起動し、drillで確認する。

# service local_unbound restart
Stopping local_unbound.
Waiting for PIDS: 1119.
Starting local_unbound.
Waiting for nameserver to start... good
#
# drill www.hoge.org
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 13790
;; flags: gr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;; www.hoge.org.        IN      A

;; ANSWER SECTION:
www.hoge.org.           1643    IN      A       xxx.xxx.xxx.xxx
<以下略>

最新化

freebsd-updateを行う。

# freebsd-update fetch
# freebsd-update install

kernel編集

kernelを編集し、VIMAGE対応とする。
/usr/src/sys/amd64/conf/GENERICをVPSとしてコピーして編集する。

#ident              GENERIC
ident               VPS

options             VIMAGE

#device             fdc
  • fdc
    目についたので無効化

world構築

ハンドブックに従い、worldとkernelの構築を行う。

ntp設定

  • /etc/rc.confでntpdが有効になっていることを確認する。
    ntpd_enable="YES"
  • さくらのVPS > OSセットアップ情報を参考に/etc/ntp.confを編集する。
    restrict default limited kod nomodify notrap nopeer noquery
    server ntp1.sakura.ad.jp
  • 同期確認を行う。
    #ntpq -c as
    ind assID status  conf reach auth condition  last_event cnt
    ===========================================================
      1 53548  9614   yes   yes  none  sys.peer   reachable  1
    • 結果が ntpq: read: Connection refused となった場合は一度 ntpdate <server> で時刻合わせを行う。

ipfw設定

/etc/rc.confに追記。

firewall_enable="YES"
firewall_nat_enable="YES"
firewall_type="open"
1)
さくらは対応済み
vps/vps4th2nd_02.1560667402.txt.gz · Last modified: 2019/06/16 15:43 by hoge@hoge