Linode で Gentoo 2008.0 を使ってみる 02

iptables と sudo をインストールする

iptablesGentoo インストール時に、インストールされていない?

# which iptables
which: no iptables in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i486-pc-linux-gnu/gcc-bin/4.1.2:/usr/i686-pc-linux-gnu/gcc-bin/4.1.2)

iptables を探す

# emerge -s iptables
Searching...
[ Results for search key : iptables ]
[ Applications found : 2 ]

*  net-firewall/arno-iptables-firewall [ Masked ]
      Latest version available: 1.9.2a
      Latest version installed: [ Not Installed ]
      Size of files: 93 kB
      Homepage:      http://rocky.molphys.leidenuniv.nl/
      Description:   Arno's iptables firewall script
      License:       GPL-2

*  net-firewall/iptables
      Latest version available: 1.4.3.2
      Latest version installed: [ Not Installed ]
      Size of files: 422 kB
      Homepage:      http://www.iptables.org/
      Description:   Linux kernel (2.4+) firewall, NAT and packet mangling tools
      License:       GPL-2

やっぱりインストールされていない。

 *  net-firewall/iptables
      Latest version available: 1.4.3.2
      Latest version installed: [ Not Installed ]

iptables をインストールする

# emerge iptables
# which iptables
/sbin/iptables

インストールしただけでは、iptables はシステム起動時に実行されない。
登録されているデーモンを確認する。

# rc-update show
            bootmisc | boot
             checkfs | boot
           checkroot | boot
               clock | boot
         consolefont | boot
            hostname | boot
             keymaps | boot
               local |      default nonetwork
          localmount | boot
             modules | boot
              net.lo | boot
            netmount |      default
           rmnologin | boot
                sshd |      default
           syslog-ng |      default
             urandom | boot
          vixie-cron |      default

システム起動時に実行されるようにする。

# rc-update add iptables boot
 * iptables added to runlevel boot
# rc-update show
            bootmisc | boot
             checkfs | boot
           checkroot | boot
               clock | boot
         consolefont | boot
            hostname | boot
            iptables | boot
             keymaps | boot
               local |      default nonetwork
          localmount | boot
             modules | boot
              net.lo | boot
            netmount |      default
           rmnologin | boot
                sshd |      default
           syslog-ng |      default
             urandom | boot
          vixie-cron |      default

これで、iptables はシステム起動時に実行される。

sudo をインストールする

念のため、探してみる。

# which sudo
which: no sudo in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i486-pc-linux-gnu/gcc-bin/4.1.2:/usr/i686-pc-linux-gnu/gcc-bin/4.1.2)

sudo をインストールする。

# emerge -s sudo
Searching...
[ Results for search key : sudo ]
[ Applications found : 6 ]

*  app-admin/sudo
      Latest version available: 1.7.1-r1
      Latest version installed: [ Not Installed ]
      Size of files: 738 kB
      Homepage:      http://www.sudo.ws/
      Description:   Allows users or groups to run commands as other users
      License:       as-is BSD

# emerge -s sudo
# which sudo
/usr/bin/sudo
# which visudo
/usr/sbin/visudo

これで完了。