User Tools

Site Tools


Sidebar

Action disabled: recent
vps:vps4th_02

jailer設定

FreeBSD 11.0-RELEASE amd64 導入

FreeBSD-11.0-RELEASE amd64 をカスタムOSインストール機能を使うに従い、導入を行う。

インストール前設定

項目 設定値
Keymap SelectionContinue with default keymap
Set Hostnameホスト名
Distribution Select[ ]base-dbg
[ ]doc
[ ]kernel-dbg
[ ]lib32-dbg
[*]lib32
[ ]ports
[*]src
[ ]tests
Network Configurationvtnet0
em0Would you like to configure IPv4 for this interface?Yes
Would you like to use DHCP to configure this interface?No
Static Network Interface ConfigurationIP AddressさくらのVPSで割り当てられたIP
Subnet MaskさくらのVPSで割り当てられた subnet mask
Default RouterさくらのVPS指定のデフォルトゲートウェイ
Would you like to configure IPv6 for this interface?No
Resolver ConfigurationSearch-
IPv4 DNS #1DNSサーバを指定
IPv4 DNS #2DNSサーバを指定
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
[*]ntpd
[ ]powered
[ ]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/vps4th_02.txt · Last modified: 2019/06/16 15:16 (external edit)