/l3/users/30-11-2009/nt-lnet/debian13.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 |
|
#/etc/init.d/spamassassin restart
Restarting SpamAssassin Mail Filter Daemon: No /usr/bin/perl found running; none killed. spamd. |
#less /var/log/daemon.log
|
#/etc/init.d/spamass-milter restart
Restarting Sendmail milter plugin for SpamAssassin: spamass-milter |
#less /var/log/mail.
![]() |
#less /var/log/mail.log
|
#netstat -lnp | grep :783
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 17689/spamd.pid |
#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 |
#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 |
#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 |
#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 |
#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. |
#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. |
#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 с несколькими файлами |
#mutt --help | less
|
#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 |
#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. |
#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 Почтовый ящик не изменился. |
#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) |
#vim /etc/spamassassin/local.cf
|
#/etc/init.d/spamassassin restart
Restarting SpamAssassin Mail Filter Daemon: spamd. |
#apt-cache sent
![]() |
#ls
1234 Mail mbox nohup.out postponed sent |
#. /etc/bash_completion
|
#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 - анализатор журналов веб-сервера |
#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 |
#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. |
#grep 3128 /etc/services
![]() |
#vim /etc/services
|
#Subversion protocol
|
#netstat -lnp | less
|
#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) |
#grep 32846 /etc/services
![]() |
#vim /etc/squid3/squid.conf
|
#If the memory usage (as determined by mallinfo) exceeds
|
#apropos regexp
![]() regexp: ничего подходящего не найдено. |
#apropos regex
regex (7) - POSIX.2 regular expressions |
#man regex
|
#egrep -v "^\ *$|^#.*$" /etc/squid3/squid.conf `
![]() > |
#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 |
#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 |
#egrep -v "^ *$|^#.*$" /etc/squid3/squid.conf
![]() |
#less /var/log/squid3/access.log
|
#grep cache_ob /etc/services
![]() |
#vim /etc/squid3/squid.conf
|
#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 |
#less /var/log/squid3/access.log
|
#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 |
#vim /etc/squid3/squid.conf
|
#vim /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 |
#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 |
#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 |
#squid3 -k reconfigure
|
#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. |
#dpkg -L squid3 | grep ncsa
/usr/lib/squid3/ncsa_auth |
#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 |
#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. |
#htpasswd -c /etc/squid3/passwd foo
New password: Re-type new password: Adding password for user foo |
#vim /etc/squid3/passwd
|
#~
|
#ln -s /etc/squid3/ /etc/squid
|
#squid3 -k reconfigure
|
#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 |
#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 |
#squid3 -k reconfigure
|
#foo:password
![]() |
#htpasswd -c /etc/squid3/passwd bar
![]() New password: Re-type new password: htpasswd: password verification error |
#vim /etc/squid/squid.conf
|
#Recommended minimum configuration:
|
#~
New password: Re-type new password: Adding password for user bar |
#vim /etc/squid/passwd
|
#~
|
#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 |
#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 |
#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 |
#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 |
#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 |
#Recommended minimum configuration:
![]() access.log cache.log store.log |
#less /var/log/squid3/access.log
|
#nc -l 4444
![]() |
#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 |
#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 |
#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" |
#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 |
#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" |
#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 |
#squid3 -k reconfigure
|
#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 |
#squid3 -k reconfigure
|
#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 |
#squid3 -k reconfigure
2009/12/03 16:39:48| cache_cf.cc(346) squid.conf:653 unrecognized: 'broken_vary_encoding' |
#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 |
#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 |
#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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008