/l3/users/bas/2011-03/linux4.unix.bas/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 |
|
#netstat -lnp -A inet | grep 22
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 2656/hpiod tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2987/dnsmasq tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN 2661/python udp 0 0 192.168.122.1:53 0.0.0.0:* 2987/dnsmasq |
#netstat -lnp -A inet
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 2656/hpiod tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:803 0.0.0.0:* LISTEN 2745/rpc.mountd tcp 0 0 0.0.0.0:772 0.0.0.0:* LISTEN 2712/rpc.rquotad tcp 0 0 0.0.0.0:911 0.0.0.0:* LISTEN 2425/rpc.statd tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2390/portmap tcp 0 0 0.0.0.0:52945 0.0.0.0:* LISTEN - tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2987/dnsmasq ... udp 0 0 0.0.0.0:52099 0.0.0.0:* 2940/avahi-daemon: udp 0 0 0.0.0.0:905 0.0.0.0:* 2425/rpc.statd udp 0 0 0.0.0.0:908 0.0.0.0:* 2425/rpc.statd udp 0 0 0.0.0.0:800 0.0.0.0:* 2745/rpc.mountd udp 0 0 192.168.122.1:53 0.0.0.0:* 2987/dnsmasq udp 0 0 0.0.0.0:40120 0.0.0.0:* - udp 0 0 0.0.0.0:67 0.0.0.0:* 2987/dnsmasq udp 0 0 0.0.0.0:5353 0.0.0.0:* 2940/avahi-daemon: udp 0 0 0.0.0.0:111 0.0.0.0:* 2390/portmap udp 0 0 0.0.0.0:631 0.0.0.0:* 2683/cupsd |
#netstat -lnp -A inet | grep 631
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2683/cupsd udp 0 0 0.0.0.0:631 0.0.0.0:* 2683/cupsd |
#netstat -lnp -A inet | grep :631
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2683/cupsd udp 0 0 0.0.0.0:631 0.0.0.0:* 2683/cupsd |
#rpm -ql | grep xinetd
rpmq: no arguments given for query |
#rpm -qa | grep xinetd
|
#yum -y install xinetd
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centosi3.centos.org * base: centosq2.centos.org * extras: centosg4.centos.org * rpmforge: apt.sw.be * updates: centosq3.centos.org http://centosi3.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://centosp4-msync-dvd.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> ... http://mirror.neolabs.kz/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.space.kz/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.vit.com.tr/mirror/CentOS/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.yandex.ru/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. Error Downloading Packages: 2:xinetd-2.3.14-10.el5.x86_64: failure: CentOS/xinetd-2.3.14-10.el5.x86_64.rpm from base: [Errno 256] No more mirrors to try. |
#yum install xinetd
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centosi3.centos.org * base: centosq2.centos.org * extras: centosg4.centos.org * rpmforge: apt.sw.be * updates: centosq3.centos.org http://centosi3.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://centosp4-msync-dvd.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> ... http://mirror.neolabs.kz/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.space.kz/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.vit.com.tr/mirror/CentOS/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.yandex.ru/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. Error Downloading Packages: 2:xinetd-2.3.14-10.el5.x86_64: failure: CentOS/xinetd-2.3.14-10.el5.x86_64.rpm from base: [Errno 256] No more mirrors to try. |
#yum install xinetd
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centosi3.centos.org * base: centosq2.centos.org * extras: centosg4.centos.org * rpmforge: apt.sw.be * updates: centosq3.centos.org http://centosi3.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://centosp4-msync-dvd.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> ... http://mirror.neolabs.kz/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.space.kz/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.vit.com.tr/mirror/CentOS/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.yandex.ru/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. Error Downloading Packages: 2:xinetd-2.3.14-10.el5.x86_64: failure: CentOS/xinetd-2.3.14-10.el5.x86_64.rpm from base: [Errno 256] No more mirrors to try. |
#more /etc/yum
|
#more /etc/yum
|
#more /etc/yum.repos.d/
|
#more /etc/yum.repos.d/
|
#more /etc/yum.repos.d/mirrors-rpmforge
|
#more /etc/yum.repos.d/CentOS-
|
#more /etc/yum.repos.d/CentOS-Base.repo
|
#yum install xinetd
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centosi3.centos.org * base: centosq2.centos.org * extras: centosg4.centos.org * rpmforge: apt.sw.be * updates: centosq3.centos.org http://centosi3.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://centosp4-msync-dvd.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> ... http://mirror.neolabs.kz/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.space.kz/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.vit.com.tr/mirror/CentOS/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.yandex.ru/centos/5.5/os/x86_64/CentOS/xinetd-2.3.14-10.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. Error Downloading Packages: 2:xinetd-2.3.14-10.el5.x86_64: failure: CentOS/xinetd-2.3.14-10.el5.x86_64.rpm from base: [Errno 256] No more mirrors to try. |
#man yum
|
#yum repolist
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centosi3.centos.org * base: centosq2.centos.org * extras: centosg4.centos.org * rpmforge: apt.sw.be * updates: centosq3.centos.org http://centosi3.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://centosp4-msync-dvd.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> ... Trying other mirror. http://mirror.yandex.ru/centos/5.5/updates/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. repo id repo name status addons CentOS-5 - Addons enabled: 0 base CentOS-5 - Base enabled: 3,434 extras CentOS-5 - Extras enabled: 296 rpmforge RHEL 5 - RPMforge.net - dag enabled: 10,446 updates CentOS-5 - Updates enabled: 1,137 repolist: 15,313 |
#yum install xinetd
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.neolabs.kz * base: mirror.neolabs.kz * extras: mirror.neolabs.kz * rpmforge: fr2.rpmfind.net * updates: mirror.neolabs.kz addons | 951 B 00:00 base | 2.1 kB 00:00 extras | 2.1 kB 00:00 ... xinetd-2.3.14-10.el5.x86_64.rpm | 125 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : xinetd 1/1 Installed: xinetd.x86_64 2:2.3.14-10.el5 Complete! |
#yum install xinetd
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centosi3.centos.org * base: centosq2.centos.org * extras: centosg4.centos.org * rpmforge: apt.sw.be * updates: centosq3.centos.org http://centosi3.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://centosp4-msync-dvd.centos.org/centos/5.5/addons/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> ... Trying other mirror. http://mirror.neolabs.kz/centos/5.5/updates/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.space.kz/centos/5.5/updates/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.vit.com.tr/mirror/CentOS/5.5/updates/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. http://mirror.yandex.ru/centos/5.5/updates/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')> Trying other mirror. Setting up Install Process |
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0 |
#route add default gw 192.168.15.253
|
#cat /etc/sysconfig/network-scripts/if
ifcfg-eth0 ifdown-ipsec ifdown-sit ifup-eth ifup-plip ifup-sl ifcfg-lo ifdown-ipv6 ifdown-sl ifup-ippp ifup-plusb ifup-tunnel ifdown ifdown-isdn ifdown-tunnel ifup-ipsec ifup-post ifup-wireless ifdown-bnep ifdown-post ifup ifup-ipv6 ifup-ppp ifdown-eth ifdown-ppp ifup-aliases ifup-ipx ifup-routes ifdown-ippp ifdown-routes ifup-bnep ifup-isdn ifup-sit |
#cat /etc/sysconfig/network-scripts/if
ifcfg-eth0 ifdown-ipsec ifdown-sit ifup-eth ifup-plip ifup-sl ifcfg-lo ifdown-ipv6 ifdown-sl ifup-ippp ifup-plusb ifup-tunnel ifdown ifdown-isdn ifdown-tunnel ifup-ipsec ifup-post ifup-wireless ifdown-bnep ifdown-post ifup ifup-ipv6 ifup-ppp ifdown-eth ifdown-ppp ifup-aliases ifup-ipx ifup-routes ifdown-ippp ifdown-routes ifup-bnep ifup-isdn ifup-sit |
#cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Atheros Communications Atheros AR8121/AR8113/AR8114 PCI-E Ethernet Controller DEVICE=eth0:0 BOOTPROTO=none NETMASK=255.255.255.0 IPADDR=192.168.15.4 #GATEWAY=192.168.15.253 TYPE=Ethernet USERCTL=no IPV6INIT=no ONPARENT=no PEERDNS=yes |
#sed -i s/#G/G/ /etc/sysconfig/network-scripts/ifcfg-eth0
|
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0 0.0.0.0 192.168.15.253 0.0.0.0 UG 0 0 0 eth0 |
#netstat -rn
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0 0.0.0.0 192.168.15.253 0.0.0.0 UG 0 0 0 eth0 |
#ip route show
192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.4 192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 default via 192.168.15.253 dev eth0 |
#ls /etc/xinetd.d/
chargen-dgram daytime-stream echo-dgram ekrb5-telnet krb5-telnet tcpmux-server chargen-stream discard-dgram echo-stream gssftp kshell time-dgram daytime-dgram discard-stream eklogin klogin rsync time-stream |
#ls /etc/xinetd.conf
/etc/xinetd.conf |
#strings `which xinetd` | grep /etc
/etc/inetd.conf service/protocol combination not in /etc/services: %s/%s /etc/xinetd.conf Protocol %s not in /etc/protocols inetd.conf - Protocol %s not in /etc/protocols |
#strings `which xinetd` | grep ^/etc
/etc/inetd.conf /etc/xinetd.conf |
#less /etc/xinetd.conf
|
#cat /etc/xinetd.d/echo-stream
# This is the configuration for the tcp/stream echo service. service echo { # This is for quick on or off of the service disable = yes # The next attributes are mandatory for all services id = echo-stream type = INTERNAL wait = no socket_type = stream ... # rlimit_as = # rlimit_cpu = # rlimit_data = # rlimit_rss = # rlimit_stack = # Banner options. (Banners aren't normally used) # banner = # banner_success = # banner_fail = } |
#cat /etc/xinetd.d/echo-stream | grep -v ^#
service echo { disable = yes id = echo-stream type = INTERNAL wait = no socket_type = stream } |
#cat /etc/xinetd.d/echo-stream | grep -v ^# | grep -xv ''
service echo { disable = yes id = echo-stream type = INTERNAL wait = no socket_type = stream } |
#strings `which xinetd` | grep ^/etc
/etc/inetd.conf /etc/xinetd.conf |
#strings $(which xinetd) | grep ^/etc
/etc/inetd.conf /etc/xinetd.conf |
#chkconfig --list
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off autofs 0:off 1:off 2:off 3:on 4:on 5:on 6:off avahi-daemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off avahi-dnsconfd 0:off 1:off 2:off 3:off 4:off 5:off 6:off bluetooth 0:off 1:off 2:on 3:on 4:on 5:on 6:off capi 0:off 1:off 2:off 3:off 4:off 5:off 6:off ... eklogin: off ekrb5-telnet: off gssftp: off klogin: off krb5-telnet: off kshell: off rsync: off tcpmux-server: off time-dgram: off time-stream: off |
#chkconfig --list
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off autofs 0:off 1:off 2:off 3:on 4:on 5:on 6:off avahi-daemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off avahi-dnsconfd 0:off 1:off 2:off 3:off 4:off 5:off 6:off bluetooth 0:off 1:off 2:on 3:on 4:on 5:on 6:off capi 0:off 1:off 2:off 3:off 4:off 5:off 6:off ... eklogin: off ekrb5-telnet: off gssftp: off klogin: off krb5-telnet: off kshell: off rsync: off tcpmux-server: off time-dgram: off time-stream: off |
#chkconfig --list
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off autofs 0:off 1:off 2:off 3:on 4:on 5:on 6:off avahi-daemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off avahi-dnsconfd 0:off 1:off 2:off 3:off 4:off 5:off 6:off bluetooth 0:off 1:off 2:on 3:on 4:on 5:on 6:off capi 0:off 1:off 2:off 3:off 4:off 5:off 6:off ... eklogin: off ekrb5-telnet: off gssftp: off klogin: off krb5-telnet: off kshell: off rsync: off tcpmux-server: off time-dgram: off time-stream: off |
#/etc/init.d/xinetd start
Starting xinetd: |
#pkill -1 xinetd
|
#ps aux | grep xinetd
root 4848 0.0 0.0 61164 720 pts/7 R+ 10:51 0:00 grep xinetd |
#/etc/init.d/xinetd start
Starting xinetd: [ OK ] |
#ps -ef | grep xinetd
root 4862 1 0 10:51 ? 00:00:00 xinetd -stayalive -pidfile /var/run/xinetd.pid root 4893 3930 0 10:52 pts/5 00:00:00 grep xinetd |
#grep ^echo /etc/services
echo 7/tcp echo 7/udp echo 4/ddp # AppleTalk Echo Protocol echonet 3610/tcp # ECHONET echonet 3610/udp # ECHONET |
#grep ^echo /etc/service
grep: /etc/service: No such file or directory |
#netstat -lnp | grep :7
tcp 0 0 0.0.0.0:772 0.0.0.0:* LISTEN 2712/rpc.rquotad tcp 0 0 0.0.0.0:7 0.0.0.0:* LISTEN 4862/xinetd udp 0 0 0.0.0.0:769 0.0.0.0:* 2712/rpc.rquotad |
#grep ^echo /etc/services
echo 7/tcp echo 7/udp echo 4/ddp # AppleTalk Echo Protocol echonet 3610/tcp # ECHONET echonet 3610/udp # ECHONET |
#netstat -nlp | grep :7
tcp 0 0 0.0.0.0:772 0.0.0.0:* LISTEN 2712/rpc.rquotad tcp 0 0 0.0.0.0:7 0.0.0.0:* LISTEN 4862/xinetd udp 0 0 0.0.0.0:769 0.0.0.0:* 2712/rpc.rquotad |
#nc 127.0.0.1 7
ggggggggggggggggg ggggggggggggggggg gggg gggg ggggggggg ggggggggg |
#yum install nmap
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.space.kz * base: mirror.space.kz * extras: mirror.space.kz * rpmforge: fr2.rpmfind.net * updates: mirror.space.kz Setting up Install Process Package 2:nmap-4.11-1.1.x86_64 already installed and latest version Nothing to do |
#nmap -p 7 192.168.15.{1..5}
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2011-04-06 10:54 ALMT Failed to lookup subnet/netmask for device (eth0): eth0: no IPv4 address assigned QUITTING! |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:26:18:E4:56:60 inet6 addr: fe80::226:18ff:fee4:5660/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:9762 errors:0 dropped:0 overruns:0 frame:0 TX packets:10430 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 RX bytes:2669641 (2.5 MiB) TX bytes:811954 (792.9 KiB) Interrupt:66 Memory:feac0000-feb00000 eth0:0 Link encap:Ethernet HWaddr 00:26:18:E4:56:60 inet addr:192.168.15.4 Bcast:192.168.15.255 Mask:255.255.255.0 ... collisions:0 txqueuelen:0 RX bytes:1918924 (1.8 MiB) TX bytes:1918924 (1.8 MiB) virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0 inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:45 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:8316 (8.1 KiB) |
#nmap -p 7 -i eth1 192.168.15.{1..5}
Failed to open input file eth1 for reading QUITTING! |
#nmap -p 7 -e eth1 192.168.15.{1..5}
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2011-04-06 10:55 ALMT I cannot figure out what source address to use for device eth1, does it even exist? QUITTING! |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:26:18:E4:56:60 inet6 addr: fe80::226:18ff:fee4:5660/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:9581 errors:0 dropped:0 overruns:0 frame:0 TX packets:10217 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 RX bytes:2647099 (2.5 MiB) TX bytes:796212 (777.5 KiB) Interrupt:66 Memory:feac0000-feb00000 eth0:0 Link encap:Ethernet HWaddr 00:26:18:E4:56:60 inet addr:192.168.15.4 Bcast:192.168.15.255 Mask:255.255.255.0 ... collisions:0 txqueuelen:0 RX bytes:1918924 (1.8 MiB) TX bytes:1918924 (1.8 MiB) virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0 inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:45 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:8316 (8.1 KiB) |
#nmap -p 7 -e eth0:0 192.168.15.{1..5}
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2011-04-06 10:55 ALMT Failed to lookup subnet/netmask for device (eth0): eth0: no IPv4 address assigned QUITTING! |
#grep -v ^# /etc/xinetd.d/echo-stream
service echo { disable = no id = echo-stream type = INTERNAL wait = no socket_type = stream } |
#grep -v ^# /etc/xinetd.d/echo-stream | grep -xvf ''
grep: : No such file or directory |
#grep -v ^# /etc/xinetd.d/echo-stream | grep -xvf ''
grep: : No such file or directory |
#grep -v ^# /etc/xinetd.d/echo-stream
service echo { disable = no id = echo-stream type = INTERNAL wait = no socket_type = stream } |
#grep -v ^# /etc/xinetd.d/echo-stream | grep -xvf ''
grep: : No such file or directory |
#grep -v ^# /etc/xinetd.d/echo-stream | grep -xvf ''
grep: : No such file or directory |
#grep -v ^# /etc/xinetd.d/echo-stream
anaconda-ks.cfg install.log.syslog backups/ .l3rc .bash_history .lesshst .bash_logout .lilalo/ .bash_profile Mail/ .bashrc .mc/ .config/ mdadm/ cpumem.info .metacity/ .crontab.swp .mozilla/ .cshrc .nautilus/ ... .elinks/ rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm .gconf/ .ssh/ .gconfd/ .tcshrc .gnome/ .thumbnails/ .gnome2/ .Trash/ .gnome2_private/ .viminfo .gstreamer-0.10/ .xauthFeFAAu .gtkrc-1.2-gnome2 .xauthl6XiOi .ICEauthority .xauthXGrFub install.log .xsession-errors |
#grep -v ^# /etc/xinetd.d/echo-stream
service echo { disable = no id = echo-stream type = INTERNAL wait = no socket_type = stream } |
#grep -v ^# /etc/xinetd.d/echo-stream | grep
Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. |
#grep -v ^# /etc/xinetd.d/echo-stream | grep disable
disable = no |
#grep -v ^# /etc/xinetd.d/echo-stream | grep -xv ''
service echo { disable = no id = echo-stream type = INTERNAL wait = no socket_type = stream } |
#grep -v ^# /etc/xinetd.d/echo-stream | grep -xv ' '
service echo { disable = no id = echo-stream type = INTERNAL wait = no socket_type = stream } |
#grep -v ^# /etc/xinetd.d/echo-stream
service echo { disable = no id = echo-stream type = INTERNAL wait = no socket_type = stream } |
#grep -v ^# /etc/xinetd.d/echo-stream > /etc/xinetd.d/finger
You have new mail in /var/spool/mail/root |
#vim /etc/xinetd.d/finger
--- /tmp/l3-saved-5308.2524.30166 2011-04-06 11:02:17.000000000 +0600 +++ /etc/xinetd.d/finger 2011-04-06 11:03:17.000000000 +0600 @@ -1,8 +1,9 @@ -service echo +service finger { disable = no id = echo-stream - type = INTERNAL + server = /bin/cat wait = no socket_type = stream + user = root } |
#/etc/init.d/xinetd restart
Stopping xinetd: [ OK ] Starting xinetd: [ OK ] |
#chkconfig --list finger
finger on |
#nc 127.0.0.1 79
sda sda dsa dsa |
#netstat -nlp | :79
bash: :79: command not found |
#netstat -nlp | gre p:79
bash: gre: command not found |
#netstat -nlp | grep :79
tcp 0 0 0.0.0.0:79 0.0.0.0:* LISTEN 6366/xinetd |
#netstat -lp | grep finger
tcp 0 0 *:finger *:* LISTEN 6366/xinetd |
#netstat -nlp | grep finger
|
#vim /etc/xinetd.d/finger
|
#vim /etc/xinetd.d/finger
|
#~
service finger { disable = no id = finger server = /bin/cat wait = no socket_type = stream user = root } |
#~
VIM(1) VIM(1) NAME vim - Vi IMproved, a programmers text editor NAME SYNOPSIS vim [options] [file ..]ogrammers text editor vim [options] - vim [options] -t tag vim [options] -q [errorfile] SYNOPSIS ... More generally Vim is started with: vim file vim [options] [filelist] More generally Vim is started with: If the filelist is missing, the editor will start with an empty buffer. Otherwise exactly one out of the following four may be used to choose one or more files to be edited. If the filelist is missing, the editor will start with an empty buffer. file .. A list of filenames. The first one will be the current file or more files to be edited. |
#vim --help
Usage: diff [OPTION]... FILES Compare files line by line. -i --ignore-case Ignore case differences in file contents. --ignore-file-name-case Ignore case when comparing file names. --no-ignore-file-name-case Consider case when comparing file names. -E --ignore-tab-expansion Ignore changes due to tab expansion. -b --ignore-space-change Ignore changes in the amount of white space. -w --ignore-all-space Ignore all white space. -B --ignore-blank-lines Ignore changes whose lines are all blank. -I RE --ignore-matching-lines=RE Ignore changes whose lines all match RE. --strip-trailing-cr Strip trailing carriage return on input. -a --text Treat all files as text. -c -C NUM --context[=NUM] Output NUM (default 3) lines of copied context. -u -U NUM --unified[=NUM] Output NUM (default 3) lines of unified context. --label LABEL Use LABEL instead of file name. -p --show-c-function Show which C function each change is in. -F RE --show-function-line=RE Show the most recent line matching RE. -q --brief Output only whether files differ. -e --ed Output an ed script. --normal Output a normal diff. -n --rcs Output an RCS format diff. -y --side-by-side Output in two columns. -W NUM --width=NUM Output at most NUM (default 130) print columns. --left-column Output only the left column of common lines. --suppress-common-lines Do not output common lines. -D NAME --ifdef=NAME Output merged file to show `#ifdef NAME' diffs. --GTYPE-group-format=GFMT Similar, but format GTYPE input groups with GFMT. --line-format=LFMT Similar, but format all input lines with LFMT. --LTYPE-line-format=LFMT Similar, but format LTYPE input lines with LFMT. LTYPE is `old', `new', or `unchanged'. GTYPE is LTYPE or `changed'. GFMT may contain: %< lines from FILE1 %> lines from FILE2 %= lines common to FILE1 and FILE2 %[-][WIDTH][.[PREC]]{doxX}LETTER printf-style spec for LETTER LETTERs are as follows for new group, lower case for old group: F first line number L last line number N number of lines = L-F+1 E F-1 M L+1 LFMT may contain: %L contents of line %l contents of line, excluding any trailing newline %[-][WIDTH][.[PREC]]{doxX}n printf-style spec for input line number Either GFMT or LFMT may contain: %% % %c'C' the single character C %c'\OOO' the character with octal code OOO -l --paginate Pass the output through `pr' to paginate it. -t --expand-tabs Expand tabs to spaces in output. -T --initial-tab Make tabs line up by prepending a tab. -r --recursive Recursively compare any subdirectories found. -N --new-file Treat absent files as empty. --unidirectional-new-file Treat absent first files as empty. -s --report-identical-files Report when two files are the same. -x PAT --exclude=PAT Exclude files that match PAT. -X FILE --exclude-from=FILE Exclude files that match any pattern in FILE. -S FILE --starting-file=FILE Start with FILE when comparing directories. --from-file=FILE1 Compare FILE1 to all operands. FILE1 can be a directory. --to-file=FILE2 Compare all operands to FILE2. FILE2 can be a directory. --horizon-lines=NUM Keep NUM lines of the common prefix and suffix. -d --minimal Try hard to find a smaller set of changes. --speed-large-files Assume large files and many scattered small changes. -v --version Output version info. --help Output this help. FILES are `FILE1 FILE2' or `DIR1 DIR2' or `DIR FILE...' or `FILE... DIR'. If --from-file or --to-file is given, there are no restrictions on FILES. If a FILE is `-', read standard input. Report bugs to <bug-gnu-utils@gnu.org>. |
#man netstat
|
#vim /etc/xinetd.d/finger
|
#~
19 # RPC based services must fill out these 20 #/xinetdrpc_version =6L, 1137C 21 # rpc_number = 22 # Logging options 23 # log_type = 24 # log_on_success = 25 # log_on_failure = 26 # Networking options 27 # flags = 28 # bind = 29 # redirect = 30 # v6only = 31 # Access restrictions 32 # only_from = 33 # no_access = 34 # access_times = 35 # cps = 50 10 36 # instances = UNLIMITED 37 # per_source = UNLIMITED |
#max_load = 0
19 # RPC based services must fill out these 20 #/xinetdrpc_version =6L, 1137C 21 # rpc_number = 22 # Logging options 23 # log_type = 24 # log_on_success = 25 # log_on_failure = 26 # Networking options 27 # flags = 28 # bind = 29 # redirect = 30 # v6only = 31 # Access restrictions 32 # only_from = 33 # no_access = 34 # access_times = 35 # cps = 50 10 36 # instances = UNLIMITED 37 # per_source = UNLIMITED |
#THIS IS THE CONFIGURATION FOR THE TCP/STREAM ECHO SERVICE.
Apr 6 10:53:36 linux4 xinetd[4862]: START: echo-stream pid=4954 from=127.0.0.1 Apr 6 10:53:43 linux4 xinetd[4862]: EXIT: echo-stream status=0 pid=4954 duration=7(sec) Apr 6 10:54:01 linux4 xinetd[4862]: START: echo-stream pid=4964 from=127.0.0.1 Apr 6 10:54:05 linux4 xinetd[4862]: EXIT: echo-stream status=0 pid=4964 duration=4(sec) Apr 6 10:54:34 linux4 yum: Installed: 2:nmap-4.11-1.1.x86_64 Apr 6 11:04:12 linux4 xinetd[4862]: Exiting... Apr 6 11:04:12 linux4 xinetd[6366]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in. Apr 6 11:04:12 linux4 xinetd[6366]: Started working: 2 available services Apr 6 11:04:39 linux4 xinetd[6366]: START: finger pid=6385 from=127.0.0.1 Apr 6 11:04:45 linux4 xinetd[6366]: EXIT: finger status=0 pid=6385 duration=6(sec) |
#nc 127.0.0.1 79
ddas ddas |
#/etc/init.d/xinetd restart
Stopping xinetd: [ OK ] Starting xinetd: [ OK ] |
ifcfg-eth0 ifdown-ipsec ifdown-sit ifup-eth ifup-plip ifup-sl ifcfg-lo ifdown-ipv6 ifdown-sl ifup-ippp ifup-plusb ifup-tunnel ifdown ifdown-isdn ifdown-tunnel ifup-ipsec ifup-post ifup-wireless ifdown-bnep ifdown-post ifup ifup-ipv6 ifup-ppp ifdown-eth ifdown-ppp ifup-aliases ifup-ipx ifup-routes ifdown-ippp ifdown-routes ifup-bnep ifup-isdn ifup-sit
# Atheros Communications Atheros AR8121/AR8113/AR8114 PCI-E Ethernet Controller DEVICE=eth0:0 BOOTPROTO=none NETMASK=255.255.255.0 IPADDR=192.168.15.4 #GATEWAY=192.168.15.253 TYPE=Ethernet USERCTL=no IPV6INIT=no ONPARENT=no PEERDNS=yes
# This is the configuration for the tcp/stream echo service. service echo { # This is for quick on or off of the service disable = yes # The next attributes are mandatory for all services id = echo-stream type = INTERNAL wait = no socket_type = stream # protocol = socket type is usually enough # External services must fill out the following # user = # group = # server = # server_args = # External services not listed in /etc/services must fill out the next one # port = # RPC based services must fill out these # rpc_version = # rpc_number = # Logging options # log_type = # log_on_success = # log_on_failure = # Networking options # flags = # bind = # redirect = # v6only = # Access restrictions # only_from = # no_access = # access_times = # cps = 50 10 # instances = UNLIMITED # per_source = UNLIMITED # max_load = 0 # deny_time = 120 # mdns = yes # Environmental options # env = # passenv = # nice = 0 # umask = 022 # groups = yes # rlimit_as = # rlimit_cpu = # rlimit_data = # rlimit_rss = # rlimit_stack = # Banner options. (Banners aren't normally used) # banner = # banner_success = # banner_fail = }
Время первой команды журнала | 06:15:32 2011- 4- 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 07:40:15 2011- 4- 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 22.77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008