/l3/users/29-05-2007/nt-lnet/linux1.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 :22 :23 :24 :25 :26 :27 :28 :29 :30 :31 :32 :33 :34 :35 :36 :37 :38 :39 :40 |
|
#ping 192.168.16.3
PING 192.168.16.3 (192.168.16.3) 56(84) bytes of data. 64 bytes from 192.168.16.3: icmp_seq=1 ttl=64 time=0.214 ms 64 bytes from 192.168.16.3: icmp_seq=2 ttl=64 time=0.168 ms --- 192.168.16.3 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.168/0.191/0.214/0.023 ms |
#ping 192.168.16.4
PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. 64 bytes from 192.168.16.4: icmp_seq=1 ttl=64 time=4.12 ms --- 192.168.16.4 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 4.121/4.121/4.121/0.000 ms |
#nmap -p 22 '192.168.16.*'
Interesting ports on linux3.net.nt (192.168.16.3): PORT STATE SERVICE 22/tcp open ssh MAC Address: 00:04:75:75:46:C1 (3 Com) Interesting ports on linux5.net.nt (192.168.16.5): PORT STATE SERVICE 22/tcp closed ssh MAC Address: 00:D0:59:34:B2:F5 (Ambit Microsystems) Interesting ports on net.nt (192.168.16.15): PORT STATE SERVICE 22/tcp open ssh MAC Address: 00:60:08:20:7B:0B (3com) Nmap finished: 256 IP addresses (4 hosts up) scanned in 4.913 seconds [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#ping 192.168.16.4
libgnome-dev - The GNOME libraries -- development package libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library libgnome-mag-dev - screen magnification library for the GNOME desktop (development headers ) libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. 64 bytes from 192.168.16.4: icmp_seq=1 ttl=64 time=3.94 ms 64 bytes from 192.168.16.4: icmp_seq=2 ttl=64 time=0.187 ms --- 192.168.16.4 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min/avg/max/mdev = 0.187/2.066/3.946/1.880 ms [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#nmap -p 22 '192.168.16.*'
Interesting ports on linux4.net.nt (192.168.16.4): PORT STATE SERVICE 22/tcp open ssh MAC Address: 00:01:02:B4:61:09 (3com) Interesting ports on linux5.net.nt (192.168.16.5): PORT STATE SERVICE 22/tcp closed ssh MAC Address: 00:D0:59:34:B2:F5 (Ambit Microsystems) Interesting ports on net.nt (192.168.16.15): PORT STATE SERVICE 22/tcp open ssh MAC Address: 00:60:08:20:7B:0B (3com) Nmap finished: 256 IP addresses (5 hosts up) scanned in 4.464 seconds [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#ssh 192.168.16.2
libglibmm-2.4-dev - C++ wrapper for the GLib toolkit (development files) libgnetwork1.0-0 - networking wrapper library using Glib/GObject libgnetwork1.0-dev - networking wrapper library using Glib/GObject (development files) libgnome-cil - CLI binding for GNOME libgnome-desktop-2 - Utility library for loading .desktop files - runtime files libgnome-desktop-dev - Utility library for loading .desktop files - development files libgnome-dev - The GNOME libraries -- development package libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library libgnome-mag-dev - screen magnification library for the GNOME desktop (development headers ) libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#ssh 192.168.16.2
libglibmm-2.4-dev - C++ wrapper for the GLib toolkit (development files) libgnetwork1.0-0 - networking wrapper library using Glib/GObject libgnetwork1.0-dev - networking wrapper library using Glib/GObject (development files) libgnome-cil - CLI binding for GNOME libgnome-desktop-2 - Utility library for loading .desktop files - runtime files libgnome-desktop-dev - Utility library for loading .desktop files - development files libgnome-dev - The GNOME libraries -- development package libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library libgnome-mag-dev - screen magnification library for the GNOME desktop (development headers ) libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#ssh 192.168.16.4
) libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME root@192.168.16.4's password: Last login: Wed May 30 17:02:55 2007 from linux3.net.nt Linux linux4 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=2670; pidfile=/root/.lilalo/l3-agent.pid [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#ntpdate
[root@linux1:~]# [root@linux1:~]# netstat -lnp | grep :4000 tcp 0 0 0.0.0.0:4000 0.0.0.0:* LISTEN 5267/nc [root@linux1:~]# telnet 127.0.0.GET / HTTP/1.1 Host: 192.168.16.1:4000 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.11) Gecko/20070324 (Debian-1. 8.0.11-2) Epiphany/2.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,im age/png,*/*;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive bash: ntpdate: command not found [root@linux1:~]# ------------------------------------------------------------------------------------------ |
#apt-get install ntpdate
Connection: keep-alive Чтение списков пакетов... Готово Построение дерева зависимостей... Готово НОВЫЕ пакеты, которые будут установлены: ntpdate обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено. Необходимо скачать 57,7kБ архивов. После распаковки объем занятого дискового пространства возрастёт на 213kB. Получено:1 http://debian.org.ua etch/main ntpdate 1:4.2.2.p4+dfsg-2 [57,7kB] Получено 57,7kB за 1s (36,3kB/c) Выбор ранее не выбранного пакета ntpdate. (Чтение базы данных... на данный момент установлено 83641 файлов и каталогов.) Распаковывается пакет ntpdate (из файла .../ntpdate_1%3a4.2.2.p4+dfsg-2_i386.deb)... Настраивается пакет ntpdate (4.2.2.p4+dfsg-2) ... [root@linux1:~]# ------------------------------------------------------------------------------------------ |
#ntpdate ntp.psn.ru
[root@linux1:~]# [root@linux1:~]# netstat -lnp | grep :4000 tcp 0 0 0.0.0.0:4000 0.0.0.0:* LISTEN 5267/nc [root@linux1:~]# telnet 127.0.0.GET / HTTP/1.1 Host: 192.168.16.1:4000 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.11) Gecko/20070324 (Debian-1. 8.0.11-2) Epiphany/2.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,im age/png,*/*;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive 30 May 11:26:55 ntpdate[8452]: step time server 194.149.67.130 offset -11009.469321 sec [root@linux1:~]# ------------------------------------------------------------------------------------------ |
#vi /etc/host.conf
|
#man mvi
|
#mvi
bash: mvi: command not found |
#man vim
|
#iptables -L
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,im age/png,*/*;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Chain INPUT (policy ACCEPT) target prot opt source destination REJECT tcp -- linux4.net.nt anywhere tcp dpt:ssh reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination [root@linux1:~]# ------------------------------------------------------------------------------------------ |
#iptables -L
libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library libgnome-mag-dev - screen magnification library for the GNOME desktop (development headers ) libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#man iptables
|
#iptables -L
libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library libgnome-mag-dev - screen magnification library for the GNOME desktop (development headers ) libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#iptables -L --line-numbers
libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library libgnome-mag-dev - screen magnification library for the GNOME desktop (development headers ) libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME Chain INPUT (policy ACCEPT) num target prot opt source destination Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#ip
libgnetwork1.0-0 - networking wrapper library using Glib/GObject libgnetwork1.0-dev - networking wrapper library using Glib/GObject (development files) libgnome-cil - CLI binding for GNOME libgnome-desktop-2 - Utility library for loading .desktop files - runtime files libgnome-desktop-dev - Utility library for loading .desktop files - development files libgnome-dev - The GNOME libraries -- development package libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library libgnome-mag-dev - screen magnification library for the GNOME desktop (development headers ) ... libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME ip ip6tables-restore ipcalc ipcs iptables iptables-save ip6tables ip6tables-save ipcrm ipmaddr iptables-restore iptunnel [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#iptables -A INPUT -p icmp -j DROP
libglibmm-2.4-1c2a-dbg - C++ wrapper for the GLib toolkit (debug symbols) libglibmm-2.4-dev - C++ wrapper for the GLib toolkit (development files) libgnetwork1.0-0 - networking wrapper library using Glib/GObject libgnetwork1.0-dev - networking wrapper library using Glib/GObject (development files) libgnome-cil - CLI binding for GNOME libgnome-desktop-2 - Utility library for loading .desktop files - runtime files libgnome-desktop-dev - Utility library for loading .desktop files - development files libgnome-dev - The GNOME libraries -- development package libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library ... libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#ping 192.168.16.1
libgnome-desktop-2 - Utility library for loading .desktop files - runtime files libgnome-desktop-dev - Utility library for loading .desktop files - development files libgnome-dev - The GNOME libraries -- development package libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library libgnome-mag-dev - screen magnification library for the GNOME desktop (development headers ) libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. --- 192.168.16.1 ping statistics --- 8 packets transmitted, 0 received, 100% packet loss, time 7010ms [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP icmp -- anywhere anywhere Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination |
#iptables -D 1
libglibmm-2.4-dev - C++ wrapper for the GLib toolkit (development files) libgnetwork1.0-0 - networking wrapper library using Glib/GObject libgnetwork1.0-dev - networking wrapper library using Glib/GObject (development files) libgnome-cil - CLI binding for GNOME libgnome-desktop-2 - Utility library for loading .desktop files - runtime files libgnome-desktop-dev - Utility library for loading .desktop files - development files libgnome-dev - The GNOME libraries -- development package libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library libgnome-mag-dev - screen magnification library for the GNOME desktop (development headers ... libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME iptables: Bad rule (does a matching rule exist in that chain?) [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#iptables -D INPUT 1
|
#iptables -L --line-numbers
libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library libgnome-mag-dev - screen magnification library for the GNOME desktop (development headers ) libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME Chain INPUT (policy ACCEPT) num target prot opt source destination Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. 64 bytes from 192.168.16.1: icmp_seq=1 ttl=64 time=0.104 ms 64 bytes from 192.168.16.1: icmp_seq=2 ttl=64 time=0.057 ms --- 192.168.16.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.057/0.080/0.104/0.025 ms |
#iptables -A INPUT -p tcp --dport 22 -s 192.168.16.4 -j DROP
libglibmm-2.4-1c2a-dbg - C++ wrapper for the GLib toolkit (debug symbols) libglibmm-2.4-dev - C++ wrapper for the GLib toolkit (development files) libgnetwork1.0-0 - networking wrapper library using Glib/GObject libgnetwork1.0-dev - networking wrapper library using Glib/GObject (development files) libgnome-cil - CLI binding for GNOME libgnome-desktop-2 - Utility library for loading .desktop files - runtime files libgnome-desktop-dev - Utility library for loading .desktop files - development files libgnome-dev - The GNOME libraries -- development package libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library ... libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP tcp -- linux4.net.nt anywhere tcp dpt:ssh Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination |
#ssh 192.168.16.4
) libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME root@192.168.16.4's password: Last login: Wed May 30 18:02:48 2007 from linux1.net.nt Linux linux4 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=2670; pidfile=/root/.lilalo/l3-agent.pid [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#iptables -D INPUT -p tcp --dport 22 -s 192.168.16.4 -j DROP
libglibmm-2.4-1c2a-dbg - C++ wrapper for the GLib toolkit (debug symbols) libglibmm-2.4-dev - C++ wrapper for the GLib toolkit (development files) libgnetwork1.0-0 - networking wrapper library using Glib/GObject libgnetwork1.0-dev - networking wrapper library using Glib/GObject (development files) libgnome-cil - CLI binding for GNOME libgnome-desktop-2 - Utility library for loading .desktop files - runtime files libgnome-desktop-dev - Utility library for loading .desktop files - development files libgnome-dev - The GNOME libraries -- development package libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library ... libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT) num target prot opt source destination Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination |
#fdhdf
bash: fdhdf: command not found |
#iptables -A INPUT -p tcp --dport 22 -s 192.168.16.4 -j REJECT
libglibmm-2.4-1c2a-dbg - C++ wrapper for the GLib toolkit (debug symbols) libglibmm-2.4-dev - C++ wrapper for the GLib toolkit (development files) libgnetwork1.0-0 - networking wrapper library using Glib/GObject libgnetwork1.0-dev - networking wrapper library using Glib/GObject (development files) libgnome-cil - CLI binding for GNOME libgnome-desktop-2 - Utility library for loading .desktop files - runtime files libgnome-desktop-dev - Utility library for loading .desktop files - development files libgnome-dev - The GNOME libraries -- development package libgnome-keyring-dev - Development files for GNOME keyring service libgnome-keyring0 - GNOME keyring services library ... libgnome-mag2 - screen magnification library for the GNOME desktop (shared library) libgnome-media-dev - development libraries for the GNOME media utilities libgnome-media0 - runtime libraries for the GNOME media utilities libgnome-menu-dev - an implementation of the freedesktop menu specification for GNOME [root@linux1:~]# [root@linux1:~]# ping 192.168.16.4 PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. From 192.168.16.1 icmp_seq=2 Destination Host Unreachable From 192.168.16.1 icmp_seq=3 Destination Host Unreachable From 192.168.16.1 icmp_seq=4 Destination Host Unreachable |
#ssh 192.168.16.4
root@192.168.16.4's password: Last login: Wed May 30 18:21:34 2007 from linux1.net.nt Linux linux4 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=2670; pidfile=/root/.lilalo/l3-agent.pid |
#iptables -L -vv
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,im age/png,*/*;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Chain INPUT (policy ACCEPT 6484 packets, 430K bytes) pkts bytes target prot opt in out source destination 32 3988 REJECT tcp -- any any linux4.net.nt anywhere tcp dpt:ssh reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 6232 packets, 1517K bytes) pkts bytes target prot opt in out source destination [root@linux1:~]# ------------------------------------------------------------------------------------------ |
#iptables -L -vv
Chain INPUT (policy ACCEPT 7286 packets, 480K bytes) pkts bytes target prot opt in out source destination 42 4556 REJECT tcp -- any any linux4.net.nt anywhere tcp dpt:ssh reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 6984 packets, 1678K bytes) pkts bytes target prot opt in out source destination |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination REJECT tcp -- linux4.net.nt anywhere tcp dpt:ssh reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -L -v
Chain INPUT (policy ACCEPT 6725 packets, 445K bytes) pkts bytes target prot opt in out source destination 34 4108 REJECT tcp -- any any linux4.net.nt anywhere tcp dpt:ssh reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 6451 packets, 1561K bytes) pkts bytes target prot opt in out source destination |
#watch iptables -L -v
|
#iptables -L -v -n
Chain INPUT (policy ACCEPT 6859 packets, 453K bytes) pkts bytes target prot opt in out source destination 42 4556 REJECT tcp -- * * 192.168.16.4 0.0.0.0/0 tcp dpt:22 reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 6581 packets, 1588K bytes) pkts bytes target prot opt in out source destination |
#watch iptables -L -v -n
|
#watch 'iptables -L -v -n'
|
#watch 'iptables -L -v -n INPUT'
Bad argument `INPUT' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -L -v
Chain INPUT (policy ACCEPT 7406 packets, 489K bytes) pkts bytes target prot opt in out source destination 43 4596 REJECT tcp -- any any linux4.net.nt anywhere tcp dpt:ssh reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 7097 packets, 1698K bytes) pkts bytes target prot opt in out source destination |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination REJECT 0 -- !net.nt anywhere reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#ssh clint@net.nt
Connection to net.nt closed. |
#watch iptables -L -v
|
#watch iptables -L -v
|
#iptables -A INPUT -p tcp -d 192.168.16.4 -s 192.168.16.15 -j
|
#iptables -A INPUT -p 8 -j REJECT
|
#watch iptables -L -v
|
#watch iptables -L -v
|
#ssh clint@net.nt
|
#iptables -A INPUT -p 11 -j REJECT
|
#watch iptables -L -v
|
#iptables -F INPUT
iptables v1.3.6: Illegal option `-j' with this command Try `iptables -h' or 'iptables --help' for more information. |
#iptables -F INPUT
|
#watch iptables -L -v
|
#iptables -A INPUT -p 11 -j REJECT
|
#watch iptables -L -v
|
#iptables -A INPUT -p icmp -j REJECT
|
#watch iptables -L -v
|
#iptables -F INPUT
|
#watch iptables -L -v
|
#iptables -L -v
Chain INPUT (policy ACCEPT 12159 packets, 810K bytes) pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 11615 packets, 2679K bytes) pkts bytes target prot opt in out source destination |
#iptables -A INPUT -s! 192.168.16.5
|
#netstat -lnp | grep xinet
tcp 0 0 0.0.0.0:60000 0.0.0.0:* LISTEN 10717/xinetd tcp 0 0 0.0.0.0:7 0.0.0.0:* LISTEN 10717/xinetd |
#telnet 192.168.16.1 calc
Trying 192.168.16.1... Connected to 192.168.16.1. Escape character is '^]'. 2+2# 4 ^] telnet> q Connection closed. |
#telnet 192.168.16.1 60000
|
#telnet 192.168.16.1 calc
Trying 192.168.16.1... |
#telnet 192.168.16.1 60000
Trying 192.168.16.1... |
#ssh clint@net.nt
Connection to net.nt closed. |
#iptables -A INPUT -p 1 -j REJECT --reject-with tcp-reset
iptables: Invalid argument |
#iptables -A INPUT -p 1 -j REJECT
|
#telnet 192.168.16.1 calc
|
#iptables
|
Время первой команды журнала | 13:48:28 2007- 5-30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 15:40:37 2007- 5-30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 26.73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 2.97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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