0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FreeBSD 9.2-RELEASE を入れたときにした初期設定

Last updated at Posted at 2014-11-18

概要

FreeBSD 9.2-RELEASE を VirtualBox に入れてみたので、自分が初期設定をどうしたのか、残しておこうと思います。

Install

bsdinstall を使ってインストールしました。
参考: 公式のハンドブック

気をつけたことは、インストールするコンポーネントでは何も選択しなかったことです。
なるべく minimal 構成にするためと、Ports Collection はあとで最新版を取ってきたかったからです。

Ports Collection を取得して、展開

# portsnap fetch extract

すでに extract しているなら、update で更新。

# portsnap fetch update

Ports からいろいろインストール

portinstall を使うと依存関係を解決してインストールできるらしいです。
portupgrade を入れるときに portinstall が入るらしいので、portupgrade を入れます。

# cd /usr/ports/ports-mgmt/portupgrade
# make install clean

無事インストールが終わっても、コマンドが見えないので、rehash します。

# rehash

あとは、適宜必要なものをインストールします。
メモとして残しておくと、初期にインストールしたのは以下のものです。

# portinstall shells/bash editors/vim security/sudo ftp/wget ports-mgmt/portaudit ports-mgmt/portmaster

rehash を忘れると、コマンドが見えなくて、焦ります。(焦りました)

sudoers の編集

root で作業するわけにも行かないので、sudo を使えるようにします。
user: misaki は wheel グループに入れてあるので、sudores を編集して、wheel グループのユーザに sudo を許可します。

# visudo
+ %wheel ALL=(ALL) ALL

あとは、reboot して、今度は一般ユーザでログインします。

shell を bash に変更

zsh でも bash でもいいのですが、先ほどインストールした bash に変更します。

$ chsh -s /usr/local/bin/bash
# reboot

時刻合わせ

参考: 推奨公開サーバ
上記のサイトを参考に、ntp サーバの設定をします。

# vi /etc/ntp.conf
+ server ntp.nict.jp iburst maxpoll 9
+ server ntp.jst.mfeed.ad.jp iburst maxpoll 9

/etc/ntp.conf は root 権限でなければファイル保存できませんが、sudo vi とか、sudo vim みたいなことをしなくても、vim で sudo を使ってファイル保存ができます。

:w !sudo tee %

参考: sudo.vimを使わないでvimでsudoを使ってのファイル保存

あとは、起動時に時刻合わせをするよう、/etc/rc.conf を設定します。

# vi /etc/rc.conf  
+ ntpdate_enable="YES"  
+ ntpd_enable="YES"

root へのメール設定

root のメールアドレスを設定します。
root への log メールなどを受け取るためです。

# vi /etc/aliases  
+ root: ${mail address}  

# newaliases

今回した初期設定はこのくらいです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?