debian jessieインストール後の設定
スポンサーリンク
リポジトリの設定
リポジトリのリストからcdromを削除する
sudo
が使えないのでsu
してから作業を行う
$ su (root)$ sed -i -e 's/^deb cdrom/# deb cdrom/' /etc/apt/sources.list
一応アップデートしておく
(root)$ aptitude update (root)$ aptitude -y upgrade
sudoの有効化
sudo
のコマンドのインストール
$ su (root)$ aptitude -y install sudo
ユーザhogeをsudo
グループに追加し,sudo
できるようにする
(root)$ gpasswd -a hoge sudo
ログインし直すとsudo
できるようになる.
IPの固定
static
に変更し,IPアドレス等を追加
$ sudo vim /etc/network/interfaces #iface eth0 inet dhcp iface eth0 inet static address 192.168.1.5 network 192.168.1.0 netmask 255.255.255.0 broadcast 192.168.1.255 gateway 192.168.1.1 dns-nameservers 192.168.1.1 $ sudo ifdown eth0 && sudo ifup eth0
chrony
ntp
よりchrony
の方が高速に時間を同期できるらしい
インストール
$ sudo aptitude -y install chrony
設定ファイルの編集
$ sudo vim /etc/chrony/chrony.conf #server 0.debian.pool.ntp.org offline minpoll 8 #server 1.debian.pool.ntp.org offline minpoll 8 #server 2.debian.pool.ntp.org offline minpoll 8 #server 3.debian.pool.ntp.org offline minpoll 8 server ntp1.jst.mfeed.ad.jp iburst server ntp2.jst.mfeed.ad.jp iburst server ntp3.jst.mfeed.ad.jp iburst
サービス起動
$ sudo systemctl restart chrony $ sudo systemctl enable chrony
動作状況の確認(*
がついているサーバと同期している)
$ chronyc sources 210 Number of sources = 3 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* ntp1.jst.mfeed.ad.jp 2 6 17 2 -847us[ -529us] +/- 81ms ^- ntp2.jst.mfeed.ad.jp 2 6 17 2 -967us[ -967us] +/- 90ms ^+ ntp3.jst.mfeed.ad.jp 2 6 17 2 +1293us[+1611us] +/- 123ms
ファイアウォールのインストール
$ sudo aptitude -y install firewalld $ sudo systemctl restart firewalld $ sudo systemctl enable firewalld