Gentoo

Last-modified: 2008-05-27 (火) 12:09:58

すべてroot権限で作業をしています。
[User追加]
$ useradd -d /home/user1 user1
$ passwd user1
$ nano /etc/group

wheel:x:10:root -> wheel:x:10:root,user1
 

[Telnet]
$ emerge netkit-telnetd
$ emerge xinetd
$ nano /etc/xinetd.d/telnetd

disable     = yes -> disable     = no

$ nano /etc/xinetd.conf

only_from      = localhost -> # only_from      = localhost

$ /etc/init.d/xinetd start
$ netstat -Ainet -a

tcp 0 0 *:telnet *:*

$ telnet localhost

ログインできることを確認しました。

外部マシンからのtelnet

ログインできることを確認しました。

$ rc-update add xinetd default

 

[FTP]
$ emerge vsftpd
$ cd /etc/vsftpd
$ cp vsftpd.conf.example vsftpd.conf
$ nano vsftpd.conf

anonymous_enable=NO -> anonymous_enable=YES
#local_enable=YES -> local_enable=YES
#write_enable=YES -> write_enable=YES
#ascii_upload_enable=YES -> ascii_upload_enable=YES
#ascii_download_enable=YES -> ascii_download_enable=YES
#ls_recurse_enable=YES -> ls_recurse_enable=YES
userlist_enable=YES
userlist_file=/etc/vsftpd/userlist
use_localtime=YES
pasv_promiscuous=YES

$ touch userlist
$ /etc/init.d/vsftpd start
$ netstat -Ainet -a

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 *:ftp                   *:*                     LISTEN

$ rc-update add vsftpd default

 

[Network 固定IPアドレス 一時的に変更する]
$ ifconfig eth0 172.22.3.59 broadcast 172.22.3.255 netmask 255.255.255.0 up

[Network 固定IPアドレス]
$ nano /etc/conf.d/net

iface_eth0="172.22.3.59 broadcast 172.22.3.255 netmask 255.255.255.0"
gateway="eth0/172.22.3.1"

$ /etc/init.d/net.eth0 restart
or
$ /etc/init.d/net.eth0 start
$ nano /etc/resolv.conf

nameserver 172.22.3.1

[tcpdump]
libpcap-0.9.8 ./congifure -> ./make -> ./make install
tcpdump-3.9.8 ./congifure -> ./make -> ./make install

[snmp]
$ emerge -u net-snmp
$ cp -p /etc/snmp/snmpd.conf.example /etc/snmp/snmpd.conf
$ /etc/init.d/snmpd start

/etc/snmp/snmpd.conf: line 61: Error: example config COMMUNITY not properly configured
/etc/snmp/snmpd.conf: line 62: Error: example config NETWORK not properly configured

$ nano /etc/conf.d snmpd

#       sec.name  source          community
com2sec local     localhost       COMMUNITY
com2sec mynetwork NETWORK/24      COMMUNITY

#       sec.name  source          community
com2sec local     localhost       public
com2sec mynetwork NETWORK/24      public

$ /etc/init.d/snmpd restart
$ snmpwalk -v1 -c public localhost | head
$ rc-update add snmpd default

[stage]
stage1: ブートスラップ(コンパイラとCライブラリすべて)から構築。時間がかかる。
stage2: コンパイラとCライブラリ以外の基礎システムから構築。
stage3: 基本的なシステムはすでに構築されている。

[リンク]
http://www.gentoo.gr.jp/jpmain/tips.xml