ubuntu 備忘録

ubuntu 10.04 メモ

■ ネットワーク設定

(1) IPv4

/etc/network/interfaces

・DHCP

auto eth0
iface eth0 inet dhcp

・static

auto eth0
iface eth0 inet static
        address 192.168.0.101
        netmask 255.255.255.0
        gateway 192.168.0.1
       dns-nameservers 192.168.0.5 192.168.0.15
       dns-search local.aritia.org

・IP alias

auto eth0:1
iface eth0:1 inet static
         address 192.168.0.6
         netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255

(2) ホスト名

/etc/hostname
/etc/mailname (?)

■ vmware-toolsのインストール
apt-get -y install module-assistant
apt-get -y install open-vm-tools open-vm-toolbox open-vm-source

■ パッケージ操作の基本

apt-get update     最新のパッケージリストを取得する
apt-cache search キーワード     キーワードを含むパッケージを検索する
apt-get install パッケージ名     指定したパッケージをダウンロードし、インストールする
remove     パッケージをアンインストールする
dpkg -l システムにインストールされているパッケージをすべて表示する

■ bindの設定

フォルダ名: /etc/bind

■ sshの設定

$ ssh-keygen
$ touch ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys

■ apacheの設定

# a2ensite ファイル名
# a2enmodファイル名
例:

# a2enmod ssl
# a2enmod proxy
# a2enmod proxy_http

■ 後でインストールしたパッケージ

# apt-get install vsftpd
# apt-get install dkim-filter dk-filter spfmilter
# apt-get -y install webalizer
# apt-get -y install spamassassin spamc
# apt-get -y install sqlgrey
# apt-get remove dovecot-common dovecot-imapd dovecot-pop3d  # dovecotは,多言語対応していない
# apt-get -y install courier-imap-ssl courier-pop-ssl
# apt-get install sasl2-bin
# apt-get logwatch
# apt-get ntp

■ spfmilterをPostfixで使う場合の設定

ファイル: /etc/default/spfmilter

NO_MACROS_CHECK=1
SOCKET="inet:10034@localhost" # listen just on loopback on port 10034

■ ufwの設定

# ufw enable  – FireWallの有効化
# ufw default deny – デフォルト拒絶設定
# ufw status verbose – 詳細なufw設定一覧
# ufw status numbered – ルール番号表示
# ufw delete {ルール番号} – ルールの削除
# ufw app list – プロファイル一覧
# ufw allow 80/tcp – ポート番号で設定
# ufw allow “Apache Full” – プロファイルでの設定
# ufw allow from 192.168.99.0/23

# ufw status

OpenSSH                    ALLOW       Anywhere
Apache Full                ALLOW       Anywhere
Bind9                      ALLOW       Anywhere
Postfix                    ALLOW       Anywhere
Postfix Submission         ALLOW       Anywhere
Samba                      ALLOW       Anywhere
110                        ALLOW       Anywhere   # pop3
143                        ALLOW       Anywhere   # imap
993                        ALLOW       Anywhere   # imaps
995                        ALLOW       Anywhere   # pop3s
21/tcp                     ALLOW       Anywhere   # ftp
20/tcp                     ALLOW       Anywhere   # ftp-data
514/ucp                    ALLOW       Anywhere   # syslog ルータからのSYSLOG転送用

■ Postfix と sasl2の設定

# saslpasswd2 -c -u `postconf -h myorigin` {username}
# vi /etc/group
sasl:x:45:sasl,postfix
# ln /etc/sasldb2 /var/spool/postfix/etc
# vi /etc/postfix/sasl/smtpd.conf
pwcheck_method: auxprop

# /etc/init.d/saslauthd restart
# /etc/init.d/postfix restart

コメントを残す