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

Содержание

Журнал

Четверг (12/03/09)

/dev/ttypa
13:48:54
#/etc/init.d/spamassassin restart
Restarting SpamAssassin Mail Filter Daemon: No /usr/bin/perl found running; none killed.
spamd.
13:48:58
#less /var/log/daemon.log
13:49:13
#/etc/init.d/spamass-milter restart
Restarting Sendmail milter plugin for SpamAssassin: spamass-milter
13:49:30
#less /var/log/mail.
13:49:30
#less /var/log/mail.log
13:49:54
#netstat -lnp | grep :783
tcp        0      0 127.0.0.1:783           0.0.0.0:*               LISTEN     17689/spamd.pid
13:50:03
#ssh 192.168.16.1
Enter passphrase for key '/root/.ssh/id_rsa':
Last login: Thu Dec  3 14:36:53 2009 from debian13.net.nt
Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 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.
You have new mail.
l3-agent is already running: pid=1785; pidfile=/root/.lilalo/l3-agent.pid
13:52:21
#mail
Mail version 8.1.2 01/15/2001.  Type ? for help.
"/var/mail/root": 17 messages 1 new 8 unread
    1 MAILER-DAEMON@net  Thu Dec  3 12:11   68/2433  Returned mail: see transcript for details
    2 MAILER-DAEMON@aes  Thu Dec  3 12:12   70/2496  Returned mail: see transcript for details
    3 MAILER-DAEMON@net  Thu Dec  3 12:17   68/2442  Returned mail: see transcript for details
 U  4 MAILER-DAEMON@net  Thu Dec  3 12:26   66/2410  Returned mail: see transcript for details
 U  5 MAILER-DAEMON@net  Thu Dec  3 12:26   66/2410  Returned mail: see transcript for details
 U  6 MAILER-DAEMON@net  Thu Dec  3 12:30   66/2293  Returned mail: see transcript for details
    7 root@amel.net.nt   Thu Dec  3 12:40   26/951   test
 U  8 root@aes.net.nt    Thu Dec  3 12:52   29/1146  Re: test
...
X-Virus-Status: Clean
X-Spam-Flag: YES
X-Spam-Status: Yes, score=2.4 required=1.0 tests=ALL_TRUSTED,DRUGS_ERECTILE,
        LONGWORDS autolearn=no version=3.2.5
X-Spam-Level: **
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on debian13.net.nt
This is a multi-part message in MIME format.
------------=_4B17B47B.DFC571A8
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
13:52:45
#ssh 192.168.16.1
Enter passphrase for key '/root/.ssh/id_rsa':
Enter passphrase for key '/root/.ssh/id_rsa':
Last login: Thu Dec  3 14:50:26 2009 from debian13.net.nt
Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 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.
You have mail.
l3-agent is already running: pid=1785; pidfile=/root/.lilalo/l3-agent.pid
13:56:47
#mail
Mail version 8.1.2 01/15/2001.  Type ? for help.
"/var/mail/root": 19 messages 3 new 10 unread
    1 MAILER-DAEMON@net  Thu Dec  3 12:11   68/2433  Returned mail: see transcript for details
    2 MAILER-DAEMON@aes  Thu Dec  3 12:12   70/2496  Returned mail: see transcript for details
    3 MAILER-DAEMON@net  Thu Dec  3 12:17   68/2442  Returned mail: see transcript for details
 U  4 MAILER-DAEMON@net  Thu Dec  3 12:26   66/2410  Returned mail: see transcript for details
 U  5 MAILER-DAEMON@net  Thu Dec  3 12:26   66/2410  Returned mail: see transcript for details
 U  6 MAILER-DAEMON@net  Thu Dec  3 12:30   66/2293  Returned mail: see transcript for details
    7 root@amel.net.nt   Thu Dec  3 12:40   26/951   test
 U  8 root@aes.net.nt    Thu Dec  3 12:52   29/1146  Re: test
...
This is a multi-part message in MIME format.
------------=_4B17B58B.29C340B6
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
&
At EOF
& q
New mail has arrived.
Saved 3 messages in /root/mbox
Held 16 messages in /var/mail/root
13:57:11
#mutt
-1.4 ALL_TRUSTED            Passed through trusted hosts only via SMTP
   2     Dec 03 Mail Delivery S (  47) Returned mail: see transcript for details
 2.9 TVD_SPACE_RATIO        BODY: TVD_SPACE_RATIO
   3     Dec 03 Mail Delivery S (  49) Returned mail: see transcript for details
                                (   1) test
   4 O   Dec 03 Mail Delivery S (  49) Returned mail: see transcript for details
   8 O   Dec 03 root            (   1) 123245
   5 O   Dec 03 Mail Delivery S (  49) Returned mail: see transcript for details
  10 O   Dec 03 Mail Delivery S (  39) Returned mail: see transcript for details
   6 O   Dec 03 Mail Deliver    (   1) Re: Cherep hello               or details
...
  14     Dec 03 MAILER-DAEMON@n (   3) Virus intercepted
  15     Dec 03 MAILER-DAEMON@n (   8) Virus intercepted
  16     Dec 03 MAILER-DAEMON@n (   3) Virus intercepted
  17     Dec 03 root            (  57) *****SPAM***** privet
X-Envelope-From: <root@js.net.nt>
                                    3) Virus intercepted
X-Envelope-To: <root@net.nt>
                                (  57) *****SPAM***** privet
                                    *****SPAM***** privet                                                                   -- (76%)
Оставлено: 17, удалено: 0.
13:57:25
#mail
Mail version 8.1.2 01/15/2001.  Type ? for help.
"/var/mail/root": 17 messages 7 unread
    1 MAILER-DAEMON@net  Thu Dec  3 12:11   68/2433  Returned mail: see transcript for details
    2 MAILER-DAEMON@aes  Thu Dec  3 12:12   70/2496  Returned mail: see transcript for details
    3 MAILER-DAEMON@net  Thu Dec  3 12:17   68/2442  Returned mail: see transcript for details
>U  4 MAILER-DAEMON@net  Thu Dec  3 12:26   66/2410  Returned mail: see transcript for details
 U  5 MAILER-DAEMON@net  Thu Dec  3 12:26   66/2410  Returned mail: see transcript for details
 U  6 MAILER-DAEMON@net  Thu Dec  3 12:30   66/2293  Returned mail: see transcript for details
    7 root@amel.net.nt   Thu Dec  3 12:40   26/951   test
 U  8 root@aes.net.nt    Thu Dec  3 12:52   29/1146  Re: test
...
X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on debian13.net.nt
X-Virus-Status: Clean
X-Spam-Flag: YES
X-Spam-Status: Yes, score=1.5 required=1.0 tests=ALL_TRUSTED,TVD_SPACE_RATIO
        autolearn=no version=3.2.5
X-Spam-Level: *
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on debian13.net.nt
Content-Length: 1963
Lines: 57
This is a multi-part message in MIME format.
13:57:45
#mutt --help
mutt: неверный ключ -- -
Mutt 1.5.18 (2008-05-17)
запуск: mutt [<options>] [-z] [-f <file> | -yZ]
        mutt [<options>] [-x] [-Hi <file>] [-s <subj>] [-bc <addr>] [-a <file> [...]] [--] <addr> [...]
        mutt [<options>] -p
        mutt [<options>] -A <alias> [...]
        mutt [<options>] -Q <query> [...]
        mutt [<options>] -D
        mutt -v[v]
параметры:
...
  -R            открыть почтовый ящик в режиме "только для чтения"
  -s <тема> указать тему сообщения (должна быть в кавычках, если присутствуют пробелы)
  -v            вывести номер версии и параметры компиляции
  -x            эмулировать режим посылки команды mailx
  -y            выбрать почтовый ящик из списка `mailboxes'
  -z            выйти немедленно если в почтовом ящике отсутствует новая почта
  -Z            открыть первый почтовый ящик с новой почтой, выйти немедленно если таковая отсутствует
  -h            текст этой подсказки
  --            считать аргументы адресами, даже если они начинаются со знака '-'
                необходимо применение при использовании -a с несколькими файлами
13:57:54
#mutt --help | less
13:58:45
#mutt
Date: MAILER-DAEMON@net.nt  :48 +0200
Message-Id: <1259845068.22143.31.camel@debian1.aes.net.nt>
To: postmaster@net.nt
X-Mailer: Evolution 2.6.3                                                S
Ccntent-Transfer-Encoding: 7bit
X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on debian13.net.nt
Auto-Submitted: auto-submitted (antivirus notify)         Bil016692
T   - 17/17: user             11    *****SPAM*****                                                                          -- (25%)
X-Infected-Received-From: debian1.aes.net.nt [192.168.16.1]
Новая почта в эÑ11¾Ð¼ ящике.   ...
...
  16     Dec 03 MAILER-DAEMON@n (   3) Virus intercepted
  17     Dec 03 user            (  62) *****SPAM*****
  18 N   Dec 03 root            (  59) *****SPAM***** work
yes prishlo
 *-Mutt: /var/mail/root [Msgs:18 New:1 Old:3 Post:1 30K]---(threads/date)---------------------------------------------------(all)---
Оставлено: 18, удалено: 0.
You have mail in /var/mail/root
       4                                                                                                                        86%
Auto-Submitted: auto-generated (failure)
    - 11
/dev/ttype
14:00:02
#screen -x
/dev/ttyp2
14:00:02
#screen -x
/dev/ttyp4
14:00:02
#screen -x
/dev/ttyp6
14:00:04
#screen
/dev/ttyp1
14:00:04
#screen
/dev/ttyp8
14:00:05
#screen -x
/dev/ttype
14:00:15
#screen -x
/dev/ttypa
14:00:24
#mutt
   4 O   Dec 03 Mail Delivery S (  49) Returned mail: see transcript for details
   5 O   Dec 03 Mail Delivery S (  49) Returned mail: see transcript for details
   6 O   Dec 03 Mail Delivery S (  49) Returned mail: see transcript for details
   7     Dec 03 root            (   1) test
   8     Dec 03 root            (   3) └*>
   9     Dec 03 root            (   1) 123245
  10     Dec 03 Mail Delivery S (  39) Returned mail: see transcript for details
  11     Dec 03 root            (   1) Re: hello
  12     Dec 03 root            (   1) Re: Cherep hello
  13     Dec 03 MAILER-DAEMON@n (   3) Virus intercepted
  14     Dec 03 MAILER-DAEMON@n (   3) Virus intercepted
  15     Dec 03 MAILER-DAEMON@n (   8) Virus intercepted
  16     Dec 03 MAILER-DAEMON@n (   3) Virus intercepted
  17     Dec 03 user            (  62) *****SPAM*****
  18     Dec 03 root            (  59) *****SPAM***** work
[-- ТÐ7/18: userplain, кодировка: 8bit, размер: 0,8K --]
 *-Mutt: /var/mail/root [Msgs:18 Old:3 Post:1 31K]---(threads/date)-----------------------(all)---
Оставлено: 3, перемещено: 15, удалено: 15.
14:01:37
#mutt
   2 O   Dec 03 Mail Delivery S (  49) Returned mail: see transcript for details
   3 O   Dec 03 Mail Delivery S (  49) Returned mail: see transcript for details
Почтовый ящик не изменился.
14:01:44
#vim /etc/spamassassin/
--- /tmp/l3-saved-18143.28409.23573	2009-12-03 15:02:02.000000000 +0200
+++ /etc/spamassassin/local.cf	2009-12-03 15:02:09.000000000 +0200
@@ -31,7 +31,7 @@
 
 #   Set the threshold at which a message is considered spam (default: 5.0)
 #
-required_score 1.0
+required_score 5.0
 
 
 #   Use Bayesian classifier (default: 1)
14:01:44
#vim /etc/spamassassin/local.cf
14:02:10
#/etc/init.d/spamassassin restart
Restarting SpamAssassin Mail Filter Daemon: spamd.
14:02:30
#apt-cache sent

прошло 16 минут
14:19:01
#ls
1234  Mail  mbox  nohup.out  postponed  sent
14:19:02
#. /etc/bash_completion

14:19:08
#apt-cache search squid
adzapper - proxy advertisement zapper add-on
biosquid-dev - headers and static library for biological sequence analysis
ccze - A robust, modular log coloriser
dansguardian - Web content filtering
frox - Transparent caching ftp proxy
gadmin-squid - GTK+ configuration tool for squid
gadmin-squid-dbg - GTK+ configuration tool for squid (debug)
gadmin-tools - GTK+ server administration tools
havp - HTTP Anti Virus Proxy
jesred - A redirector for the Squid proxy
...
srg - Fast, Flexible and Detailed log analysis for the Squid Proxy
tinyproxy - A lightweight, non-caching, optionally anonymizing http proxy
varnish - A state-of-the-art, high-performance HTTP accelerator
zope-cachefu - suite of Zope products for speeding up Plone
sarg - генератор отчётов о работе squid
squid3 - полнофункциональный веб прокси кэш (HTTP-прокси)
squid - кэширующий www-proxy-сервер
biosquid - утилиты для анализа биологических последовательностей
calamaris - анализатор протоколов прокси серверов Squid и Oops
awffull - анализатор журналов веб-сервера
14:19:26
#apt-cache search squid gadmin
gadmin-squid - GTK+ configuration tool for squid
gadmin-squid-dbg - GTK+ configuration tool for squid (debug)
gadmin-tools - GTK+ server administration tools
14:20:37
#apt-get install squid3
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Будут установлены следующие дополнительные пакеты:
  squid3-common
Предлагаемые пакеты:
  squidclient squid3-cgi resolvconf smbclient
НОВЫЕ пакеты, которые будут установлены:
  squid3 squid3-common
обновлено 0, установлено 2 новых пакетов, для удаления отмечено 0 пакетов, и 252 пакетов не обновлено.
...
2009/12/03 15:21:38| Making directories in /var/spool/squid3/07
2009/12/03 15:21:38| Making directories in /var/spool/squid3/08
2009/12/03 15:21:38| Making directories in /var/spool/squid3/09
2009/12/03 15:21:38| Making directories in /var/spool/squid3/0A
2009/12/03 15:21:38| Making directories in /var/spool/squid3/0B
2009/12/03 15:21:38| Making directories in /var/spool/squid3/0C
2009/12/03 15:21:38| Making directories in /var/spool/squid3/0D
2009/12/03 15:21:38| Making directories in /var/spool/squid3/0E
2009/12/03 15:21:38| Making directories in /var/spool/squid3/0F
Restarting Squid HTTP Proxy 3.0: squid3.
14:21:48
#grep 3128 /etc/services

14:22:30
#vim /etc/services
14:23:07
#Subversion protocol

14:23:09
#netstat -lnp | less
14:23:18
#netstat -lnp | grep squid
tcp        0      0 0.0.0.0:3128            0.0.0.0:*               LISTEN     18503/(squid)
udp        0      0 0.0.0.0:3130            0.0.0.0:*                          18503/(squid)
udp        0      0 0.0.0.0:32846           0.0.0.0:*                          18503/(squid)
14:23:20
#grep 32846 /etc/services

14:23:42
#vim /etc/squid3/squid.conf
14:25:55
#If the memory usage (as determined by mallinfo) exceeds

14:26:24
#apropos regexp
regexp: ничего подходящего не найдено.
14:26:32
#apropos regex
regex (7)            - POSIX.2 regular expressions
14:26:34
#man regex
14:27:00
#egrep -v "^\ *$|^#.*$" /etc/squid3/squid.conf `
>
14:27:13
#egrep -v "^\ *$|^#.*$" /etc/squid3/squid.conf
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
...
htcp_access deny all
http_port 3128
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid3/access.log squid
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern (cgi-bin|\?)    0       0%      0
refresh_pattern .               0       20%     4320
icp_port 3130
coredump_dir /var/spool/squid3
14:27:15
#egrep -v "^ *$|^#.*$" /etc/squid3/squid.conf
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
...
htcp_access deny all
http_port 3128
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid3/access.log squid
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern (cgi-bin|\?)    0       0%      0
refresh_pattern .               0       20%     4320
icp_port 3130
coredump_dir /var/spool/squid3
14:28:17
#egrep -v "^ *$|^#.*$" /etc/squid3/squid.conf

14:31:01
#less /var/log/squid3/access.log
14:31:20
#grep cache_ob /etc/services

14:31:48
#vim /etc/squid3/squid.conf
14:32:13
#acl aclname ext_user_regex [-i] pattern ...
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
...
htcp_access deny all
http_port 3128
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid3/access.log squid
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern (cgi-bin|\?)    0       0%      0
refresh_pattern .               0       20%     4320
icp_port 3130
coredump_dir /var/spool/squid3
14:32:29
#less /var/log/squid3/access.log
14:32:56
#egrep -v "^ *$|^#.*$" /etc/squid3/squid.conf
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
...
htcp_access deny all
http_port 3128
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid3/access.log squid
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern (cgi-bin|\?)    0       0%      0
refresh_pattern .               0       20%     4320
icp_port 3130
coredump_dir /var/spool/squid3
14:32:58
#vim /etc/squid3/squid.conf
14:41:22
#vim /etc/squid3/squid.conf
14:42:03
#-----------------------------------------------------------------------------
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
...
htcp_access deny all
http_port 3128
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid3/access.log squid
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern (cgi-bin|\?)    0       0%      0
refresh_pattern .               0       20%     4320
icp_port 3130
coredump_dir /var/spool/squid3
14:42:28
#vim /etc/squid3/squid.conf
--- /tmp/l3-saved-18143.1561.13380	2009-12-03 15:42:43.000000000 +0200
+++ /etc/squid3/squid.conf	2009-12-03 15:44:15.000000000 +0200
@@ -646,6 +646,9 @@
 #http_access allow localnet
 http_access allow localhost
 
+acl net-nt scr 192.168.16.0/24
+http_access allow net-nt
+
 # And finally deny all other access to this proxy
 http_access deny all
 
14:44:15
#vim /etc/squid3/squid.conf
--- /tmp/l3-saved-18143.4407.9111	2009-12-03 15:44:21.000000000 +0200
+++ /etc/squid3/squid.conf	2009-12-03 15:44:33.000000000 +0200
@@ -646,7 +646,7 @@
 #http_access allow localnet
 http_access allow localhost
 
-acl net-nt scr 192.168.16.0/24
+acl net-nt src 192.168.16.0/24
 http_access allow net-nt
 
 # And finally deny all other access to this proxy
14:44:33
#squid3 -k reconfigure

14:44:39
#vim /etc/squid3/squid.conf
--- /tmp/l3-saved-18143.17523.30840	2009-12-03 15:45:10.000000000 +0200
+++ /etc/squid3/squid.conf	2009-12-03 15:46:03.000000000 +0200
@@ -271,10 +271,10 @@
 #auth_param digest nonce_garbage_interval 5 minutes
 #auth_param digest nonce_max_duration 30 minutes
 #auth_param digest nonce_max_count 50
-#auth_param basic program <uncomment and complete this line>
-#auth_param basic children 5
-#auth_param basic realm Squid proxy-caching web server
-#auth_param basic credentialsttl 2 hours
+auth_param basic program 
+auth_param basic children 5
+auth_param basic realm Squid proxy-caching web server on debian13
+auth_param basic credentialsttl 2 hours
 
 #  TAG: authenticate_cache_garbage_interval
 #	The time period between garbage collection across the username cache.
14:46:03
#dpkg -L squid3 | grep ncsa
/usr/lib/squid3/ncsa_auth
14:46:15
#vim /etc/squid3/squid.conf
--- /tmp/l3-saved-18143.24369.4258	2009-12-03 15:46:18.000000000 +0200
+++ /etc/squid3/squid.conf	2009-12-03 15:46:56.000000000 +0200
@@ -271,7 +271,7 @@
 #auth_param digest nonce_garbage_interval 5 minutes
 #auth_param digest nonce_max_duration 30 minutes
 #auth_param digest nonce_max_count 50
-auth_param basic program 
+auth_param basic program  /usr/lib/squid3/ncsa_auth /etc/squid/passwd
 auth_param basic children 5
 auth_param basic realm Squid proxy-caching web server on debian13
 auth_param basic credentialsttl 2 hours
14:47:03
#htpasswd
Usage:
        htpasswd [-cmdpsD] passwordfile username
        htpasswd -b[cmdpsD] passwordfile username password
        htpasswd -n[mdps] username
        htpasswd -nb[mdps] username password
 -c  Create a new file.
 -n  Don't update file; display results on stdout.
 -m  Force MD5 encryption of the password.
 -d  Force CRYPT encryption of the password (default).
 -p  Do not encrypt the password (plaintext).
 -s  Force SHA encryption of the password.
 -b  Use the password from the command line rather than prompting for it.
 -D  Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.
14:47:05
#htpasswd -c /etc/squid3/passwd foo
New password:
Re-type new password:
Adding password for user foo
14:47:35
#vim /etc/squid3/passwd
14:47:42
#~

14:47:44
#ln -s /etc/squid3/ /etc/squid

14:47:57
#squid3 -k reconfigure

14:48:12
#ps aux | grep squid
root     18501  0.0  0.2   6940  1624 ?        Ss   15:21   0:00 /usr/sbin/squid3 -D -YC
proxy    18503  0.0  3.4  37904 20764 ?        S    15:21   0:00 (squid) -D -YC
proxy    19163  1.4  0.0   2180   536 ?        Ss   15:48   0:00 (ncsa_auth) /etc/squid/passwd
proxy    19164  1.5  0.0   2176   536 ?        Ss   15:48   0:00 (ncsa_auth) /etc/squid/passwd
proxy    19165  1.4  0.0   2180   536 ?        Ss   15:48   0:00 (ncsa_auth) /etc/squid/passwd
proxy    19166  2.0  0.0   2176   532 ?        Ss   15:48   0:00 (ncsa_auth) /etc/squid/passwd
proxy    19167  1.5  0.0   2180   536 ?        Ss   15:48   0:00 (ncsa_auth) /etc/squid/passwd
root     19176  0.0  0.1   4728   756 ttypb    R+   15:48   0:00 grep squid
14:48:18
#vim /etc/squid3/squid.conf
--- /tmp/l3-saved-18143.22840.14087	2009-12-03 15:48:58.000000000 +0200
+++ /etc/squid3/squid.conf	2009-12-03 15:49:45.000000000 +0200
@@ -645,9 +645,9 @@
 # from where browsing should be allowed
 #http_access allow localnet
 http_access allow localhost
-
+acl password proxy_auth REQUIRED
 acl net-nt src 192.168.16.0/24
-http_access allow net-nt
+http_access allow net-nt password
 
 # And finally deny all other access to this proxy
 http_access deny all
14:49:45
#squid3 -k reconfigure

14:49:47
#foo:password

14:50:23
#htpasswd -c /etc/squid3/passwd bar
New password:
Re-type new password:
htpasswd: password verification error
14:50:44
#vim /etc/squid/squid.conf
14:51:23
#Recommended minimum configuration:

14:51:59
#~
New password:
Re-type new password:
Adding password for user bar
14:52:08
#vim /etc/squid/passwd
14:52:12
#~

14:52:13
#vim /etc/squid/squid.conf
--- /tmp/l3-saved-18143.15675.2371	2009-12-03 15:52:16.000000000 +0200
+++ /etc/squid/squid.conf	2009-12-03 16:02:42.000000000 +0200
@@ -647,6 +647,11 @@
 http_access allow localhost
 acl password proxy_auth REQUIRED
 acl net-nt src 192.168.16.0/24
+acl deny_users proxy_auth bar
+acl daytime time 08:00-15:00
+acl no_odnoklassniki url_regex -i odnoklassniki
+#http_access deny no_odnoklassniki
+http_access deny deny_users daytime
 http_access allow net-nt password
 
 # And finally deny all other access to this proxy
прошло 15 минут
15:07:27
#Recommended minimum configuration:
; <<>> DiG 9.5.1-P3 <<>> odnoklassniki.ru
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21435
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 6, ADDITIONAL: 5
;; QUESTION SECTION:
;odnoklassniki.ru.              IN      A
;; ANSWER SECTION:
odnoklassniki.ru.       2943    IN      A       212.44.136.194
odnoklassniki.ru.       2943    IN      A       212.119.216.134
...
;; ADDITIONAL SECTION:
E.DNS.RIPN.NET.         80979   IN      A       193.232.142.17
NS.RIPN.NET.            155390  IN      A       194.85.105.17
NS2.RIPN.NET.           155390  IN      A       194.226.96.30
NS5.MSK-IX.NET.         167379  IN      A       193.232.128.6
NS9.RIPN.NET.           80979   IN      A       194.85.252.62
;; Query time: 45 msec
;; SERVER: 192.168.16.254#53(192.168.16.254)
;; WHEN: Thu Dec  3 16:07:38 2009
;; MSG SIZE  rcvd: 308
15:07:38
#dig finproc.ru
; <<>> DiG 9.5.1-P3 <<>> finproc.ru
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52325
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 6, ADDITIONAL: 5
;; QUESTION SECTION:
;finproc.ru.                    IN      A
;; ANSWER SECTION:
finproc.ru.             230     IN      A       79.174.65.4
;; AUTHORITY SECTION:
...
;; ADDITIONAL SECTION:
E.DNS.RIPN.NET.         80954   IN      A       193.232.142.17
NS.RIPN.NET.            155365  IN      A       194.85.105.17
NS2.RIPN.NET.           155365  IN      A       194.226.96.30
NS5.MSK-IX.NET.         167354  IN      A       193.232.128.6
NS9.RIPN.NET.           80954   IN      A       194.85.252.62
;; Query time: 20 msec
;; SERVER: 192.168.16.254#53(192.168.16.254)
;; WHEN: Thu Dec  3 16:08:03 2009
;; MSG SIZE  rcvd: 254
15:08:03
#dig odnoklassniki.ru
; <<>> DiG 9.5.1-P3 <<>> odnoklassniki.ru
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49411
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 6, ADDITIONAL: 5
;; QUESTION SECTION:
;odnoklassniki.ru.              IN      A
;; ANSWER SECTION:
odnoklassniki.ru.       2914    IN      A       62.105.149.114
odnoklassniki.ru.       2914    IN      A       212.44.136.194
...
;; ADDITIONAL SECTION:
E.DNS.RIPN.NET.         80950   IN      A       193.232.142.17
NS.RIPN.NET.            155361  IN      A       194.85.105.17
NS2.RIPN.NET.           155361  IN      A       194.226.96.30
NS5.MSK-IX.NET.         167350  IN      A       193.232.128.6
NS9.RIPN.NET.           80950   IN      A       194.85.252.62
;; Query time: 152 msec
;; SERVER: 192.168.16.254#53(192.168.16.254)
;; WHEN: Thu Dec  3 16:08:07 2009
;; MSG SIZE  rcvd: 308
15:08:08
#vim /etc/squid/squid.conf
--- /tmp/l3-saved-18143.28149.23104	2009-12-03 16:09:14.000000000 +0200
+++ /etc/squid/squid.conf	2009-12-03 16:14:52.000000000 +0200
@@ -649,8 +649,10 @@
 acl net-nt src 192.168.16.0/24
 acl deny_users proxy_auth bar
 acl daytime time 08:00-15:00
-acl no_odnoklassniki url_regex -i odnoklassniki
+acl no_odnoklassniki rep_header Content-Type -i odnoklassniki
+#acl no_odnoklassniki url_regex -i odnoklassniki
 #http_access deny no_odnoklassniki
+http_access deny no_odnoklassniki
 http_access deny deny_users daytime
 http_access allow net-nt password
 
прошло 19 минут
15:27:12
#Recommended minimum configuration:
access.log  cache.log   store.log
15:27:12
#less /var/log/squid3/access.log
15:27:48
#nc -l 4444

15:28:36
#nc -l -p 4444
GET / HTTP/1.1
Host: 192.168.16.13:4444
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070310 Iceweasel/2.0.0.3 (Debian-2.0.0.3-1)
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;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
15:29:07
#vim /etc/squid/squid.conf
--- /tmp/l3-saved-18143.16713.28955	2009-12-03 16:34:12.000000000 +0200
+++ /etc/squid/squid.conf	2009-12-03 16:34:44.000000000 +0200
@@ -649,7 +649,7 @@
 acl net-nt src 192.168.16.0/24
 acl deny_users proxy_auth bar
 acl daytime time 08:00-15:00
-acl no_odnoklassniki rep_header Content-Type -i odnoklassniki
+acl no_odnoklassniki rep_header Server "Apache-Coyote"
 #acl no_odnoklassniki url_regex -i odnoklassniki
 #http_access deny no_odnoklassniki
 http_access deny no_odnoklassniki
15:34:45
#squid3 -k reconfigure
2009/12/03 16:34:53| strtokFile: Apache-Coyote not found
2009/12/03 16:34:53| Warning: empty ACL: acl no_odnoklassniki rep_header Server "Apache-Coyote"
15:34:54
#vim /etc/squid/squid.conf
--- /tmp/l3-saved-18143.14773.5095	2009-12-03 16:35:05.000000000 +0200
+++ /etc/squid/squid.conf	2009-12-03 16:35:28.000000000 +0200
@@ -649,7 +649,7 @@
 acl net-nt src 192.168.16.0/24
 acl deny_users proxy_auth bar
 acl daytime time 08:00-15:00
-acl no_odnoklassniki rep_header Server "Apache-Coyote"
+acl no_odnoklassniki rep_header Server "^Apache-Coyote"
 #acl no_odnoklassniki url_regex -i odnoklassniki
 #http_access deny no_odnoklassniki
 http_access deny no_odnoklassniki
15:35:28
#squid3 -k reconfigure
2009/12/03 16:35:29| strtokFile: ^Apache-Coyote not found
2009/12/03 16:35:29| Warning: empty ACL: acl no_odnoklassniki rep_header Server "^Apache-Coyote"
15:35:30
#vim /etc/squid/squid.conf
--- /tmp/l3-saved-18143.18558.32228	2009-12-03 16:35:39.000000000 +0200
+++ /etc/squid/squid.conf	2009-12-03 16:35:51.000000000 +0200
@@ -649,7 +649,7 @@
 acl net-nt src 192.168.16.0/24
 acl deny_users proxy_auth bar
 acl daytime time 08:00-15:00
-acl no_odnoklassniki rep_header Server "^Apache-Coyote"
+acl no_odnoklassniki rep_header Server ^Apache-Coyote
 #acl no_odnoklassniki url_regex -i odnoklassniki
 #http_access deny no_odnoklassniki
 http_access deny no_odnoklassniki
15:35:51
#squid3 -k reconfigure

15:35:53
#vim /etc/squid/squid.conf
--- /tmp/l3-saved-18143.18779.29218	2009-12-03 16:36:11.000000000 +0200
+++ /etc/squid/squid.conf	2009-12-03 16:36:39.000000000 +0200
@@ -649,7 +649,7 @@
 acl net-nt src 192.168.16.0/24
 acl deny_users proxy_auth bar
 acl daytime time 08:00-15:00
-acl no_odnoklassniki rep_header Server ^Apache-Coyote
+acl no_odnoklassniki rep_header Server ^Apache
 #acl no_odnoklassniki url_regex -i odnoklassniki
 #http_access deny no_odnoklassniki
 http_access deny no_odnoklassniki
15:36:39
#squid3 -k reconfigure

15:36:40
#vim /etc/squid/squid.conf
--- /tmp/l3-saved-18143.26317.19407	2009-12-03 16:39:07.000000000 +0200
+++ /etc/squid/squid.conf	2009-12-03 16:39:46.000000000 +0200
@@ -650,6 +650,7 @@
 acl deny_users proxy_auth bar
 acl daytime time 08:00-15:00
 acl no_odnoklassniki rep_header Server ^Apache
+broken_vary_encoding deny no_odnoklassniki
 #acl no_odnoklassniki url_regex -i odnoklassniki
 #http_access deny no_odnoklassniki
 http_access deny no_odnoklassniki
15:39:46
#squid3 -k reconfigure
2009/12/03 16:39:48| cache_cf.cc(346) squid.conf:653 unrecognized: 'broken_vary_encoding'
15:39:48
#vim /etc/squid/squid.conf
--- /tmp/l3-saved-18143.3492.19194	2009-12-03 16:39:51.000000000 +0200
+++ /etc/squid/squid.conf	2009-12-03 16:47:56.000000000 +0200
@@ -650,6 +650,7 @@
 acl deny_users proxy_auth bar
 acl daytime time 08:00-15:00
 acl no_odnoklassniki rep_header Server ^Apache
+acl no_odnoklassniki1 referer_header 
 broken_vary_encoding deny no_odnoklassniki
 #acl no_odnoklassniki url_regex -i odnoklassniki
 #http_access deny no_odnoklassniki
@@ -657,6 +658,8 @@
 http_access deny deny_users daytime
 http_access allow net-nt password
 
+acl dlyamudakov url_regex -i vkontakt vkontact vcontact vcontakt odnoklassniki odnoklasniki
+http_access deny dlyamudakov
 # And finally deny all other access to this proxy
 http_access deny all
 
15:47:56
#squid3 -k reconfigure
2009/12/03 16:47:58| aclParseAclLine: Invalid ACL type 'referer_header'
FATAL: Bungled squid.conf line 653: acl no_odnoklassniki1 referer_header
Squid Cache (Version 3.0.STABLE8): Terminated abnormally.
CPU Usage: 0.008 seconds = 0.000 user + 0.008 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
15:47:58
#vim /etc/squid/squid.conf
--- /tmp/l3-saved-18143.13339.1839	2009-12-03 16:48:22.000000000 +0200
+++ /etc/squid/squid.conf	2009-12-03 16:49:24.000000000 +0200
@@ -658,8 +658,8 @@
 http_access deny deny_users daytime
 http_access allow net-nt password
 
-acl dlyamudakov url_regex -i vkontakt vkontact vcontact vcontakt odnoklassniki odnoklasniki
-http_access deny dlyamudakov
+
+
 # And finally deny all other access to this proxy
 http_access deny all
 

Статистика

Время первой команды журнала13:48:54 2009-12- 3
Время последней команды журнала15:47:58 2009-12- 3
Количество командных строк в журнале101
Процент команд с ненулевым кодом завершения, %14.85
Процент синтаксически неверно набранных команд, % 0.00
Суммарное время работы с терминалом *, час 1.98
Количество командных строк в единицу времени, команда/мин 0.85
Частота использования команд
vim24|=====================| 21.43%
squid39|========| 8.04%
less8|=======| 7.14%
screen7|======| 6.25%
grep7|======| 6.25%
mutt6|=====| 5.36%
egrep5|====| 4.46%
^#.*$"5|====| 4.46%
Recommended3|==| 2.68%
mail3|==| 2.68%
netstat3|==| 2.68%
htpasswd3|==| 2.68%
~3|==| 2.68%
apt-cache3|==| 2.68%
dig2|=| 1.79%
/etc/init.d/spamassassin2|=| 1.79%
nc2|=| 1.79%
apropos2|=| 1.79%
ssh2|=| 1.79%
dpkg1|| 0.89%
ps1|| 0.89%
man1|| 0.89%
acl1|| 0.89%
.1|| 0.89%
If1|| 0.89%
apt-get1|| 0.89%
ln1|| 0.89%
-----------------------------------------------------------------------------1|| 0.89%
ls1|| 0.89%
foo:password1|| 0.89%
Subversion1|| 0.89%
/etc/init.d/spamass-milter1|| 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$