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

Содержание

Журнал

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

/dev/pts/1
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)
15:59:44
#ssh root@192.168.13.1 . /etc/bash_bashcompletion
root@192.168.13.1's password:
bash: /etc/bash_bashcompletion: Нет такого файла или каталога
16:00:09
#ssh root@192.168.13.1 /etc/bash_bashcompletion
root@192.168.13.1's password:
bash: /etc/bash_bashcompletion: Нет такого файла или каталога
16:00:19
#ssh root@192.168.13.1 /etc/bash_completion
root@192.168.13.1's password:
bash: /etc/bash_completion: Отказано в доступе
16:00:29
#ssh root@192.168.13.1 . /etc/bash_completion
root@192.168.13.1's password:
16:00:44
#ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
42:b7:7b:2d:64:c0:ae:67:8e:94:41:89:dc:6f:33:54 root@debian3
The key's randomart image is:
+--[ RSA 2048]----+
|          E      |
|   . o o .       |
|    o = =        |
|     o = o       |
|      o S o      |
|       * * .     |
|      + + o .    |
|     . = . .     |
|      . .        |
+-----------------+
16:02:09
#ls .ssh/id_rsa*
.ssh/id_rsa  .ssh/id_rsa.pub
16:03:51
#ssh root@192.168.13.2
root@192.168.13.2's password:
16:04:31
#sh root@192.168.13.2
root@192.168.13.2's password:
16:04:57
#sh root@192.168.13.2
Enter passphrase for key '/root/.ssh/id_rsa':
Linux debian2 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 15:35:10 2013 from 192.168.17.104
l3-agent is already running: pid=1207; pidfile=/root/.lilalo/l3-agent.pid
root@debian2:~# exit
logout
Connection to 192.168.13.2 closed.
16:05:11
#ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)?
16:05:18
#ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
79:a7:c6:d6:66:51:07:ec:8a:60:1d:e0:ea:ed:15:d8 root@debian3
...
|        ..   ..  |
|       .  .   .. |
|        .. . .. .|
|       .o+.  ... |
|      ..S.E.o.   |
|     . . o.=..   |
|      . . * +    |
|       . + o     |
|        .        |
+-----------------+
16:05:28
#sh-keygen
                      root@192.168.13.2
Linux debian2 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 17:05:05 2013 from net.nt
l3-agent is already running: pid=1207; pidfile=/root/.lilalo/l3-agent.pid
root@debian2:~# exit
logout
Connection to 192.168.13.2 closed.
16:05:33
#sh-keygen
                      user@192.168.13.2
user@192.168.13.2's password:
16:06:01
#ls .ssh/
id_rsa  id_rsa.pub  known_hosts
16:06:15
#sh root@192.168.13.2
Linux debian2 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 17:05:30 2013 from net.nt
l3-agent is already running: pid=1207; pidfile=/root/.lilalo/l3-agent.pid
root@debian2:~# ^C
root@debian2:~# exit
logout
Connection to 192.168.13.2 closed.
16:06:40
#ssh root@192.168.13.2 cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
...
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
Debian-exim:x:101:103::/var/spool/exim4:/bin/false
statd:x:102:65534::/var/lib/nfs:/bin/false
user:x:1000:1000:user,,,:/home/user:/bin/bash
sshd:x:103:65534::/var/run/sshd:/usr/sbin/nologin
telnetd:x:104:106::/nonexistent:/bin/false
16:06:47
#sh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
e1:30:90:a2:d2:0a:5c:02:29:11:bb:96:fe:6b:4f:70 root@debian3
...
|=+  ..           |
|oo....           |
|+oo.  o .        |
|+oo    + .       |
|++ . E  S        |
|+   o            |
| .   .           |
|  ...            |
|  .oo.           |
+-----------------+
16:07:18
#sh-keygen
                      root@192.168.13.2
Enter passphrase for key '/root/.ssh/id_rsa':
16:07:23
#eval `ssh-agent`
Agent pid 15134
16:07:41
#ssh-add
Enter passphrase for /root/.ssh/id_rsa:
Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa)
16:07:52
#sh root@192.168.13.2

16:07:52
#sh root@192.168.13.2
Linux debian2 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 17:06:36 2013 from net.nt
l3-agent is already running: pid=1207; pidfile=/root/.lilalo/l3-agent.pid
root@debian2:~# exit
logout
Connection to 192.168.13.2 closed.
16:08:01
#ssh root@192.168.13.2
Linux debian2 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 17:07:58 2013 from net.nt
l3-agent is already running: pid=1207; pidfile=/root/.lilalo/l3-agent.pid
root@debian2:~# exit
logout
Connection to 192.168.13.2 closed.
16:08:04
#ssh-agent -l
ssh-agent: illegal option -- l
usage: ssh-agent [options] [command [arg ...]]
Options:
  -c          Generate C-shell commands on stdout.
  -s          Generate Bourne shell commands on stdout.
  -k          Kill the current agent.
  -d          Debug mode.
  -a socket   Bind agent socket to given name.
  -t life     Default identity lifetime (seconds).
16:08:10
#ssh-add -l
2048 e1:30:90:a2:d2:0a:5c:02:29:11:bb:96:fe:6b:4f:70 /root/.ssh/id_rsa (RSA)
16:08:14
#killall -9 ssh-agent

16:09:16
#sh-keygen

16:09:16
#sh root@192.168.13.2
                  man scp
SCP(1)                    BSD General Commands Manual                   SCP(1)
NAME
     scp — secure copy (remote file copy program)
SYNOPSIS
     scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
         [-l limit] [-o ssh_option] [-P port] [-S program]
         [[user@]host1:]file1 ... [[user@]host2:]file2
DESCRIPTION
     scp copies files between hosts on a network.  It uses ssh(1) for data
     transfer, and uses the same authentication and provides the same security
     as ssh(1).  Unlike rcp(1), scp will ask for passwords or passphrases if
     they are needed for authentication.
     File names may contain a user and host specification to indicate that the
     file is to be copied to/from that host.  Local file names can be made
     explicit using absolute or relative pathnames to avoid scp treating file
     names containing ‘:’ as host specifiers.  Copies between two remote hosts
     are also permitted.
     The options are as follows:
16:13:51
#scp /etc/passwd root@192.168.13.2:/tmp
Enter passphrase for key '/root/.ssh/id_rsa':
passwd                                        100%  994     1.0KB/s   00:00
16:14:58
#scp -rp root@192.168.13.1:/etc /tmp
root@192.168.13.1's password:
inittab                                       100% 2008     2.0KB/s   00:00
profile                                       100%  823     0.8KB/s   00:00
securetty                                     100% 3828     3.7KB/s   00:00
l3config.pm                                   100% 5830     5.7KB/s   00:00
anacron                                       100%  753     0.7KB/s   00:00
catalog.old                                   100%  335     0.3KB/s   00:00
xml-core.cat                                  100%  391     0.4KB/s   00:00
catalog                                       100%  366     0.4KB/s   00:00
xnetd.conf                                    100% 1276     1.3KB/s   00:00
...
mountnfs                                      100% 4581     4.5KB/s   00:00
openssh-server                                100%  849     0.8KB/s   00:00
interfaces                                    100%  507     0.5KB/s   00:00
ifstate                                       100%   26     0.0KB/s   00:00
gprs                                          100%  950     0.9KB/s   00:00
provider                                      100%  656     0.6KB/s   00:00
pap                                           100%  653     0.6KB/s   00:00
deluser.conf                                  100%  600     0.6KB/s   00:00
crontab                                       100%  724     0.7KB/s   00:00
nsswitch.conf                                 100%  475     0.5KB/s   00:00
16:17:26
#ssh -R 88888:localhost:22 root@195.182.202.50
Bad remote forwarding specification '88888:localhost:22'
прошло 14 минут
16:32:22
#ssh -R 65000:localhost:22 root@195.182.202.50
root@195.182.202.50's password:
16:32:42
#ssh -R 65000:localhost:22 root@195.182.202.50 -f -N
root@195.182.202.50's password:
16:32:50
#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:03 sshd: root@pts/0
root     13008  0.0  0.5   8448  2844 ?        Ss   Jun10   0:03 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     15300  0.0  0.1   5044   588 ?        Ss   17:32   0:00 ssh -R 65000:localhost:22 root@195.182.202.50 -f -N
root     15309  0.0  0.1   5080   736 pts/2    S+   17:32   0:00 grep ssh
16:32:54
#ssh root@192.168.13.253
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 16:47:01 2013 from 192.168.13.3
fobos:~#
fobos:~#
fobos:~#
fobos:~# ssh -R 65001:localhost:22 root@195.182.202.50 -f -N
root@195.182.202.50's password:
fobos:~# exit
logout
Connection to 192.168.13.253 closed.
16:36:24
#scp root@195.182.202.50:/etc/xinetd.d/redirect /etc/xinetd.d/
root@195.182.202.50's password:
redirect                                      100%  212     0.2KB/s   00:00
16:40:23
#vim /etc/xinetd.d/redirect
--- /tmp/l3-saved-27042.24918.31999	2013-06-11 17:40:34.000000000 +0300
+++ /etc/xinetd.d/redirect	2013-06-11 17:41:21.000000000 +0300
@@ -6,7 +6,6 @@
    protocol = tcp
    wait    = no
    user    = root
-   port    = 8888
-   access_times = 09:00-18:00
-   redirect = 10.0.0.2 3389
+   port    = 8080 
+   redirect = 127.0.0.1 44455
 }
16:41:21
#/etc/init.d/xinetd restart
Stopping internet superserver: xinetd.
Starting internet superserver: xinetd.
16:41:32
#netstat -nlp|less
16:41:45
#ssh -D 44455 root@195.182.202.50
root@195.182.202.50's password:
16:42:09
#ssh -D 44455 root@195.182.202.50 -f -N
root@195.182.202.50's password:
16:42:16
#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:03 sshd: root@pts/0
root     13008  0.0  0.5   8448  2844 ?        Ss   Jun10   0:03 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     15300  0.0  0.1   5044   984 ?        Ss   17:32   0:00 ssh -R 65000:localhost:22 root@195.182.202.50 -f -N
root     15465  0.0  0.0   5044   424 ?        Ss   17:42   0:00 ssh -D 44455 root@195.182.202.50 -f -N
root     15474  0.0  0.1   5080   736 pts/2    S+   17:42   0:00 grep ssh
16:50:25
#vim /etc/xinetd.d/redirect
--- /tmp/l3-saved-27042.22772.12395	2013-06-11 17:52:08.000000000 +0300
+++ /etc/xinetd.d/redirect	2013-06-11 17:52:24.000000000 +0300
@@ -6,6 +6,6 @@
    protocol = tcp
    wait    = no
    user    = root
-   port    = 8080 
+   port    = 3389 
    redirect = 127.0.0.1 44455
 }
/dev/pts/1
16:54:27
#netstat -nlp|less
16:54:35
#/etc/init.d/xinetd stop
Stopping internet superserver: xinetd.
16:54:49
#ssh -D 44455 root@195.182.202.50 -f -N
root@195.182.202.50's password:
Permission denied, please try again.
root@195.182.202.50's password:
Permission denied, please try again.
root@195.182.202.50's password:
16:55:38
#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:03 sshd: root@pts/0
root     13008  0.0  0.5   8448  2844 ?        Ss   Jun10   0:03 sshd: root@pts/4
root     14772  0.0  0.1   5548   944 ?        Ss   16:54   0:00 /usr/sbin/sshd
root     15814  0.0  0.0   5044   424 ?        Ss   17:55   0:00 ssh -D 44455 root@195.182.202.50 -f -N
root     15823  0.0  0.1   5080   740 pts/2    S+   17:55   0:00 grep ssh
16:55:43
#/etc/init.d/xinetd start
Starting internet superserver: xinetd.
16:55:50
#netstat -nlp|less

Среда (06/12/13)

/dev/pts/1
08:51:22
#alias exit='echo no exit'

08:58:22
#chkconfig --list
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:on   3:on   4:on   5:on   6:off
bootlogd                  0:off  1:off  2:off  3:off  4:off  5:off  6:off  S:on
bootlogs                  0:off  1:on   2:on   3:on   4:on   5:on   6:off
bootmisc.sh               0:off  1:off  2:off  3:off  4:off  5:off  6:off  S:on
checkfs.sh                0:off  1:off  2:off  3:off  4:off  5:off  6:off  S:on
checkroot.sh              0:off  1:off  2:off  3:off  4:off  5:off  6:off  S:on
console-setup             0:off  1:off  2:off  3:off  4:off  5:off  6:off  S:on
cron                      0:off  1:off  2:on   3:on   4:on   5:on   6:off
...
urandom                   0:off  1:off  2:off  3:off  4:off  5:off  6:off  S:on
x11-common                0:off  1:off  2:off  3:off  4:off  5:off  6:off  S:on
xinetd                    0:off  1:off  2:on   3:on   4:on   5:on   6:off
xinetd based services:
        chargen:            off
        daytime:            off
        discard:            off
        echo:               off
        redirect:           on
        time:               off
08:58:47
#chkconfig --list|less
08:59:24
#chkconfig --list|less
08:59:46
#chkconfig --list|less
09:00:24
#chkconfig ssh off

09:00:30
#chkconfig ssh 2

09:00:32
#chkconfig --list|less
09:00:40
#chkconfig ssh off

09:02:00
#ls /etc/rc2.d/*ssh
ls: невозможно получить доступ к /etc/rc2.d/*ssh: Нет такого файла или каталога
09:02:10
#ls /etc/rc2.d/*sshd
ls: невозможно получить доступ к /etc/rc2.d/*sshd: Нет такого файла или каталога
09:02:14
#ls /etc/rc2.d/*sshd*
ls: невозможно получить доступ к /etc/rc2.d/*sshd*: Нет такого файла или каталога
09:02:16
#ls /etc/rc2.d/*ssh*
ls: невозможно получить доступ к /etc/rc2.d/*ssh*: Нет такого файла или каталога
09:02:18
#ls /etc/rc2.d/
README         S18rsyslog  S19atd            S19xinetd     S22stop-bootlogd
S15portmap     S18sudo     S19cron           S21bootlogs
S16nfs-common  S19acpid    S19exim4          S22rc.local
S18netdiag     S19anacron  S19openbsd-inetd  S22rmnologin
09:02:24
#chkconfig ssh 2

09:02:33
#ls /etc/rc2.d/
README         S18rsyslog  S19atd            S19ssh       S22rmnologin
S15portmap     S18sudo     S19cron           S19xinetd    S22stop-bootlogd
S16nfs-common  S19acpid    S19exim4          S21bootlogs
S18netdiag     S19anacron  S19openbsd-inetd  S22rc.local
09:02:35
#chkconfig ssh off

09:02:44
#chkconfig ssh 35

09:02:49
#chkconfig --list|less
09:05:04
#chkconfig ssh off

09:05:29
#ls /etc/rc2.d/
README         S18rsyslog  S19atd            S19xinetd     S22stop-bootlogd
S15portmap     S18sudo     S19cron           S21bootlogs
S16nfs-common  S19acpid    S19exim4          S22rc.local
S18netdiag     S19anacron  S19openbsd-inetd  S22rmnologin
09:05:31
#chkconfig ssh on

09:05:37
#ls /etc/rc2.d/
README         S18rsyslog  S19atd            S19ssh       S22rmnologin
S15portmap     S18sudo     S19cron           S19xinetd    S22stop-bootlogd
S16nfs-common  S19acpid    S19exim4          S21bootlogs
S18netdiag     S19anacron  S19openbsd-inetd  S22rc.local
09:05:39
#ln -s /etc/rc2.d/K22ssh /etc/init.d/ssh
ln: создание символьной ссылки «/etc/init.d/ssh»: Файл существует
09:06:12
#ln -s /etc/init.d/ssh /etc/rc2.d/K19ssh

09:06:55
#ssh root@192.168.13.25
Password:
Last login: Mon Jun 10 17:33:59 2013 from net.nt
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
        The Regents of the University of California.  All rights reserved.
FreeBSD 8.2-RELEASE (GENERIC) #0: Fri Feb 18 02:24:46 UTC 2011
Welcome to FreeBSD!
Before seeking technical support, please use the following resources:
o  Security advisories and updated errata information for all releases are
   at http://www.FreeBSD.org/releases/ - always consult the ERRATA section
   for your release first as it's updated frequently.
...
     -k dir        Set the skeleton directory, from which basic startup and
                   configuration files are copied when the user's home direc-
                   tory is created.  This option only has meaning when used
                   with the -d or -m flags.
     -s shell      Set or changes the user's login shell to shell.  If the
[root@freebsd5 ~]# sysinstall
acpi0_check: nexus0 attached
[root@freebsd5 ~]# exit
logout
Connection to 192.168.13.25 closed.
09:10:19
#ssh root@192.168.13.3
The authenticity of host '192.168.13.3 (192.168.13.3)' 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)? Host key verification failed.
прошло 12 минут
09:23:17
#ssh root@192.168.13.2
Enter passphrase for key '/root/.ssh/id_rsa':
Linux debian2 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: Wed Jun 12 10:21:49 2013 from fobos.net.nt
l3-agent is already running: pid=1207; pidfile=/root/.lilalo/l3-agent.pid
root@debian2:~# exit
logout
Connection to 192.168.13.2 closed.
09:23:25
#ssh root@192.168.13.1
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
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jun 12 09:57:04 2013 from 192.168.17.102
l3-agent is already running: pid=1197; pidfile=/root/.lilalo/l3-agent.pid
root@debian1:~# iptables -L
...
#
# If you're going to protect the portmapper use the name "portmap" for the
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper, as well as for
# rpc.mountd (the NFS mount daemon). See portmap(8) and rpc.mountd(8)
# for further information.
#
root@debian1:~# exit
logout
Connection to 192.168.13.1 closed.
09:23:45
#ssh root@192.168.13.2
Enter passphrase for key '/root/.ssh/id_rsa':
Linux debian2 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: Wed Jun 12 10:23:23 2013 from net.nt
l3-agent is already running: pid=1207; pidfile=/root/.lilalo/l3-agent.pid
root@debian2:~# ssh root@192.168.13.1
...
root@192.168.13.1's password:
ys2t@debian2:~# scp .ssh/identity.pub root@192.168.13.1:/root/.ssh/authorized_key
root@192.168.13.1's password:
identity.pub                                  100%  642     0.6KB/s   00:00
                 sh root@192.168.13.1 rm .ssh/authorized*
ys2t@debian2:~# scp .ssh/identity.pub
root@192.168.13.1's password:
root@debian2:~# exit
logout
Connection to 192.168.13.2 closed.
прошло 28 минут
09:52:29
#export
declare -x HOME="/root"
declare -x L3_HOME="/root/.lilalo/"
declare -x L3_PARENT_TTY="/dev/pts/1"
declare -x L3_SESSION_ID="3201015386270426442-1371019882"
declare -x L3_TAMPERED_EDITORS=" vi vim pico nano"
declare -x LANG="ru_RU.UTF-8"
declare -x LANGUAGE="ru_UA:ru"
declare -x LOGNAME="root"
declare -x MAIL="/var/mail/root"
declare -x OLDPWD
declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
09:52:32
#ssh-
ssh-add      ssh-argv0    ssh-keygen   ssh-vulnkey
ssh-agent    ssh-copy-id  ssh-keyscan
09:52:32
#eval $(ssh-agent)
Agent pid 16712
09:55:24
#ssh-add
Enter passphrase for /root/.ssh/id_rsa:
Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa)
09:55:30
#man eval
09:55:49
#. /etc/bash_completion

прошло 42 минуты
10:38:35
#apt-get install isc-dhcp-
isc-dhcp-client       isc-dhcp-dev          isc-dhcp-server
isc-dhcp-client-dbg   isc-dhcp-relay        isc-dhcp-server-dbg
isc-dhcp-common       isc-dhcp-relay-dbg    isc-dhcp-server-ldap
10:38:35
#apt-get install isc-dhcp-server
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Предлагаемые пакеты:
  isc-dhcp-server-ldap
НОВЫЕ пакеты, которые будут установлены:
  isc-dhcp-server
обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено.
Необходимо скачать 378 kБ архивов.
После данной операции, объём занятого дискового пространства возрастёт на 889 kB.
Ош  http://security.debian.org/ squeeze/updates/main isc-dhcp-server i386 4.1.1-P1-15+squeeze6
  404  Not Found [IP: 212.211.132.32 80]
Не удалось получить http://security.debian.org/pool/updates/main/i/isc-dhcp/isc-dhcp-server_4.1.1-P1-15+squeeze6_i386.deb  404  Not Found [IP: 212.211.132.32 80]
E: Невозможно получить некоторые архивы, вероятно надо запустить apt-get update или попытаться повторить запуск с ключом --fix-missing
10:39:54
#apt-get update
Получено:1 http://security.debian.org squeeze/updates Release.gpg [836 B]
Игн http://security.debian.org/ squeeze/updates/contrib Translation-en
Игн http://security.debian.org/ squeeze/updates/contrib Translation-ru
Игн http://security.debian.org/ squeeze/updates/main Translation-en
Игн http://security.debian.org/ squeeze/updates/main Translation-ru
Игн http://security.debian.org/ squeeze/updates/non-free Translation-en
Игн http://security.debian.org/ squeeze/updates/non-free Translation-ru
Получено:2 http://ftp.ua.debian.org squeeze Release.gpg [1 672 B]
Игн http://ftp.ua.debian.org/debian/ squeeze/contrib Translation-en
Игн http://ftp.ua.debian.org/debian/ squeeze/contrib Translation-ru
...
Получено:21 http://ftp.ua.debian.org squeeze-updates/non-free Sources [14 B]
Получено:22 http://ftp.ua.debian.org squeeze-updates/main i386 Packages/DiffIndex [3 265 B]
Получено:23 http://ftp.ua.debian.org squeeze-updates/contrib i386 Packages [14 B]
Получено:24 http://ftp.ua.debian.org squeeze-updates/non-free i386 Packages [14 B]
Получено:25 http://ftp.ua.debian.org squeeze-updates/main Sources [2 108 B]
Получено:26 http://ftp.ua.debian.org squeeze-updates/main i386 Packages [4 654 B]
Получено 12,1 MБ за 9с (1 237 kБ/c)
Чтение списков пакетов... Готово
W: Недоступен открытый ключ для следующих ID ключей:
8B48AD6246925553
10:40:13
#apt-get install isc-dhcp-server
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Будут установлены следующие дополнительные пакеты:
  isc-dhcp-client isc-dhcp-common
Предлагаемые пакеты:
  resolvconf avahi-autoipd isc-dhcp-server-ldap
НОВЫЕ пакеты, которые будут установлены:
  isc-dhcp-server
Пакеты, которые будут обновлены:
...
Выбор ранее не выбранного пакета isc-dhcp-server.
Распаковывается пакет isc-dhcp-server (из файла .../isc-dhcp-server_4.1.1-P1-15+squeeze8_i386.deb)...
Обрабатываются триггеры для man-db ...
Настраивается пакет isc-dhcp-common (4.1.1-P1-15+squeeze8) ...
Настраивается пакет isc-dhcp-client (4.1.1-P1-15+squeeze8) ...
Настраивается пакет isc-dhcp-server (4.1.1-P1-15+squeeze8) ...
Generating /etc/default/isc-dhcp-server...
Starting ISC DHCP server: dhcpdcheck syslog for diagnostics. ... failed!
 failed!
invoke-rc.d: initscript isc-dhcp-server, action "start" failed.
10:40:29
#vim /etc/default/isc-dhcp-server
--- /tmp/l3-saved-16244.10258.26884	2013-06-12 11:41:02.000000000 +0300
+++ /etc/default/isc-dhcp-server	2013-06-12 11:41:11.000000000 +0300
@@ -8,4 +8,4 @@
 
 # On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
 #	Separate multiple interfaces with spaces, e.g. "eth0 eth1".
-INTERFACES=""
+INTERFACES="eho0"
10:41:25
#tail -f /var/log/syslog
Jun 12 11:41:22 debian3 dhcpd: Wrote 0 leases to leases file.
Jun 12 11:41:23 debian3 dhcpd:
Jun 12 11:41:23 debian3 dhcpd: No subnet declaration for eho0 (no IPv4 addresses).
Jun 12 11:41:23 debian3 dhcpd: ** Ignoring requests on eho0.  If this is not what
Jun 12 11:41:23 debian3 dhcpd:    you want, please write a subnet declaration
Jun 12 11:41:23 debian3 dhcpd:    in your dhcpd.conf file for the network segment
Jun 12 11:41:23 debian3 dhcpd:    to which interface eho0 is attached. **
Jun 12 11:41:23 debian3 dhcpd:
Jun 12 11:41:23 debian3 dhcpd:
Jun 12 11:41:23 debian3 dhcpd: Not configured to listen on any interfaces!
^C
10:41:47
#vim /etc/dhcp/dhcpd.conf
--- /tmp/l3-saved-16244.17548.25223	2013-06-12 11:42:00.000000000 +0300
+++ /etc/dhcp/dhcpd.conf	2013-06-12 11:51:35.000000000 +0300
@@ -10,8 +10,8 @@
 ddns-update-style none;
 
 # option definitions common to all supported networks...
-option domain-name "example.org";
-option domain-name-servers ns1.example.org, ns2.example.org;
+option domain-name "net.nt";
+option domain-name-servers 192.168.13.253, 8.8.8.8;
 
 default-lease-time 600;
 max-lease-time 7200;
@@ -27,6 +27,12 @@
 # No service will be given on this subnet, but declaring it helps the 
 # DHCP server to understand the network topology.
 
+subnet 192.168.13.0 netmask 255.255.255.0 {
+	range 192.168.13.100 192.168.13.150;
+	option routers 192.168.13.253, 192.168.13.254;
+	option domain-name-servers 8.8.8.8;
+}
+
 #subnet 10.152.187.0 netmask 255.255.255.0 {
 #}
 
@@ -62,6 +68,12 @@
 # allocated dynamically (if possible), but the host-specific information
 # will still come from the host declaration.
 
+host debian3 {
+	hardware ethernet 00:16:3e:00:00:02;
+	fixed-address 192.168.13.160;
+}
+
+
 #host passacaglia {
 #  hardware ethernet 0:0:c0:5d:bd:95;
 #  filename "vmunix.passacaglia";
прошло 10 минут
10:52:01
#ifconfig eth0
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:490223 errors:0 dropped:0 overruns:0 frame:0
          TX packets:835976 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:350113662 (333.8 MiB)  TX bytes:2599844098 (2.4 GiB)
          Interrupt:72
10:52:05
#vim /etc/default/isc-dhcp-server
--- /tmp/l3-saved-16244.14575.26915	2013-06-12 11:52:13.000000000 +0300
+++ /etc/default/isc-dhcp-server	2013-06-12 11:52:22.000000000 +0300
@@ -8,4 +8,4 @@
 
 # On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
 #	Separate multiple interfaces with spaces, e.g. "eth0 eth1".
-INTERFACES="eho0"
+INTERFACES="eth0"
10:52:52
#vim /var/spool/
10:52:52
#vim /var/spool/
10:52:52
#vim /var/spool/
10:52:52
#vim /var/
10:52:52
#vim /var/cache/
10:52:52
#vim /var/

Статистика

Время первой команды журнала15:59:10 2013- 6-11
Время последней команды журнала10:52:52 2013- 6-12
Количество командных строк в журнале101
Процент команд с ненулевым кодом завершения, %12.87
Процент синтаксически неверно набранных команд, % 0.99
Суммарное время работы с терминалом *, час 2.26
Количество командных строк в единицу времени, команда/мин 0.75
Частота использования команд
ssh20|=================| 17.86%
chkconfig14|============| 12.50%
vim11|=========| 9.82%
ls10|========| 8.93%
less8|=======| 7.14%
sh6|=====| 5.36%
sh-keygen5|====| 4.46%
apt-get4|===| 3.57%
ps3|==| 2.68%
/etc/init.d/xinetd3|==| 2.68%
ssh-add3|==| 2.68%
ssh-keygen3|==| 2.68%
scp3|==| 2.68%
netstat3|==| 2.68%
grep3|==| 2.68%
eval2|=| 1.79%
ln2|=| 1.79%
ifconfig1|| 0.89%
alias1|| 0.89%
ssh-1|| 0.89%
man1|| 0.89%
export1|| 0.89%
tail1|| 0.89%
.1|| 0.89%
ssh-agent1|| 0.89%
killall1|| 0.89%
____
*) Интервалы неактивности длительностью 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$