/l3/users/10-08-2009/nt-lnet/debian1.net.nt/user :1 :2 :3 :4 :5 :6 :7 :8 |
|
$sudo iptables -t nat -L -v
|
$sudo iptables -t nat -L -v
![]() [user@debian2:~]$ ssh 192.168.16.2 ssh: connect to host 192.168.16.2 port 5555: Connection refused |
$sudo iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 1 packets, 60 bytes) pkts bytes target prot opt in out source destination 7 420 DNAT tcp -- any any 192.168.16.0/24 debian2.net.nt tcp dpt:rplay to:192.168.16.1:22 Chain POSTROUTING (policy ACCEPT 27 packets, 2021 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 27 packets, 2021 bytes) pkts bytes target prot opt in out source destination |
$sudo iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 1 packets, 60 bytes) pkts bytes target prot opt in out source destination 7 420 DNAT tcp -- any any 192.168.16.0/24 debian2.net.nt tcp dpt:rplay to:192.168.16.1:22 Chain POSTROUTING (policy ACCEPT 27 packets, 2021 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 27 packets, 2021 bytes) pkts bytes target prot opt in out source destination |
$sudo iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 1 packets, 60 bytes) pkts bytes target prot opt in out source destination 7 420 DNAT tcp -- any any 192.168.16.0/24 debian2.net.nt tcp dpt:rplay to:192.168.16.1:22 Chain POSTROUTING (policy ACCEPT 27 packets, 2021 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 27 packets, 2021 bytes) pkts bytes target prot opt in out source destination |
$sudo sh -c 'watch iptables -t nat -L -v'
|
$sudo tcpdump -i eth0 -n port 5555
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:36:41.625920 IP 192.168.16.7.59938 > 192.168.16.2.5555: S 4150567041:4150567041(0) win 5840 <mss 1460,sackOK,timestamp 19284004 0,nop,wscale 7> 15:36:44.619007 IP 192.168.16.7.59938 > 192.168.16.2.5555: S 4150567041:4150567041(0) win 5840 <mss 1460,sackOK,timestamp 19284754 0,nop,wscale 7> 15:36:50.619403 IP 192.168.16.7.59938 > 192.168.16.2.5555: S 4150567041:4150567041(0) win 5840 <mss 1460,sackOK,timestamp 19286254 0,nop,wscale 7> 15:37:02.620163 IP 192.168.16.7.59938 > 192.168.16.2.5555: S 4150567041:4150567041(0) win 5840 <mss 1460,sackOK,timestamp 19289254 0,nop,wscale 7> 4 packets captured 4 packets received by filter 0 packets dropped by kernel |
$sudo route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.16.254 0.0.0.0 UG 0 0 0 eth0 |
$ssh 192.168.16.7
The authenticity of host '192.168.16.7 (192.168.16.7)' can't be established. RSA key fingerprint is 51:5b:32:d8:70:19:6d:04:c7:b4:11:49:13:74:dc:bc. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.16.7' (RSA) to the list of known hosts. user@192.168.16.7's password: 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. Last login: Mon Aug 10 21:09:49 2009 from host1.dima.net.nt l3-agent is already running: pid=1793; pidfile=/home/user/.lilalo/l3-agent.pid |
$sudo iptables -t nat -L
Password: Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$exit
exit Connection to 192.168.16.7 closed. |
$sudo iptables -t nat -D
[user@debian2:~]$ sudo tcpdump -i eth0 -n port 5555 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:37:53.506718 IP 192.168.16.7.59941 > 192.168.16.2.5555: S 4224943464:4224943464(0) win 5840 <mss 1460,sackOK,timestamp 19301973 0,nop,wscale 7> 15:37:56.499490 IP 192.168.16.7.59941 > 192.168.16.2.5555: S 4224943464:4224943464(0) win 5840 <mss 1460,sackOK,timestamp 19302723 0,nop,wscale 7> 15:38:02.499928 IP 192.168.16.7.59941 > 192.168.16.2.5555: S 4224943464:4224943464(0) win 5840 <mss 1460,sackOK,timestamp 19304223 0,nop,wscale 7> 3 packets captured 3 packets received by filter 0 packets dropped by kernel |
$sudo tcpdump -i eth0 -n port 5555
![]() |
$sudo iptables -t nat -A PREROUTING -p tcp --dport 5555 -s 192
168.16.7 -d 192.168.16.2 -j DNAT --to-destination 192.1 |
$sudo iptables -t nat -D
![]() |
$sudo tcpdump -i eth0 -n port 5555
![]() |
$sudo tcpdump -i eth0 -n port 5555
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:39:29.617698 IP 192.168.16.7.59945 > 192.168.16.2.5555: S 12300268:12300268(0) win 5840 <mss 1460,sackOK,timestamp 19325999 0,nop,wscale 7> 15:39:32.609604 IP 192.168.16.7.59945 > 192.168.16.2.5555: S 12300268:12300268(0) win 5840 <mss 1460,sackOK,timestamp 19326749 0,nop,wscale 7> 15:39:38.609936 IP 192.168.16.7.59945 > 192.168.16.2.5555: S 12300268:12300268(0) win 5840 <mss 1460,sackOK,timestamp 19328249 0,nop,wscale 7> 3 packets captured 3 packets received by filter 0 packets dropped by kernel |
$sudo tcpdump -i eth0 -n port 5555
![]() |
$sudo iptables -t nat -D
|
$sudo iptables -t nat -A
![]() |
$sudo tcpdump -i eth0 -n port 5555
![]() |
$sudo iptables -t nat -D
![]() |
$sudo tcpdump -i eth0 -n port 5555
![]() |
$sudo sh -c 'watch iptables -t nat -L -v'
|
$netstat -lnp | less
|
$sudo sh -c 'watch iptables -t nat -n -L -v'
|
$sudo iptables -t nat -A
![]() |
$sudo iptables -t nat -D
![]() |
$sudo iptables -t nat -A POSTROUTING -s 192.168.16.7 -d 192.1
[user@debian2:~]$ sudo iptables -t nat -A 8.16.2 -j MASQUERADE |
$sudo sh -c 'watch iptables -t nat -n -L -v'
|
$sudo sh -c 'watch iptables -t nat -n -L -v'
![]() [user@debian2:~]$ sudo sh -c 'watch iptables -t nat -n -L -v' |
$sudo iptables -t nat -A
![]() |
$sudo tcpdump -i eth0 -n port 5555
![]() |
$sudo tcpdump -i eth0 -n port 5555
|
$sudo tcpdump -i eth0 -n port 5555
[user@debian2:~]$ sudo tcpdump -i eth0 -n port 5555 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:54:43.082473 IP 192.168.16.7.47190 > 192.168.16.2.5555: S 955117194:955117194(0) win 5840 <mss 1460,sackOK,timestamp 19554353 0,nop,wscale 7> 15:54:45.799717 IP 192.168.16.7.47192 > 192.168.16.2.5555: S 992685478:992685478(0) win 5840 <mss 1460,sackOK,timestamp 19555031 0,nop,wscale 7> 15:54:48.794798 IP 192.168.16.7.47192 > 192.168.16.2.5555: S 992685478:992685478(0) win 5840 <mss 1460,sackOK,timestamp 19555781 0,nop,wscale 7> 15:54:54.795175 IP 192.168.16.7.47192 > 192.168.16.2.5555: S 992685478:992685478(0) win 5840 <mss 1460,sackOK,timestamp 19557281 0,nop,wscale 7> 15:55:06.795952 IP 192.168.16.7.47192 > 192.168.16.2.5555: S 992685478:992685478(0) win 5840 <mss 1460,sackOK,timestamp 19560281 0,nop,wscale 7> 15:55:30.797426 IP 192.168.16.7.47192 > 192.168.16.2.5555: S 992685478:992685478(0) win 5840 <mss 1460,sackOK,timestamp 19566281 0,nop,wscale 7> 15:56:18.800464 IP 192.168.16.7.47192 > 192.168.16.2.5555: S 992685478:992685478(0) win 5840 <mss 1460,sackOK,timestamp 19578281 0,nop,wscale 7> ... 15:58:32.909559 IP 192.168.16.204.3160 > 192.168.16.2.5555: S 1256325320:1256325320(0) win 5840 <mss 1460,sackOK,timestamp 7064314 0,nop,wscale 0> 15:58:32.909776 IP 192.168.16.2.5555 > 192.168.16.204.3160: R 0:0(0) ack 1256325321 win 0 15:58:37.685116 IP 192.168.16.7.57413 > 192.168.16.2.5555: S 1215484615:1215484615(0) win 5840 <mss 1460,sackOK,timestamp 19613000 0,nop,wscale 7> 15:59:37.714444 IP 192.168.16.7.57416 > 192.168.16.2.5555: S 1286842016:1286842016(0) win 5840 <mss 1460,sackOK,timestamp 19628004 0,nop,wscale 7> 15:59:58.031504 IP 192.168.16.7.57420 > 192.168.16.2.5555: S 1310310704:1310310704(0) win 5840 <mss 1460,sackOK,timestamp 19633084 0,nop,wscale 7> 16:00:01.026316 IP 192.168.16.7.57420 > 192.168.16.2.5555: S 1310310704:1310310704(0) win 5840 <mss 1460,sackOK,timestamp 19633834 0,nop,wscale 7> 16:00:07.026680 IP 192.168.16.7.57420 > 192.168.16.2.5555: S 1310310704:1310310704(0) win 5840 <mss 1460,sackOK,timestamp 19635334 0,nop,wscale 7> 7 packets captured 7 packets received by filter 0 packets dropped by kernel |
$sudo iptables -t nat -L
Password: Chain PREROUTING (policy ACCEPT) target prot opt source destination DNAT tcp -- host1.serg.net.nt debian2.net.nt tcp dpt:rplay to:192.168.16.1:110 Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE 0 -- host1.serg.net.nt debian2.net.nt Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables -t nat -F POSTROUTING
|
$sudo iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination DNAT tcp -- host1.serg.net.nt debian2.net.nt tcp dpt:rplay to:192.168.16.1:110 Chain POSTROUTING (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo tcpdump -i eth0 -n -p tcp port 5555
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 0 packets captured 0 packets received by filter 0 packets dropped by kernel |
$ping 192.168.16.10
PING 192.168.16.10 (192.168.16.10) 56(84) bytes of data. 64 bytes from 192.168.16.10: icmp_seq=1 ttl=64 time=0.916 ms 64 bytes from 192.168.16.10: icmp_seq=2 ttl=64 time=0.115 ms --- 192.168.16.10 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min/avg/max/mdev = 0.115/0.515/0.916/0.401 ms |
$vnc
![]() Broadcast message from root@debian2 (Tue Aug 11 18:56:27 2009): The system is going down for system halt NOW! Aug 11 18:56:27 debian1 init: Switching to runlevel: 0 Connection to 192.168.16.2 closed by remote host. Connection to 192.168.16.2 closed. |
$iptab
![]() bash: iptab: command not found |
$iptables -L
![]() bash: iptables: command not found |
$sudo iptables -L
Password: Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables -A INPUT -d 127.0.0.1 -p icmp -j DROP
|
$sudo iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination DROP icmp -- anywhere localhost.localdomain Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$ping localhost
![]() PING localhost.localdomain (127.0.0.1) 56(84) bytes of data. --- localhost.localdomain ping statistics --- 42 packets transmitted, 0 received, 100% packet loss, time 41009ms |
$sudo iptables -D INPUT 1
|
$sudo iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$ping localhost
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.017 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.012 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=64 time=0.019 ms --- localhost.localdomain ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.012/0.016/0.019/0.003 ms |
$sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
$sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
$sudo iptables -A INPUT -p tcp -j DROPT
![]() iptables v1.3.6: Couldn't load target `DROPT':/lib/iptables/libipt_DROPT.so: cannot open shared object file: No such file or directory Try `iptables -h' or 'iptables --help' for more information. |
$sudo iptables -A INPUT -p tcp -j DROPT
![]() iptables v1.3.6: Couldn't load target `DROPT':/lib/iptables/libipt_DROPT.so: cannot open shared object file: No such file or directory Try `iptables -h' or 'iptables --help' for more information. |
$sudo iptables -A INPUT -p tcp -j DROP
|
$sudo apt-get update
Password: Получено:1 http://debian.org.ua etch Release.gpg [1032B] В кэше http://debian.org.ua etch Release Err http://debian.org.ua etch Release Получено:2 http://debian.org.ua etch Release [67,8kB] Ign http://debian.org.ua etch Release Ign http://debian.org.ua etch/main Packages/DiffIndex В кэше http://debian.org.ua etch/main Packages Получено 68,8kB за 0s (1513kB/c) Чтение списков пакетов... Готово W: GPG error: http://debian.org.ua etch Release: Следующие подписи не могут быть проверены, так как недоступен общий ключ: NO_PUBKEY 9AA38DCD55BE302B W: Вы можете запустить 'apt-get update' для исправления этих ошибок |
$ssh user@192.168.16.8
user@192.168.16.8's password: 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. Last login: Wed Aug 12 11:01:43 2009 from 192.168.16.9 l3-agent is already running: pid=2155; pidfile=/home/user/.lilalo/l3-agent.pid |
$hostname
debian8 |
$exit
exit Connection to 192.168.16.8 closed. |
$ssh user@192.168.16.2
user@192.168.16.2's password: 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. Last login: Wed Aug 12 10:17:54 2009 Removing stale pidfile |
$hostaname
![]() bash: hostaname: command not found |
$hostname
debian2 |
$sudo sh -c 'watch iptables -t nat -n -L -v'
![]() |
$sudo sh -c 'watch iptables -t nat -n -L -v'
![]() |
$ssh user@192.168.16.8
The authenticity of host '192.168.16.8 (192.168.16.8)' can't be established. RSA key fingerprint is 51:5b:32:d8:70:19:6d:04:c7:b4:11:49:13:74:dc:bc. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.16.8' (RSA) to the list of known hosts. user@192.168.16.8's password: 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. Last login: Wed Aug 12 11:04:20 2009 from 192.168.16.1 l3-agent is already running: pid=2155; pidfile=/home/user/.lilalo/l3-agent.pid |
$w
11:12:40 up 16:06, 3 users, load average: 0,00, 0,00, 0,00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT user :0 - 09:57 ?xdm? 3.47s 0.12s /usr/bin/fluxbox user ttyp0 :0.0 09:57 8:20m 0.08s 0.08s script -f -q /home/u user ttyp2 192.168.16.2 11:09 0.00s 0.10s 0.10s script -f -q /home/u |
$whom
![]() bash: whom: command not found |
$who
user :0 2009-08-12 09:57 user ttyp0 2009-08-12 09:57 (:0.0) user ttyp2 2009-08-12 11:09 (192.168.16.2) |
$vncviewer 192.168.16.7
![]() bash: vncviewer: command not found |
$sudo vncviewer 192.168.16.7
![]() Password: sudo: vncviewer: command not found |
$exit
exit Connection to 192.168.16.8 closed. |
$vnc
![]() vncconnect vncpasswd vncserver |
$ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. 64 bytes from 192.168.16.1: icmp_seq=1 ttl=64 time=0.103 ms 64 bytes from 192.168.16.1: icmp_seq=2 ttl=64 time=0.112 ms 64 bytes from 192.168.16.1: icmp_seq=3 ttl=64 time=0.122 ms 64 bytes from 192.168.16.1: icmp_seq=4 ttl=64 time=0.148 ms 64 bytes from 192.168.16.1: icmp_seq=5 ttl=64 time=0.126 ms 64 bytes from 192.168.16.1: icmp_seq=6 ttl=64 time=0.152 ms 64 bytes from 192.168.16.1: icmp_seq=7 ttl=64 time=0.177 ms 64 bytes from 192.168.16.1: icmp_seq=8 ttl=64 time=0.117 ms 64 bytes from 192.168.16.1: icmp_seq=9 ttl=64 time=0.140 ms ... 64 bytes from 192.168.16.1: icmp_seq=68 ttl=64 time=0.155 ms 64 bytes from 192.168.16.1: icmp_seq=69 ttl=64 time=0.187 ms 64 bytes from 192.168.16.1: icmp_seq=70 ttl=64 time=0.161 ms 64 bytes from 192.168.16.1: icmp_seq=71 ttl=64 time=0.171 ms 64 bytes from 192.168.16.1: icmp_seq=72 ttl=64 time=0.120 ms 64 bytes from 192.168.16.1: icmp_seq=73 ttl=64 time=0.141 ms 64 bytes from 192.168.16.1: icmp_seq=74 ttl=64 time=0.127 ms --- 192.168.16.1 ping statistics --- 74 packets transmitted, 74 received, 0% packet loss, time 73005ms rtt min/avg/max/mdev = 0.103/0.151/0.209/0.021 ms |
$su -
Password: l3-agent is already running: pid=1773; pidfile=/root/.lilalo/l3-agent.pid |
#gpg --keyserver pgpkeys.pca.dfn.de --recv-keys 9AA38DCD55BE302B
![]() gpg: directory `/root/.gnupg' created gpg: can't open `/gnupg/options.skel': No such file or directory gpg: keyring `/root/.gnupg/secring.gpg' created gpg: keyring `/root/.gnupg/pubring.gpg' created gpg: requesting key 55BE302B from hkp server pgpkeys.pca.dfn.de gpg: /root/.gnupg/trustdb.gpg: trustdb created gpg: key 55BE302B: public key "Debian Archive Automatic Signing Key (5.0/lenny) <ftpmaster@debian.org>" imported gpg: no ultimately trusted keys found gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) |
#gpg --export -a 9AA38DCD55BE302B| apt-key add -
OK |
#exit
exit |
$sudo apt-get update
Получено:1 http://debian.org.ua etch Release.gpg [1032B] В кэше http://debian.org.ua etch Release Ign http://debian.org.ua etch/main Packages/DiffIndex В кэше http://debian.org.ua etch/main Packages Получено 1032B за 0s (41,8kB/c) Чтение списков пакетов... Готово |
$apt-get install bind9
![]() E: Не могу открыть файл блокировки /var/lib/dpkg/lock - open (13 Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? |
$sudo apt-get install bind9
Чтение списков пакетов... Готово Построение дерева зависимостей... Готово Будут установлены следующие дополнительные пакеты: libbind9-0 libdns22 libisc11 libisccc0 libisccfg1 liblwres9 Предлагаемые пакеты: dnsutils bind9-doc НОВЫЕ пакеты, которые будут установлены: bind9 libbind9-0 libdns22 libisc11 libisccc0 libisccfg1 liblwres9 обновлено 0, установлено 7 новых пакетов, для удаления отмечено 0 пакетов, и 63 пакетов не обновлено. Необходимо скачать 1346kБ архивов. ... Настраивается пакет libbind9-0 (9.3.4-2etch4) ... Настраивается пакет liblwres9 (9.3.4-2etch4) ... Настраивается пакет bind9 (9.3.4-2etch4) ... Добавляется группа `bind' (GID 105) ... Готово. Добавляется системный пользователь `bind' (UID 103) ... Добавляется новый пользователь `bind' (UID 103) в группу `bind' ... Не создаётся домашний каталог `/var/cache/bind'. wrote key file "/etc/bind/rndc.key" Starting domain name service...: bind. |
$cat /etc/resolv.conf
search net.nt unix.nt nameserver 192.168.16.254 nameserver 10.0.17.1 nameserver 10.0.35.1 |
$ping no.domain.at.this.name
![]() ping: unknown host no.domain.at.this.name |
$ping noname
![]() ping: unknown host noname |
$vim /etc/resolv.conf
|
$sudo mcedit /etc/resolv.conf
![]() Password: Sorry, try again. Password: sudo: mcedit: command not found |
$sudo vim /etc/resolv.conf
|
$cat /etc/resolv.conf
search agro.net sergey.net marina.net net.nt unix.nt nameserver 192.168.16.254 nameserver 10.0.17.1 nameserver 10.0.35.1 |
$tcpdump port 53
![]() bash: tcpdump: command not found |
$sudo tcpdump port 53
![]() tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 17:25:07.934690 IP debian1.net.nt.32920 > debian.net.nt.domain: 6193+ A? xgu.ru. (24) 17:25:07.935017 IP debian.net.nt.domain > debian1.net.nt.32920: 6193 1/3/3 A chub.in (154) 17:25:07.936120 IP debian1.net.nt.32920 > debian.net.nt.domain: 39178+ PTR? 254.16.168.192.in-addr.arpa. (45) 17:25:07.936324 IP debian.net.nt.domain > debian1.net.nt.32920: 39178* 1/1/1 (102) 17:25:07.936522 IP debian1.net.nt.32920 > debian.net.nt.domain: 45456+ PTR? 51.146.26.212.in-addr.arpa. (44) 17:25:08.056860 IP debian.net.nt.domain > debian1.net.nt.32920: 45456 1/5/3 (226) 17:25:13.534882 IP debian1.net.nt.32920 > debian.net.nt.domain: 7686+ A? xgu.ru. (24) 17:25:13.535226 IP debian.net.nt.domain > debian1.net.nt.32920: 7686 1/3/3 A chub.in (154) ... 17:27:03.674185 IP debian.net.nt.domain > debian1.net.nt.32920: 61692 1/3/3 A chub.in (154) 17:27:08.213611 IP debian1.net.nt.32920 > debian.net.nt.domain: 4349+ A? xgu.ru. (24) 17:27:08.213827 IP debian.net.nt.domain > debian1.net.nt.32920: 4349 1/3/3 A chub.in (154) 17:27:13.686337 IP debian1.net.nt.32920 > debian.net.nt.domain: 29264+ A? xgu.ru. (24) 17:27:13.686663 IP debian.net.nt.domain > debian1.net.nt.32920: 29264 1/3/3 A chub.in (154) 17:27:18.229765 IP debian1.net.nt.32920 > debian.net.nt.domain: 18464+ A? xgu.ru. (24) 17:27:18.230008 IP debian.net.nt.domain > debian1.net.nt.32920: 18464 1/3/3 A chub.in (154) 17:27:23.698964 IP debian1.net.nt.32920 > debian.net.nt.domain: 48136+ A? xgu.ru. (24) 17:27:23.699281 IP debian.net.nt.domain > debian1.net.nt.32920: 48136 1/3/3 A chub.in (154) [1]+ Stopped sudo tcpdump port 53 |
$ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. 64 bytes from 192.168.16.1: icmp_seq=1 ttl=64 time=0.082 ms 64 bytes from 192.168.16.1: icmp_seq=2 ttl=64 time=0.154 ms 64 bytes from 192.168.16.1: icmp_seq=3 ttl=64 time=0.135 ms 64 bytes from 192.168.16.1: icmp_seq=4 ttl=64 time=0.160 ms 64 bytes from 192.168.16.1: icmp_seq=5 ttl=64 time=0.163 ms 64 bytes from 192.168.16.1: icmp_seq=6 ttl=64 time=0.139 ms 64 bytes from 192.168.16.1: icmp_seq=7 ttl=64 time=0.189 ms 64 bytes from 192.168.16.1: icmp_seq=8 ttl=64 time=0.157 ms 64 bytes from 192.168.16.1: icmp_seq=9 ttl=64 time=0.132 ms ... 64 bytes from 192.168.16.1: icmp_seq=41 ttl=64 time=0.163 ms 64 bytes from 192.168.16.1: icmp_seq=42 ttl=64 time=0.100 ms 64 bytes from 192.168.16.1: icmp_seq=43 ttl=64 time=0.137 ms 64 bytes from 192.168.16.1: icmp_seq=44 ttl=64 time=0.150 ms 64 bytes from 192.168.16.1: icmp_seq=45 ttl=64 time=0.129 ms 64 bytes from 192.168.16.1: icmp_seq=46 ttl=64 time=0.129 ms 64 bytes from 192.168.16.1: icmp_seq=47 ttl=64 time=0.163 ms --- 192.168.16.1 ping statistics --- 47 packets transmitted, 47 received, 0% packet loss, time 46002ms rtt min/avg/max/mdev = 0.082/0.149/0.226/0.027 ms |
$sudo apt-get update
Password: Sorry, try again. Password: Получено:1 http://debian.org.ua etch Release.gpg [1032B] Получено:2 http://debian.org.ua etch Release [67,8kB] Ign http://debian.org.ua etch Release Ign http://debian.org.ua etch/main Packages/DiffIndex Получено:3 http://debian.org.ua etch/main Packages [4282kB] Получено 4351kB за 5s (795kB/c) Чтение списков пакетов... Готово W: GPG error: http://debian.org.ua etch Release: Следующие подписи не могут быть проверены, так как недоступен общий ключ: NO_PUBKEY 9AA38DCD55BE302B W: Вы можете запустить 'apt-get update' для исправления этих ошибок |
$options ndots:
![]() [user@debian1:~]$ cat /etc/resolv.conf search agro.net sergey.net marina.net net.nt unix.nt nameserver 192.168.16.254 nameserver 10.0.17.1 nameserver 10.0.35.1 bash: options: command not found |
$options ndots:2
![]() bash: options: command not found |
$sudo dig dobro.net
![]() sudo: dig: command not found |
$sudo apt-get install dig
![]() Чтение списков пакетов... Готово Построение дерева зависимостей... Готово E: Не могу найти пакет dig |
$apt-get update
![]() E: Не могу открыть файл блокировки /var/lib/apt/lists/lock - open (13 Permission denied) E: Невозможно заблокировать каталог со списками пакетов |
$sudo apt-get update
Получено:1 http://debian.org.ua etch Release.gpg [1032B] В кэше http://debian.org.ua etch Release Ign http://debian.org.ua etch/main Packages/DiffIndex В кэше http://debian.org.ua etch/main Packages Получено 1B за 0s (1B/c) Чтение списков пакетов... Готово |
search agro.net sergey.net marina.net net.nt unix.nt nameserver 192.168.16.254 nameserver 10.0.17.1 nameserver 10.0.35.1
root=/dev/hda1 ro
Время первой команды журнала | 14:34:01 2009- 8-11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 16:30:56 2009- 8-12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 15.84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 7.92 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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