Журнал лабораторных работ

Содержание

Журнал

Вторник (06/11/13)

/dev/pts/1
13:50:21
#iptables -D INPUT 2

13:50:36
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    DROP       icmp --  net.nt               anywhere
Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination
13:51:09
# L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    DROP       icmp --  fobos.net.nt         debian3.net.nt
2    DROP       icmp --  net.nt               anywhere
Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination
13:51:11
# L --line-numbers
                            D INPUT 1
13:51:20
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    DROP       icmp --  fobos.net.nt         anywhere
Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination
13:51:21
#iptables -D INPUT 1

13:51:27
#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
13:51:30
#iptables -A OUTPUT -p icmp -j DROP

13:52:25
#ping ya.ru
PING ya.ru (77.88.21.3) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
^C
--- ya.ru ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2016ms
13:52:29
#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
^C
--- 8.8.8.8 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
13:52:34
#ping 192.168.13.253
PING 192.168.13.253 (192.168.13.253) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
^C
--- 192.168.13.253 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1007ms
13:53:25
#ping 8.8.8
PING 8.8.8 (8.8.0.8) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
^C
--- 8.8.8 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1008ms
13:53:32
#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
^C
--- 8.8.8.8 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
13:53:34
#iptables -L
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
DROP       icmp --  anywhere            !net.nt
DROP       icmp --  anywhere             anywhere
13:53:56
#iptables -D OUTPUT 2

13:54:28
#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms
13:54:33
#ping 192.168.13.253
PING 192.168.13.253 (192.168.13.253) 56(84) bytes of data.
64 bytes from 192.168.13.253: icmp_req=1 ttl=64 time=0.309 ms
64 bytes from 192.168.13.253: icmp_req=2 ttl=64 time=0.195 ms
^C
--- 192.168.13.253 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.195/0.252/0.309/0.057 ms
13:54:40
#ping 192.168.13.253
PING 192.168.13.253 (192.168.13.253) 56(84) bytes of data.
64 bytes from 192.168.13.253: icmp_req=1 ttl=64 time=0.418 ms
64 bytes from 192.168.13.253: icmp_req=2 ttl=64 time=0.198 ms
^C
--- 192.168.13.253 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.198/0.308/0.418/0.110 ms
13:57:44
#iptables -I OUTPUT -p icmp ! -d 192.168.13.0/24 -j DROP

13:58:37
#ping ya.ru
PING ya.ru (87.250.250.3) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
^C
--- ya.ru ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms
13:58:41
#pint 192.168.13.253
l3script: pint: команда не найдена
13:58:45
#ping 192.168.13.253
PING 192.168.13.253 (192.168.13.253) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
^C
--- 192.168.13.253 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1007ms
13:58:49
#iptables -L
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
DROP       icmp --  anywhere            !192.168.13.0/24
DROP       icmp --  anywhere             192.168.13.0/24
DROP       icmp --  anywhere            !net.nt
13:58:53
#iptables -F

13:59:08
#iptables -L
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
13:59:10
#man iptables
прошло 11 минут
14:10:54
#iptables -L
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
14:11:07
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  --  192.168.13.0/24      anywhere
14:11:54
#iptables -t nat -D POSTROUTING 1

14:12:02
#iptables -t nat -F

14:12:08
#man iptables
14:12:45
#F

14:12:45
#man iptables
14:12:51
#F

14:12:51
#man iptables
14:12:51
#L

14:13:09
#iptables -A INPUT -s 192.168.13.0/24 -j ACCEPT

14:13:19
#iptables-save > file1

14:13:31
#vim file1
14:13:56
#~

14:14:07
#iptables -t nat -F

14:14:10
#iptables -L
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
14:14:17
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
14:14:24
#iptables-restore < file1

14:14:34
#ls
file1  xinetd.conf
14:14:35
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  --  192.168.13.0/24      anywhere
14:14:37
#iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  192.168.13.0/24      anywhere
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
DROP       icmp --  anywhere            !192.168.13.0/24
14:14:40
#vim /etc/network/i
14:14:40
#vim /etc/network/i
14:14:40
#vim /etc/network/if-up.d/iptables-start.sh
--- /dev/null	2013-06-10 20:00:46.311999992 +0300
+++ /etc/network/if-up.d/iptables-start.sh	2013-06-11 15:15:42.000000000 +0300
@@ -0,0 +1,2 @@
+#!/bin/bash
+iptables-restor < /etc/iptables.rules
14:15:42
#vim /etc/network/if-down.d/.d/iptables-stop.sh
14:16:33
#~
~
~
~
~
~
~
~
~
~
~
...
~
~
~
~
~
~
~
~
~
<network/if-down.d/iptables-stop.sh" [Новый] 2L, 48C записано
14:16:55
#F

14:16:55
#man iptables
14:16:55
#ping 192.168.13.253

14:16:55
# L --line-numbers

14:16:55
#L --line-numbers
                  iptables -I OUTPUT -p icmp ! -d 192.168.13.253 -j DROP
14:19:51
#ping 192.168.13.253
PING 192.168.13.253 (192.168.13.253) 56(84) bytes of data.
64 bytes from 192.168.13.253: icmp_req=1 ttl=64 time=0.807 ms
64 bytes from 192.168.13.253: icmp_req=2 ttl=64 time=0.152 ms
^C
--- 192.168.13.253 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.152/0.479/0.807/0.328 ms
14:19:58
#ping ya.ru
PING ya.ru (87.250.250.203) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
^C
--- ya.ru ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
14:20:01
#iptables -A OUTPUT -p icmp -d 192.168.13.253 -j DROP

14:20:28
#iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  192.168.13.0/24      anywhere
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
DROP       icmp --  anywhere            !fobos.net.nt
DROP       icmp --  anywhere            !192.168.13.0/24
DROP       icmp --  anywhere             net.nt
14:20:32
#iptables -F

14:21:43
#w3m bash.org.ru
xxx: Бывают фотки настол0ко6плохие, что их даже минусовать противно...
[admin1 is online]
+ 684 –s[:||||:] Поделиться 2013-06-11 10:46 #422957
 admin2 is ofline]
Валим деревья в овраге на участке. Тащу бревнышко на плече. Ну как бревнышко -
[admin2 is ofline]
сантиметров 12-15 диаметром и метра 4 в длину. Мимо жены прохожу:
я: вот каждый раз,Ðкак¼Ð¸Ð´Ñƒ±ÑÑбревномµÐ½Ð°Ðплече, чувствую себя, как...
+ 674 – [:||||:] Поделить я 2013-06-11 11:11 #422958
в коме лежать...
...
+ 674 – [:||||:] Поделить я 2013-06-11 11:11 #422958
Я,Ðпы¼Ð°ÑÑÑŒ успокоить: "ну не переживай. Будь сильной. Есть люди, которые выше
≪ ↑ ↓ Viewing <Цитатник Рунета>
Ж: как Р        ]→817816···начало
ак9Шварц|изÐкоммандо!я 2013-06-11 11:45 #422961
+ 2625 – [:||||:]²ÐŸÐ¾Ð´ÐµÐ»Ð¸Ñ‚ься 2013-06-11Ñ10:45 #422956Ð¸Ñ‚ÑŒ парня, к какому врачу лучше записаться
жена¿Ð²ÑÐ¶ÐµÑ‚ крючком, и сÐотрит тарантину "убить билла". комментирует вслух:
- четыре года в коме пролежала, а ногти на ногах накрашены. умеют же там у них
+ 1209 – [:||||:] Поделиться 2013-06-11 11:12 #422960
xxx: Почему в отношениях с женщинами я всегда нахожусь в ситуации между: "Ты
прошло 10 минут
14:32:34
#мелочей жиз и. Например, буддийские монахи..."

14:32:35
#nmap 192.168.13.1
Starting Nmap 5.00 ( http://nmap.org ) at 2013-06-11 15:53 EEST
Interesting ports on 192.168.13.1:
Not shown: 998 filtered ports
PORT   STATE  SERVICE
22/tcp open   ssh
80/tcp closed http
MAC Address: 00:16:3E:00:00:01 (Xensource)
Nmap done: 1 IP address (1 host up) scanned in 4.97 seconds
прошло 20 минут
14:53:24
#nmap 192.168.13.2
Starting Nmap 5.00 ( http://nmap.org ) at 2013-06-11 15:54 EEST
Interesting ports on 192.168.13.2:
Not shown: 998 filtered ports
PORT   STATE  SERVICE
22/tcp open   ssh
80/tcp closed http
MAC Address: 00:16:3E:00:00:02 (Xensource)
Nmap done: 1 IP address (1 host up) scanned in 4.67 seconds
прошло 15 минут
15:09:00
#ls
file1  xinetd.conf
15:11:54
#vim /etc/ssh/ssh
15:11:54
#vim /etc/ssh/ssh
15:11:54
#vim /etc/ssh/sshd_config
--- /tmp/l3-saved-27042.7811.17420	2013-06-11 16:34:34.000000000 +0300
+++ /etc/ssh/sshd_config	2013-06-11 16:36:24.000000000 +0300
@@ -6,6 +6,7 @@
 # Use these options to restrict which interfaces/protocols sshd will bind to
 #ListenAddress ::
 #ListenAddress 0.0.0.0
+ListenAddress 127.0.0.1
 Protocol 2
 # HostKeys for protocol version 2
 HostKey /etc/ssh/ssh_host_rsa_key
прошло 24 минуты
15:36:24
#/etc/init.d/ssh restart
Restarting OpenBSD Secure Shell server: sshd.
15:36:34
#netstat -nlp|less
15:38:44
#ssh root@127.0.0.1
^C
15:38:52
#iptables -F

15:38:56
#ssh root@127.0.0.1
^C
15:39:02
#ifcofnig lo
l3script: ifcofnig: команда не найдена
15:39:07
#ifconfig lo
lo        Link encap:Local Loopback
          LOOPBACK  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
15:39:19
#/etc/init.d/networking restart
Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning).
Reconfiguring network interfaces...done.
15:39:32
#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:3e:00:00:03
          inet addr:192.168.13.3  Bcast:192.168.13.255  Mask:255.255.255.0
          inet6 addr: fe80::216:3eff:fe00:3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:211523 errors:0 dropped:0 overruns:0 frame:0
          TX packets:518078 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:202567034 (193.1 MiB)  TX bytes:2453635887 (2.2 GiB)
          Interrupt:72
eth0:1    Link encap:Ethernet  HWaddr 00:16:3e:00:00:03
          inet addr:192.168.13.252  Bcast:192.168.13.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:72
15:39:34
#ifconfig lo up

15:39:40
#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:3e:00:00:03
          inet addr:192.168.13.3  Bcast:192.168.13.255  Mask:255.255.255.0
          inet6 addr: fe80::216:3eff:fe00:3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:211664 errors:0 dropped:0 overruns:0 frame:0
          TX packets:518240 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:202575861 (193.1 MiB)  TX bytes:2453659339 (2.2 GiB)
          Interrupt:72
eth0:1    Link encap:Ethernet  HWaddr 00:16:3e:00:00:03
          inet addr:192.168.13.252  Bcast:192.168.13.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:72
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
15:45:11
#ssh 192.168.13.253 -l root
root@192.168.13.253's password:
Linux fobos 3.1.0-rc9+ #1 SMP Mon Jun 18 15:44:37 EEST 2012 x86_64
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.
Last login: Tue Jun 11 14:47:40 2013 from 192.168.13.3
fobos:~# exit
logout
Connection to 192.168.13.253 closed.
15:46:12
#ssh root@192.168.13.253 -v
OpenSSH_5.5p1 Debian-6+squeeze2, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.13.253 [192.168.13.253] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
...
permitted by applicable law.
Last login: Tue Jun 11 16:46:10 2013 from 192.168.13.3
fobos:~# exitdebug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
logout
debug1: channel 0: free: client-session, nchannels 1
Connection to 192.168.13.253 closed.
Transferred: sent 1960, received 2856 bytes, in 64.9 seconds
Bytes per second: sent 30.2, received 44.0
debug1: Exit status 0
15:48:05
#ssh root@192.168.13.1
The authenticity of host '192.168.13.1 (192.168.13.1)' can't be established.
RSA key fingerprint is 62:dd:81:b1:0d:50:38:41:e7:82:ea:89:d5:48:16:e0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.13.1' (RSA) to the list of known hosts.
root@192.168.13.1's password:
Permission denied, please try again.
root@192.168.13.1's password:
Linux debian1 2.6.39-bpo.2-686-pae #1 SMP Thu Aug 4 11:02:22 UTC 2011 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
...
permitted by applicable law.
Last login: Mon Jun 10 16:45:29 2013 from net.nt
l3-agent is already running: pid=1197; pidfile=/root/.lilalo/l3-agent.pid
root@debian1:~#
root@debian1:~#
root@debian1:~#
root@debian1:~# iptables -F
root@debian1:~# iptables -A INPUT -p tcp --dport 22 -j DROP && exit
logout
Connection to 192.168.13.1 closed.
15:49:04
#ssh root@192.168.13.1
^C
15:49:09
#ssh root@192.168.13.1 -v
OpenSSH_5.5p1 Debian-6+squeeze2, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.13.1 [192.168.13.1] port 22.
^C
15:51:27
#ssh root@192.168.13.1 -v
OpenSSH_5.5p1 Debian-6+squeeze2, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.13.1 [192.168.13.1] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
...
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
root@192.168.13.1's password:
15:52:05
#ssh root@192.168.13.1 -v
OpenSSH_5.5p1 Debian-6+squeeze2, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.13.1 [192.168.13.1] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
ssh_exchange_identification: Connection closed by remote host
15:52:12
#ssh root@192.168.13.1 -v
OpenSSH_5.5p1 Debian-6+squeeze2, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.13.1 [192.168.13.1] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
...
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
root@192.168.13.1's password:
15:52:56
#vim /etc/ssh/sshd_config
--- /tmp/l3-saved-27042.8571.15993	2013-06-11 16:53:04.000000000 +0300
+++ /etc/ssh/sshd_config	2013-06-11 16:53:09.000000000 +0300
@@ -2,7 +2,7 @@
 # See the sshd_config(5) manpage for details
 
 # What ports, IPs and protocols we listen for
-Port 22
+Port 22222
 # Use these options to restrict which interfaces/protocols sshd will bind to
 #ListenAddress ::
 #ListenAddress 0.0.0.0
15:53:09
#/etc/init.d/ssh restart
Restarting OpenBSD Secure Shell server: sshd.
15:53:21
#ssh root@192.168.13.3 -p 22222
The authenticity of host '[192.168.13.3]:22222 ([192.168.13.3]:22222)' can't be established.
RSA key fingerprint is 62:dd:81:b1:0d:50:38:41:e7:82:ea:89:d5:48:16:e0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[192.168.13.3]:22222' (RSA) to the list of known hosts.
root@192.168.13.3's password:
Linux debian3 2.6.39-bpo.2-686-pae #1 SMP Thu Aug 4 11:02:22 UTC 2011 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.
Last login: Tue Jun 11 14:19:27 2013 from 192.168.17.104
l3-agent is already running: pid=2008; pidfile=/root/.lilalo/l3-agent.pid
root@debian3:~# exit
logout
Connection to 192.168.13.3 closed.
15:56:38
#ssh root@192.168.13.1 -f
Cannot fork into background without a command to execute.
15:56:42
#ssh root@192.168.13.1 -f -N
root@192.168.13.1's password:
15:56:52
#ps aux|grep ssh
root      4015  0.0  0.5   8312  2848 ?        Ss   14:19   0:00 sshd: root@pts/3
root     11690  0.0  0.5   8452  2856 ?        Ss   09:30   0:02 sshd: root@pts/0
root     13008  0.0  0.5   8448  2844 ?        Ss   Jun10   0:02 sshd: root@pts/4
root     14772  0.0  0.1   5548   944 ?        Ss   16:54   0:00 /usr/sbin/sshd
root     14801  0.0  0.0   5044   404 ?        Ss   16:56   0:00 ssh root@192.168.13.1 -f -N
root     14810  0.0  0.1   5080   740 pts/2    S+   16:57   0:00 grep ssh
15:57:00
#ssh root@192.168.13.1 ping ya.ru
root@192.168.13.1's password:
PING ya.ru (87.250.250.203) 56(84) bytes of data.
64 bytes from www.yandex.ru (87.250.250.203): icmp_req=1 ttl=59 time=18.2 ms
64 bytes from www.yandex.ru (87.250.250.203): icmp_req=2 ttl=59 time=19.8 ms
64 bytes from www.yandex.ru (87.250.250.203): icmp_req=3 ttl=56 time=19.5 ms
64 bytes from www.yandex.ru (87.250.250.203): icmp_req=4 ttl=59 time=18.3 ms
64 bytes from www.yandex.ru (87.250.250.203): icmp_req=5 ttl=56 time=21.2 ms
64 bytes from www.yandex.ru (87.250.250.203): icmp_req=6 ttl=59 time=17.9 ms
64 bytes from www.yandex.ru (87.250.250.203): icmp_req=7 ttl=56 time=18.5 ms
64 bytes from www.yandex.ru (87.250.250.203): icmp_req=8 ttl=59 time=18.2 ms
15:58:20
#ssh root@192.168.13.1 ping top
root@192.168.13.1's password:
ping: unknown host top
15:58:28
#ssh root@192.168.13.1 top
root@192.168.13.1's password:
TERM environment variable not set.
15:58:36
#ssh root@192.168.13.1 trafshow
root@192.168.13.1's password:
Error opening terminal: unknown.
15:58:55
#ssh root@192.168.13.1 tcpdump
root@192.168.13.1's password:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
15:59:10
#ssh root@192.168.13.1 tcpdump -vv
root@192.168.13.1's password:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
16:59:13.265085 IP (tos 0x8, ttl 64, id 49052, offset 0, flags [DF], proto TCP (6), length 100)
    debian1.net.nt.ssh > net.nt.38388: Flags [P.], cksum 0x9ca5 (incorrect -> 0xf792), seq 2093851820:2093851868, ack 1974357074, win 718, options [nop,nop,TS val 21964033 ecr 21502560], length 48
16:59:13.265164 IP (tos 0x8, ttl 64, id 49053, offset 0, flags [DF], proto TCP (6), length 164)
    debian1.net.nt.ssh > net.nt.38388: Flags [P.], cksum 0x9ce5 (incorrect -> 0x4650), seq 48:160, ack 1, win 718, options [nop,nop,TS val 21964033 ecr 21502560], length 112
16:59:13.265976 IP (tos 0x0, ttl 64, id 9473, offset 0, flags [DF], proto UDP (17), length 73)
    debian1.net.nt.41851 > net.nt.domain: [bad udp cksum d275!] 9724+ PTR? 253.13.168.192.in-addr.arpa. (45)
16:59:13.266227 IP (tos 0x8, ttl 64, id 24328, offset 0, flags [DF], proto TCP (6), length 52)
    net.nt.38388 > debian1.net.nt.ssh: Flags [.], cksum 0x9c75 (incorrect -> 0x1bf5), seq 1, ack 160, win 604, options [nop,nop,TS val 21502564 ecr 21964029], length 0
...
    debian1.net.nt.ssh > 192.168.17.102.4293: Flags [P.], cksum 0xa00e (incorrect -> 0x431e), seq 8353:8401, ack 1440, win 613, options [nop,nop,TS val 21971168 ecr 11710414], length 48
16:59:41.804569 IP (tos 0x8, ttl 64, id 24375, offset 0, flags [DF], proto TCP (6), length 52)
    net.nt.38388 > debian1.net.nt.ssh: Flags [.], cksum 0x9c75 (incorrect -> 0x5f6a), seq 1, ack 98320, win 1973, options [nop,nop,TS val 21509698 ecr 21971167], length 0
16:59:41.804583 IP (tos 0x8, ttl 64, id 24376, offset 0, flags [DF], proto TCP (6), length 52)
    net.nt.38388 > debian1.net.nt.ssh: Flags [.], cksum 0x9c75 (incorrect -> 0x5aaf), seq 1, ack 99568, win 1936, options [nop,nop,TS val 21509698 ecr 21971167], length 0
16:59:41.804592 IP (tos 0x8, ttl 64, id 24377, offset 0, flags [DF], proto TCP (6), length 100)
    net.nt.38388 > debian1.net.nt.ssh: Flags [P.], cksum 0x9ca5 (incorrect -> 0xe6fe), seq 1:49, ack 99568, win 2003, options [nop,nop,TS val 21509698 ecr 21971167], length 48
16:59:41.804777 IP (tos 0x10, ttl 64, id 44236, offset 0, flags [DF], proto TCP (6), length 164)
    debian1.net.nt.ssh > 192.168.17.102.4293: Flags [P.], cksum 0xa04e (incorrect -> 0xdb08), seq 8401:8513, ack 1440, win 613, options [nop,nop,TS val 21971168 ecr 11710414], length 112
16:59:41.804852 IP (tos 0x10, ttl 64, id 44237, offset 0, flags [DF], proto TCP (6), length 100)

Статистика

Время первой команды журнала13:50:21 2013- 6-11
Время последней команды журнала15:59:10 2013- 6-11
Количество командных строк в журнале101
Процент команд с ненулевым кодом завершения, %20.79
Процент синтаксически неверно набранных команд, % 1.98
Суммарное время работы с терминалом *, час 2.15
Количество командных строк в единицу времени, команда/мин 0.78
Частота использования команд
iptables26|========================| 24.76%
ssh19|==================| 18.10%
ping13|============| 12.38%
vim9|========| 8.57%
man5|====| 4.76%
L5|====| 4.76%
ifconfig4|===| 3.81%
F3|==| 2.86%
file12|=| 1.90%
nmap2|=| 1.90%
~2|=| 1.90%
/etc/init.d/ssh2|=| 1.90%
ls2|=| 1.90%
ps1|| 0.95%
ifcofnig1|| 0.95%
мелочей1|| 0.95%
pint1|| 0.95%
iptables-save1|| 0.95%
netstat1|| 0.95%
iptables-restore1|| 0.95%
less1|| 0.95%
grep1|| 0.95%
w3m1|| 0.95%
/etc/init.d/networking1|| 0.95%
____
*) Интервалы неактивности длительностью 30 минут и более не учитываются

Справка

Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
  1. В журнал автоматически попадают все команды, данные в любом терминале системы.

  2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

  3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
    $ l s-l
    bash: l: command not found
    

  4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
    $ test 5 -lt 4
    Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

  5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
    $ 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
    

  6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
    # id
    uid=0(root) gid=0(root) Gruppen=0(root)
    

  7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
    $ vi ~/.bashrc
    2a3,5
    >    if [ -f /usr/local/etc/bash_completion ]; then
    >         . /usr/local/etc/bash_completion
    >        fi
    

  8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
    $ patch ~/.bashrc
    В данном случае изменения применяются к файлу ~/.bashrc

  9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

    Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

  10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

  11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

  12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

  13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

  14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

    $ whoami
    
    user
    
    $ #^ Интересно, кто я?
    
    в журнале это будет выглядеть так:
    $ whoami
    
    user
    
    Интересно, кто я?

  15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

    $ whoami
    
    user
    
    $ cat > /dev/null #^ Интересно, кто я?
    
    Программа whoami выводит имя пользователя, под которым 
    мы зарегистрировались в системе.
    -
    Она не может ответить на вопрос о нашем назначении 
    в этом мире.
    
    В журнале это будет выглядеть так:
    $ whoami
    user
    
    Интересно, кто я?
    Программа whoami выводит имя пользователя, под которым
    мы зарегистрировались в системе.

    Она не может ответить на вопрос о нашем назначении
    в этом мире.
    Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

  16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

  17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
  18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
  19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
    1
        2
    3   
        4
    
    Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

О программе

LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008

$Id$