/l3/users/11-02-2013/NT-Lnet/debian1.net.nt/root :1 :2 |
|
#vim /etc/hostname
--- /tmp/l3-saved-1552.31323.9095 2013-02-14 16:49:04.000000000 +0200 +++ /etc/hostname 2013-02-14 16:49:21.000000000 +0200 @@ -1 +1 @@ -debian1 +alex |
#vim /etc/hosts
--- /tmp/l3-saved-1552.32517.19561 2013-02-14 16:50:58.000000000 +0200 +++ /etc/hosts 2013-02-14 16:51:20.000000000 +0200 @@ -1,2 +1,2 @@ 127.0.0.1 localhost.localdomain localhost -192.168.13.1 debian1.net.nt debian1 +192.168.13.1 alex.net.nt alex |
#hostname
debian1 |
#host
![]() Usage: host [-aCdlriTwv] [-c class] [-N ndots] [-t type] [-W time] [-R number] [-m flag] hostname [server] -a is equivalent to -v -t ANY -c specifies query class for non-IN data -C compares SOA records on authoritative nameservers -d is equivalent to -v -l lists all hosts in a domain, using AXFR -i IP6.INT reverse lookups -N changes the number of dots allowed before root lookup is done -r disables recursive processing -R specifies number of retries for UDP packets -s a SERVFAIL response should stop query -t specifies the query type -T enables TCP/IP mode -v enables verbose output -w specifies to wait forever for a reply -W specifies how long to wait for a reply -4 use IPv4 query transport only -6 use IPv6 query transport only -m set memory debugging flag (trace|record|usage) |
#hostname -f
![]() hostname: Name or service not known |
#hostname alex.net.nt
|
#hostname -f
alex.net.nt |
#ls
access helpfile sendmail.cf smrsh access.db local-host-names sendmail.cf.errors submit.cf address.resolve m4 sendmail.conf submit.mc aliases Makefile sendmail.mc tls aliases.db peers service.switch trusted-users databases sasl service.switch-nodns |
#vim se
![]() |
#vim sendmail.mc
|
#service send
![]() sendmail sendsigs |
#service sendmail restart
Restarting Mail Transport Agent (MTA): sendmail. |
#vim access
--- /tmp/l3-saved-1552.19026.1041 2013-02-14 16:58:18.000000000 +0200 +++ access 2013-02-14 16:59:49.000000000 +0200 @@ -97,7 +97,7 @@ #Connect:172.29 RELAY #Connect:172.30 RELAY #Connect:172.31 RELAY -#Connect:192.168 RELAY +Connect:192.168 RELAY #GreetPause:192.168 0 #ClientRate:192.168 0 #ClientConn:192.168 0 |
#vim local-host-names
--- /tmp/l3-saved-1552.6913.8019 2013-02-14 16:59:54.000000000 +0200 +++ local-host-names 2013-02-14 17:00:25.000000000 +0200 @@ -1,2 +1,2 @@ localhost -debian1.net.nt +alex.net.nt |
#vim aliases
|
#~
dnl # Dialup/LAN connection overrides dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, M=Ea, Addr=::1')) dnl DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.11 ')dnl dnl # DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl dnl DAEMON_OPT(ONS(`Family=inet6, Name=MSP-v6, Port=submis=0.0.0.0')dnl dnl define(`confPRIVACY_FLAGS',dnl `needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturnn dnl # dnl # @ `needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturnn ,authwarnings')dnl "sendmail.mc" 115L, 4296C записано FEATURE(`allmasquerade')dnl FEATURE(`masquerade_envelope')dnl ~ |
#make
Updating databases ... Reading configuration from /etc/mail/sendmail.conf. Validating configuration. Creating /etc/mail/databases... Updating auth ... sasl2-bin not installed, not configuring sendmail support. To enable sendmail SASL2 support at a later date, invoke "/usr/share/sendmail/update_auth" Creating /etc/mail/relay-domains # Optional file... Updating Makefile ... Reading configuration from /etc/mail/sendmail.conf. Validating configuration. Creating /etc/mail/Makefile... Updating sendmail.cf ... Updating access_db ... The following file(s) have changed: /etc/mail/sendmail.cf /etc/mail/local-host-names ** ** You should issue `/etc/init.d/sendmail reload` ** ** |
#/etc/init.d/sendmail restart
Restarting Mail Transport Agent (MTA): sendmail. |
#netstat -nlp | grep 25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 7332/sendmail: MTA: |
#exit
![]() exit Есть приостановленные задачи. |
#apt-get install sensible-mda
Чтение списков пакетов... Готово Построение дерева зависимостей Чтение информации о состоянии... Готово Следующие пакеты устанавливались автоматически и больше не требуются: mysql-common libperl5.10 libmysqlclient16 libpq5 Для их удаления используйте 'apt-get autoremove'. НОВЫЕ пакеты, которые будут установлены: sensible-mda обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 22 пакетов не обновлено. Необходимо скачать 215 kБ архивов. После данной операции, объём занятого дискового пространства возрастёт на 303 kB. Получено:1 http://ftp.ua.debian.org/debian/ squeeze/main sensible-mda i386 8.14.3-9.4 [215 kB] Получено 215 kБ за 0с (654 kБ/c) Выбор ранее не выбранного пакета sensible-mda. (Чтение базы данных ... на данный момент установлено 33270 файлов и каталогов.) Распаковывается пакет sensible-mda (из файла .../sensible-mda_8.14.3-9.4_i386.deb)... Обрабатываются триггеры для man-db ... Настраивается пакет sensible-mda (8.14.3-9.4) ... |
#apt-get install squid3
Чтение списков пакетов... Готово Построение дерева зависимостей Чтение информации о состоянии... Готово Следующие пакеты устанавливались автоматически и больше не требуются: mysql-common libperl5.10 libmysqlclient16 libpq5 Для их удаления используйте 'apt-get autoremove'. Будут установлены следующие дополнительные пакеты: libltdl7 squid-langpack squid3-common Предлагаемые пакеты: squidclient squid-cgi resolvconf smbclient ... Обрабатываются триггеры для man-db ... Настраивается пакет libltdl7 (2.2.6b-2) ... Настраивается пакет squid-langpack (20100628-1) ... Настраивается пакет squid3-common (3.1.6-1.2+squeeze2) ... Настраивается пакет squid3 (3.1.6-1.2+squeeze2) ... Creating Squid HTTP proxy 3.x spool directory structure 2013/02/15 11:40:20| Creating Swap Directories Restarting Squid HTTP Proxy 3.x: squid3Creating Squid HTTP Proxy 3.x cache structure ... (warning). 2013/02/15 11:40:22| Creating Swap Directories . |
#vim /etc/squid3/squid.conf
|
#cache_dir ufs /var/spool/squid3 100 16 256
итого 0 |
#ls -ld /var/spool/squid3
drwxr-xr-x 2 proxy proxy 4096 Янв 6 2012 /var/spool/squid3 |
#id proxy
uid=13(proxy) gid=13(proxy) группы=13(proxy) |
#man squid
|
#squid -z
![]() l3script: squid: команда не найдена |
#squid3 -z
2013/02/15 14:14:55| WARNING cache_mem is larger than total disk cache space! 2013/02/15 14:14:55| Squid is already running! Process ID 9200 |
#ls -l /var/spool/squid3
итого 0 |
#tail -f /var/log/messages
![]() Feb 14 15:44:02 debian1 dhcpd: For info, please visit https://www.isc.org/software/dhcp/ Feb 14 15:44:02 debian1 dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1 Feb 14 15:44:02 debian1 dhcpd: Copyright 2004-2010 Internet Systems Consortium. Feb 14 15:44:02 debian1 dhcpd: All rights reserved. Feb 14 15:44:02 debian1 dhcpd: For info, please visit https://www.isc.org/software/dhcp/ Feb 14 15:44:02 debian1 dhcpd: Wrote 0 leases to leases file. Feb 14 15:44:02 debian1 dhcpd: Feb 15 07:35:04 debian1 rsyslogd: [origin software="rsyslogd" swVersion="4.6.4" x-pid="820" x-info="http://www.rsyslog.com"] rsyslogd was HUPed, type 'lightweight'. Feb 15 07:35:05 debian1 rsyslogd: [origin software="rsyslogd" swVersion="4.6.4" x-pid="820" x-info="http://www.rsyslog.com"] rsyslogd was HUPed, type 'lightweight'. Feb 15 11:40:22 debian1 squid[9196]: Squid Parent: child process 9200 started ^C |
#tail -f /var/log/daemon.log
![]() Feb 15 12:16:44 debian1 named[4748]: dumping master file: /etc/bind/tmp-PgyRu1x7rb: open: permission denied Feb 15 12:29:45 debian1 named[4748]: dumping master file: /etc/bind/tmp-aG1FpRx4dX: open: permission denied Feb 15 12:42:35 debian1 named[4748]: dumping master file: /etc/bind/tmp-SXgcLUK8Bp: open: permission denied Feb 15 12:57:26 debian1 named[4748]: dumping master file: /etc/bind/tmp-sfeFwRSNNd: open: permission denied Feb 15 13:10:00 debian1 named[4748]: dumping master file: /etc/bind/tmp-5djzqy1kNm: open: permission denied Feb 15 13:22:26 debian1 named[4748]: dumping master file: /etc/bind/tmp-dEpWW95LN1: open: permission denied Feb 15 13:36:51 debian1 named[4748]: dumping master file: /etc/bind/tmp-kBNRUKHvUj: open: permission denied Feb 15 13:49:30 debian1 named[4748]: dumping master file: /etc/bind/tmp-fWMZzy4bGO: open: permission denied Feb 15 14:03:28 debian1 named[4748]: dumping master file: /etc/bind/tmp-Lk92VVZBzK: open: permission denied Feb 15 14:17:06 debian1 named[4748]: dumping master file: /etc/bind/tmp-MUhL5S9ZL4: open: permission denied ^C |
#squid3 -z
2013/02/15 14:20:09| WARNING cache_mem is larger than total disk cache space! 2013/02/15 14:20:09| Squid is already running! Process ID 9200 |
#/etc/init.d/squid3 stop
Stopping Squid HTTP Proxy 3.x: squid3 Waiting.....................done. . |
#access_log /var/log/squid3/access.log squid
Starting Squid HTTP Proxy 3.x: squid32013/02/15 14:32:35| WARNING cache_mem is larger than total disk cache space! . |
#datetime
![]() l3script: datetime: команда не найдена |
#date
Птн Фев 15 14:33:07 EET 2013 |
#tail -f /var/log/squid3/cache.log
![]() 2013/02/15 14:32:35| 0 Objects expired. 2013/02/15 14:32:35| 0 Objects cancelled. 2013/02/15 14:32:35| 0 Duplicate URLs purged. 2013/02/15 14:32:35| 0 Swapfile clashes avoided. 2013/02/15 14:32:35| Took 0.08 seconds ( 0.00 objects/sec). 2013/02/15 14:32:35| Beginning Validation Procedure 2013/02/15 14:32:35| Completed Validation Procedure 2013/02/15 14:32:35| Validated 25 Entries 2013/02/15 14:32:35| store_swap_size = 0 2013/02/15 14:32:36| storeLateRelease: released 0 objects :q ^C |
#ps aux| grep squi
root 9645 0.0 0.3 9364 1608 ? Ss 14:32 0:00 /usr/sbin/squid3 -YC -f /etc/squid3/squid.conf proxy 9650 0.0 2.5 37324 12868 ? S 14:32 0:00 (squid) -YC -f /etc/squid3/squid.conf root 9703 0.0 0.1 5076 732 pts/1 S+ 14:34 0:00 grep squi |
#telnet 127.0.0.1 3128
Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. ^] telnet> q Connection closed. |
#tail -f /var/log/messages
Feb 14 15:44:02 debian1 dhcpd: All rights reserved. Feb 14 15:44:02 debian1 dhcpd: For info, please visit https://www.isc.org/software/dhcp/ Feb 14 15:44:02 debian1 dhcpd: Wrote 0 leases to leases file. Feb 14 15:44:02 debian1 dhcpd: Feb 15 07:35:04 debian1 rsyslogd: [origin software="rsyslogd" swVersion="4.6.4" x-pid="820" x-info="http://www.rsyslog.com"] rsyslogd was HUPed, type 'lightweight'. Feb 15 07:35:05 debian1 rsyslogd: [origin software="rsyslogd" swVersion="4.6.4" x-pid="820" x-info="http://www.rsyslog.com"] rsyslogd was HUPed, type 'lightweight'. Feb 15 11:40:22 debian1 squid[9196]: Squid Parent: child process 9200 started Feb 15 14:21:08 debian1 squid[9196]: Squid Parent: child process 9200 exited with status 0 Feb 15 14:32:35 debian1 squid[9645]: Squid Parent: child process 9650 started Feb 15 14:43:14 debian1 squid[9645]: Squid Parent: child process 9650 exited with status 0 ^C |
#netstat -f inet
![]() netstat: неверный ключ -- «f» usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help} netstat [-vWnNcaeol] [<Socket> ...] netstat { [-vWeenNac] -i | [-cWnNe] -M | -s } -r, --route display routing table -i, --interfaces display interface table -g, --groups display multicast group memberships -s, --statistics display networking statistics (like SNMP) -M, --masquerade display masqueraded connections -v, --verbose be verbose ... -a, --all, --listening display all sockets (default: connected) -o, --timers display timers -F, --fib display Forwarding Information Base (default) -C, --cache display routing cache instead of FIB <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: inet List of possible address families (which support routing): inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) x25 (CCITT X.25) |
#netstat -nlp inet
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:7 0.0.0.0:* LISTEN 5761/xinetd tcp 0 0 0.0.0.0:54377 0.0.0.0:* LISTEN 669/rpc.statd tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 7332/sendmail: MTA: tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 657/portmap tcp 0 0 0.0.0.0:19 0.0.0.0:* LISTEN 5761/xinetd tcp 0 0 192.168.13.1:53 0.0.0.0:* LISTEN 4748/named tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 4748/named tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1158/sshd ... udp 0 0 0.0.0.0:56844 0.0.0.0:* 9898/(squid) udp 0 0 192.168.13.1:53 0.0.0.0:* 4748/named udp 0 0 127.0.0.1:53 0.0.0.0:* 4748/named udp 0 0 0.0.0.0:845 0.0.0.0:* 669/rpc.statd udp6 0 0 :::53 :::* 4748/named udp6 0 0 :::36152 :::* 9898/(squid) Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 13735 7332/sendmail: MTA: /var/run/sendmail/mta/smcontrol unix 2 [ ACC ] STREAM LISTENING 3600 855/acpid /var/run/acpid.socket |
#netstat -nlp inet
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:7 0.0.0.0:* LISTEN 5761/xinetd tcp 0 0 0.0.0.0:54377 0.0.0.0:* LISTEN 669/rpc.statd tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 7332/sendmail: MTA: tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 657/portmap tcp 0 0 0.0.0.0:19 0.0.0.0:* LISTEN 5761/xinetd tcp 0 0 192.168.13.1:53 0.0.0.0:* LISTEN 4748/named tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 4748/named tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1158/sshd ... udp 0 0 0.0.0.0:56844 0.0.0.0:* 9898/(squid) udp 0 0 192.168.13.1:53 0.0.0.0:* 4748/named udp 0 0 127.0.0.1:53 0.0.0.0:* 4748/named udp 0 0 0.0.0.0:845 0.0.0.0:* 669/rpc.statd udp6 0 0 :::53 :::* 4748/named udp6 0 0 :::36152 :::* 9898/(squid) Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 13735 7332/sendmail: MTA: /var/run/sendmail/mta/smcontrol unix 2 [ ACC ] STREAM LISTENING 3600 855/acpid /var/run/acpid.socket |
#netstat -nlp |grep squid
tcp6 0 0 :::8080 :::* LISTEN 9898/(squid) tcp6 0 0 :::3128 :::* LISTEN 9898/(squid) udp 0 0 0.0.0.0:56844 0.0.0.0:* 9898/(squid) udp6 0 0 :::36152 :::* 9898/(squid) |
#vim /etc/squid3/squid.conf
|
#%PROTO Requested protocol
# # intercept Support for IP-Layer interception of # outgoing requests without browser settings. # NP: disables authentication and IPv6 on the port. # # tproxy Support Linux TPROXY for spoofing outgoing # connections using the client IP address. # NP: disables authentication and maybe IPv6 on the port. # # accel Accelerator mode. Also needs at least one of ... # Remote surrogates (such as those in a CDN) honour Surrogate-Control: no-store-remote. # Set this to on to have squid behave as a remote surrogate. #Default: # TAG: esi_parser libxml2|expat|custom # ESI markup is not strictly XML compatible. The custom ESI parser # will give higher performance, but cannot handle non ASCII character # encodings. #Default: # esi_parser custom 3679,0-1 66% |
#apt-get install apa |