/l3/users/10-06-2013/NT-Lnet/debian3.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 |
|
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP icmp -- net.nt anywhere Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination |
# L --line-numbers
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP icmp -- fobos.net.nt debian3.net.nt 2 DROP icmp -- net.nt anywhere Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination |
# L --line-numbers
D INPUT 1 |
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP icmp -- fobos.net.nt anywhere Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination |
#iptables -D INPUT 1
|
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT) num target prot opt source destination Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination |
#iptables -A OUTPUT -p icmp -j DROP
|
#ping ya.ru
![]() PING ya.ru (77.88.21.3) 56(84) bytes of data. ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted ^C --- ya.ru ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2016ms |
#ping 8.8.8.8
![]() PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. ping: sendmsg: Operation not permitted ^C --- 8.8.8.8 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
#ping 192.168.13.253
![]() PING 192.168.13.253 (192.168.13.253) 56(84) bytes of data. ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted ^C --- 192.168.13.253 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1007ms |
#ping 8.8.8
![]() PING 8.8.8 (8.8.0.8) 56(84) bytes of data. ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted ^C --- 8.8.8 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1008ms |
#ping 8.8.8.8
![]() PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. ping: sendmsg: Operation not permitted ^C --- 8.8.8.8 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
#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 DROP icmp -- anywhere !net.nt DROP icmp -- anywhere anywhere |
#iptables -D OUTPUT 2
|
#ping 8.8.8.8
![]() PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted ^C --- 8.8.8.8 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 999ms |
#ping 192.168.13.253
PING 192.168.13.253 (192.168.13.253) 56(84) bytes of data. 64 bytes from 192.168.13.253: icmp_req=1 ttl=64 time=0.309 ms 64 bytes from 192.168.13.253: icmp_req=2 ttl=64 time=0.195 ms ^C --- 192.168.13.253 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min/avg/max/mdev = 0.195/0.252/0.309/0.057 ms |
#ping 192.168.13.253
PING 192.168.13.253 (192.168.13.253) 56(84) bytes of data. 64 bytes from 192.168.13.253: icmp_req=1 ttl=64 time=0.418 ms 64 bytes from 192.168.13.253: icmp_req=2 ttl=64 time=0.198 ms ^C --- 192.168.13.253 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min/avg/max/mdev = 0.198/0.308/0.418/0.110 ms |
#iptables -I OUTPUT -p icmp ! -d 192.168.13.0/24 -j DROP
|
#ping ya.ru
![]() PING ya.ru (87.250.250.3) 56(84) bytes of data. ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted ^C --- ya.ru ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 999ms |
#pint 192.168.13.253
![]() l3script: pint: команда не найдена |
#ping 192.168.13.253
![]() PING 192.168.13.253 (192.168.13.253) 56(84) bytes of data. ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted ^C --- 192.168.13.253 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1007ms |
#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 DROP icmp -- anywhere !192.168.13.0/24 DROP icmp -- anywhere 192.168.13.0/24 DROP icmp -- anywhere !net.nt |
#iptables -F
|
#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 |
#man iptables
|
#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 |
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain INPUT (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- 192.168.13.0/24 anywhere |
#iptables -t nat -D POSTROUTING 1
|
#iptables -t nat -F
|
#man iptables
|
#F
![]() |
#man iptables
|
#F
![]() |
#man iptables
![]() |
#L
|
#iptables -A INPUT -s 192.168.13.0/24 -j ACCEPT
|
#iptables-save > file1
|
#vim file1
|
#~
|
#iptables -t nat -F
|
#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 |
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain INPUT (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination |
#iptables-restore < file1
|
#ls
file1 xinetd.conf |
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain INPUT (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- 192.168.13.0/24 anywhere |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- 192.168.13.0/24 anywhere Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination DROP icmp -- anywhere !192.168.13.0/24 |
#vim /etc/network/i
![]() |
#vim /etc/network/i
![]() |
#vim /etc/network/if-up.d/iptables-start.sh
![]() --- /dev/null 2013-06-10 20:00:46.311999992 +0300 +++ /etc/network/if-up.d/iptables-start.sh 2013-06-11 15:15:42.000000000 +0300 @@ -0,0 +1,2 @@ +#!/bin/bash +iptables-restor < /etc/iptables.rules |
#vim /etc/network/if-down.d/.d/iptables-stop.sh
![]() |
#F
![]() |
#man iptables
![]() |
#ping 192.168.13.253
![]() |
# L --line-numbers
![]() |
#L --line-numbers
iptables -I OUTPUT -p icmp ! -d 192.168.13.253 -j DROP |
#ping 192.168.13.253
PING 192.168.13.253 (192.168.13.253) 56(84) bytes of data. 64 bytes from 192.168.13.253: icmp_req=1 ttl=64 time=0.807 ms 64 bytes from 192.168.13.253: icmp_req=2 ttl=64 time=0.152 ms ^C --- 192.168.13.253 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.152/0.479/0.807/0.328 ms |
#ping ya.ru
![]() PING ya.ru (87.250.250.203) 56(84) bytes of data. ping: sendmsg: Operation not permitted ^C --- ya.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
#iptables -A OUTPUT -p icmp -d 192.168.13.253 -j DROP
|
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- 192.168.13.0/24 anywhere Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination DROP icmp -- anywhere !fobos.net.nt DROP icmp -- anywhere !192.168.13.0/24 DROP icmp -- anywhere net.nt |
#iptables -F
|
#w3m bash.org.ru
xxx: ÐÑваÑÑ ÑоÑки наÑÑол0ко6Ð¿Ð»Ð¾Ñ Ð¸Ðµ, ÑÑо Ð¸Ñ Ð´Ð°Ð¶Ðµ минÑÑоваÑÑ Ð¿ÑоÑивно... [admin1 is online] + 684 âs[:||||:] ÐоделиÑÑÑÑ 2013-06-11 10:46 #422957 admin2 is ofline] Ðалим деÑевÑÑ Ð² овÑаге на ÑÑаÑÑке. ТаÑÑ Ð±ÑевнÑÑко на плеÑе. ÐÑ ÐºÐ°Ðº бÑевнÑÑко - [admin2 is ofline] ÑанÑимеÑÑов 12-15 диамеÑÑом и меÑÑа 4 в длинÑ. Ðимо Ð¶ÐµÐ½Ñ Ð¿ÑÐ¾Ñ Ð¾Ð¶Ñ: Ñ: Ð²Ð¾Ñ ÐºÐ°Ð¶Ð´Ñй Ñаз,Ðкак¼Ð¸Ð´Ñ±ÑÑбÑевномµÐ½Ð°ÐплеÑе, ÑÑвÑÑвÑÑ ÑебÑ, как... + 674 â [:||||:] ÐоделиÑÑ Ñ 2013-06-11 11:11 #422958 в коме лежаÑÑ... ... + 674 â [:||||:] ÐоделиÑÑ Ñ 2013-06-11 11:11 #422958 Я,ÐпѼаÑÑÑ ÑÑпокоиÑÑ: "Ð½Ñ Ð½Ðµ пеÑеживай. ÐÑÐ´Ñ ÑилÑной. ÐÑÑÑ Ð»Ñди, коÑоÑÑе вÑÑе ⪠â â Viewing <ЦиÑаÑник Ð ÑнеÑа> Ð: как Ð ]â817816···наÑало ак9ШваÑÑ|изÐкоммандо!Ñ 2013-06-11 11:45 #422961 + 2625 â [:||||:]²ÐоделиÑÑÑÑ 2013-06-11Ñ10:45 #422956иÑÑ Ð¿Ð°ÑнÑ, к ÐºÐ°ÐºÐ¾Ð¼Ñ Ð²ÑаÑÑ Ð»ÑÑÑе запиÑаÑÑÑÑ Ð¶ÐµÐ½Ð°¿Ð²ÑÐ¶ÐµÑ ÐºÑÑÑком, и ÑÐоÑÑÐ¸Ñ ÑаÑанÑÐ¸Ð½Ñ "ÑбиÑÑ Ð±Ð¸Ð»Ð»Ð°". комменÑиÑÑÐµÑ Ð²ÑлÑÑ : - ÑеÑÑÑе года в коме пÑолежала, а ногÑи на Ð½Ð¾Ð³Ð°Ñ Ð½Ð°ÐºÑаÑенÑ. ÑмеÑÑ Ð¶Ðµ Ñам Ñ Ð½Ð¸Ñ + 1209 â [:||||:] ÐоделиÑÑÑÑ 2013-06-11 11:12 #422960 xxx: ÐоÑÐµÐ¼Ñ Ð² оÑноÑениÑÑ Ñ Ð¶ÐµÐ½Ñинами Ñ Ð²Ñегда Ð½Ð°Ñ Ð¾Ð¶ÑÑÑ Ð² ÑиÑÑаÑии междÑ: "Ð¢Ñ |
#мелочей жиз и. Например, буддийские монахи..."
|
#nmap 192.168.13.1
Starting Nmap 5.00 ( http://nmap.org ) at 2013-06-11 15:53 EEST Interesting ports on 192.168.13.1: Not shown: 998 filtered ports PORT STATE SERVICE 22/tcp open ssh 80/tcp closed http MAC Address: 00:16:3E:00:00:01 (Xensource) Nmap done: 1 IP address (1 host up) scanned in 4.97 seconds |
#nmap 192.168.13.2
Starting Nmap 5.00 ( http://nmap.org ) at 2013-06-11 15:54 EEST Interesting ports on 192.168.13.2: Not shown: 998 filtered ports PORT STATE SERVICE 22/tcp open ssh 80/tcp closed http MAC Address: 00:16:3E:00:00:02 (Xensource) Nmap done: 1 IP address (1 host up) scanned in 4.67 seconds |
#ls
file1 xinetd.conf |
#vim /etc/ssh/ssh
![]() |
#vim /etc/ssh/ssh
![]() |
#vim /etc/ssh/sshd_config
--- /tmp/l3-saved-27042.7811.17420 2013-06-11 16:34:34.000000000 +0300 +++ /etc/ssh/sshd_config 2013-06-11 16:36:24.000000000 +0300 @@ -6,6 +6,7 @@ # Use these options to restrict which interfaces/protocols sshd will bind to #ListenAddress :: #ListenAddress 0.0.0.0 +ListenAddress 127.0.0.1 Protocol 2 # HostKeys for protocol version 2 HostKey /etc/ssh/ssh_host_rsa_key |
#/etc/init.d/ssh restart
Restarting OpenBSD Secure Shell server: sshd. |
#netstat -nlp|less
|
#ssh root@127.0.0.1
![]() ^C |
#iptables -F
|
#ssh root@127.0.0.1
![]() ^C |
#ifcofnig lo
![]() l3script: ifcofnig: команда не найдена |
#ifconfig lo
lo Link encap:Local Loopback LOOPBACK MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
#/etc/init.d/networking restart
Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning). Reconfiguring network interfaces...done. |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3e:00:00:03 inet addr:192.168.13.3 Bcast:192.168.13.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:3/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:211523 errors:0 dropped:0 overruns:0 frame:0 TX packets:518078 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:202567034 (193.1 MiB) TX bytes:2453635887 (2.2 GiB) Interrupt:72 eth0:1 Link encap:Ethernet HWaddr 00:16:3e:00:00:03 inet addr:192.168.13.252 Bcast:192.168.13.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:72 |
#ifconfig lo up
|
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3e:00:00:03 inet addr:192.168.13.3 Bcast:192.168.13.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:3/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:211664 errors:0 dropped:0 overruns:0 frame:0 TX packets:518240 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:202575861 (193.1 MiB) TX bytes:2453659339 (2.2 GiB) Interrupt:72 eth0:1 Link encap:Ethernet HWaddr 00:16:3e:00:00:03 inet addr:192.168.13.252 Bcast:192.168.13.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:72 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
#ssh 192.168.13.253 -l root
root@192.168.13.253's password: Linux fobos 3.1.0-rc9+ #1 SMP Mon Jun 18 15:44:37 EEST 2012 x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Tue Jun 11 14:47:40 2013 from 192.168.13.3 fobos:~# exit logout Connection to 192.168.13.253 closed. |
#ssh root@192.168.13.253 -v
OpenSSH_5.5p1 Debian-6+squeeze2, OpenSSL 0.9.8o 01 Jun 2010 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 192.168.13.253 [192.168.13.253] port 22. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: identity file /root/.ssh/id_dsa-cert type -1 ... permitted by applicable law. Last login: Tue Jun 11 16:46:10 2013 from 192.168.13.3 fobos:~# exitdebug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0 logout debug1: channel 0: free: client-session, nchannels 1 Connection to 192.168.13.253 closed. Transferred: sent 1960, received 2856 bytes, in 64.9 seconds Bytes per second: sent 30.2, received 44.0 debug1: Exit status 0 |
#ssh root@192.168.13.1
The authenticity of host '192.168.13.1 (192.168.13.1)' can't be established. RSA key fingerprint is 62:dd:81:b1:0d:50:38:41:e7:82:ea:89:d5:48:16:e0. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.13.1' (RSA) to the list of known hosts. root@192.168.13.1's password: Permission denied, please try again. root@192.168.13.1's password: Linux debian1 2.6.39-bpo.2-686-pae #1 SMP Thu Aug 4 11:02:22 UTC 2011 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the ... permitted by applicable law. Last login: Mon Jun 10 16:45:29 2013 from net.nt l3-agent is already running: pid=1197; pidfile=/root/.lilalo/l3-agent.pid root@debian1:~# root@debian1:~# root@debian1:~# root@debian1:~# iptables -F root@debian1:~# iptables -A INPUT -p tcp --dport 22 -j DROP && exit logout Connection to 192.168.13.1 closed. |
#ssh root@192.168.13.1
![]() ^C |
#ssh root@192.168.13.1 -v
![]() OpenSSH_5.5p1 Debian-6+squeeze2, OpenSSL 0.9.8o 01 Jun 2010 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 192.168.13.1 [192.168.13.1] port 22. ^C |
#ssh root@192.168.13.1 -v
OpenSSH_5.5p1 Debian-6+squeeze2, OpenSSL 0.9.8o 01 Jun 2010 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 192.168.13.1 [192.168.13.1] port 22. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: identity file /root/.ssh/id_dsa-cert type -1 ... debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/id_rsa debug1: Trying private key: /root/.ssh/id_dsa debug1: Next authentication method: password root@192.168.13.1's password: |
#ssh root@192.168.13.1 -v
![]() OpenSSH_5.5p1 Debian-6+squeeze2, OpenSSL 0.9.8o 01 Jun 2010 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 192.168.13.1 [192.168.13.1] port 22. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: identity file /root/.ssh/id_dsa-cert type -1 ssh_exchange_identification: Connection closed by remote host |
#ssh root@192.168.13.1 -v
![]() OpenSSH_5.5p1 Debian-6+squeeze2, OpenSSL 0.9.8o 01 Jun 2010 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 192.168.13.1 [192.168.13.1] port 22. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: identity file /root/.ssh/id_dsa-cert type -1 ... debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/id_rsa debug1: Trying private key: /root/.ssh/id_dsa debug1: Next authentication method: password root@192.168.13.1's password: |
#vim /etc/ssh/sshd_config
--- /tmp/l3-saved-27042.8571.15993 2013-06-11 16:53:04.000000000 +0300 +++ /etc/ssh/sshd_config 2013-06-11 16:53:09.000000000 +0300 @@ -2,7 +2,7 @@ # See the sshd_config(5) manpage for details # What ports, IPs and protocols we listen for -Port 22 +Port 22222 # Use these options to restrict which interfaces/protocols sshd will bind to #ListenAddress :: #ListenAddress 0.0.0.0 |
#/etc/init.d/ssh restart
Restarting OpenBSD Secure Shell server: sshd. |
#ssh root@192.168.13.3 -p 22222
The authenticity of host '[192.168.13.3]:22222 ([192.168.13.3]:22222)' can't be established. RSA key fingerprint is 62:dd:81:b1:0d:50:38:41:e7:82:ea:89:d5:48:16:e0. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '[192.168.13.3]:22222' (RSA) to the list of known hosts. root@192.168.13.3's password: Linux debian3 2.6.39-bpo.2-686-pae #1 SMP Thu Aug 4 11:02:22 UTC 2011 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Tue Jun 11 14:19:27 2013 from 192.168.17.104 l3-agent is already running: pid=2008; pidfile=/root/.lilalo/l3-agent.pid root@debian3:~# exit logout Connection to 192.168.13.3 closed. |
#ssh root@192.168.13.1 -f
![]() Cannot fork into background without a command to execute. |
#ssh root@192.168.13.1 -f -N
root@192.168.13.1's password: |
#ps aux|grep ssh
root 4015 0.0 0.5 8312 2848 ? Ss 14:19 0:00 sshd: root@pts/3 root 11690 0.0 0.5 8452 2856 ? Ss 09:30 0:02 sshd: root@pts/0 root 13008 0.0 0.5 8448 2844 ? Ss Jun10 0:02 sshd: root@pts/4 root 14772 0.0 0.1 5548 944 ? Ss 16:54 0:00 /usr/sbin/sshd root 14801 0.0 0.0 5044 404 ? Ss 16:56 0:00 ssh root@192.168.13.1 -f -N root 14810 0.0 0.1 5080 740 pts/2 S+ 16:57 0:00 grep ssh |
#ssh root@192.168.13.1 ping ya.ru
![]() root@192.168.13.1's password: PING ya.ru (87.250.250.203) 56(84) bytes of data. 64 bytes from www.yandex.ru (87.250.250.203): icmp_req=1 ttl=59 time=18.2 ms 64 bytes from www.yandex.ru (87.250.250.203): icmp_req=2 ttl=59 time=19.8 ms 64 bytes from www.yandex.ru (87.250.250.203): icmp_req=3 ttl=56 time=19.5 ms 64 bytes from www.yandex.ru (87.250.250.203): icmp_req=4 ttl=59 time=18.3 ms 64 bytes from www.yandex.ru (87.250.250.203): icmp_req=5 ttl=56 time=21.2 ms 64 bytes from www.yandex.ru (87.250.250.203): icmp_req=6 ttl=59 time=17.9 ms 64 bytes from www.yandex.ru (87.250.250.203): icmp_req=7 ttl=56 time=18.5 ms 64 bytes from www.yandex.ru (87.250.250.203): icmp_req=8 ttl=59 time=18.2 ms |
#ssh root@192.168.13.1 ping top
![]() root@192.168.13.1's password: ping: unknown host top |
#ssh root@192.168.13.1 top
![]() root@192.168.13.1's password: TERM environment variable not set. |
#ssh root@192.168.13.1 trafshow
![]() root@192.168.13.1's password: Error opening terminal: unknown. |
#ssh root@192.168.13.1 tcpdump
![]() root@192.168.13.1's password: tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes |
#ssh root@192.168.13.1 tcpdump -vv
![]() root@192.168.13.1's password: tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes 16:59:13.265085 IP (tos 0x8, ttl 64, id 49052, offset 0, flags [DF], proto TCP (6), length 100) debian1.net.nt.ssh > net.nt.38388: Flags [P.], cksum 0x9ca5 (incorrect -> 0xf792), seq 2093851820:2093851868, ack 1974357074, win 718, options [nop,nop,TS val 21964033 ecr 21502560], length 48 16:59:13.265164 IP (tos 0x8, ttl 64, id 49053, offset 0, flags [DF], proto TCP (6), length 164) debian1.net.nt.ssh > net.nt.38388: Flags [P.], cksum 0x9ce5 (incorrect -> 0x4650), seq 48:160, ack 1, win 718, options [nop,nop,TS val 21964033 ecr 21502560], length 112 16:59:13.265976 IP (tos 0x0, ttl 64, id 9473, offset 0, flags [DF], proto UDP (17), length 73) debian1.net.nt.41851 > net.nt.domain: [bad udp cksum d275!] 9724+ PTR? 253.13.168.192.in-addr.arpa. (45) 16:59:13.266227 IP (tos 0x8, ttl 64, id 24328, offset 0, flags [DF], proto TCP (6), length 52) net.nt.38388 > debian1.net.nt.ssh: Flags [.], cksum 0x9c75 (incorrect -> 0x1bf5), seq 1, ack 160, win 604, options [nop,nop,TS val 21502564 ecr 21964029], length 0 ... debian1.net.nt.ssh > 192.168.17.102.4293: Flags [P.], cksum 0xa00e (incorrect -> 0x431e), seq 8353:8401, ack 1440, win 613, options [nop,nop,TS val 21971168 ecr 11710414], length 48 16:59:41.804569 IP (tos 0x8, ttl 64, id 24375, offset 0, flags [DF], proto TCP (6), length 52) net.nt.38388 > debian1.net.nt.ssh: Flags [.], cksum 0x9c75 (incorrect -> 0x5f6a), seq 1, ack 98320, win 1973, options [nop,nop,TS val 21509698 ecr 21971167], length 0 16:59:41.804583 IP (tos 0x8, ttl 64, id 24376, offset 0, flags [DF], proto TCP (6), length 52) net.nt.38388 > debian1.net.nt.ssh: Flags [.], cksum 0x9c75 (incorrect -> 0x5aaf), seq 1, ack 99568, win 1936, options [nop,nop,TS val 21509698 ecr 21971167], length 0 16:59:41.804592 IP (tos 0x8, ttl 64, id 24377, offset 0, flags [DF], proto TCP (6), length 100) net.nt.38388 > debian1.net.nt.ssh: Flags [P.], cksum 0x9ca5 (incorrect -> 0xe6fe), seq 1:49, ack 99568, win 2003, options [nop,nop,TS val 21509698 ecr 21971167], length 48 16:59:41.804777 IP (tos 0x10, ttl 64, id 44236, offset 0, flags [DF], proto TCP (6), length 164) debian1.net.nt.ssh > 192.168.17.102.4293: Flags [P.], cksum 0xa04e (incorrect -> 0xdb08), seq 8401:8513, ack 1440, win 613, options [nop,nop,TS val 21971168 ecr 11710414], length 112 16:59:41.804852 IP (tos 0x10, ttl 64, id 44237, offset 0, flags [DF], proto TCP (6), length 100) |
Время первой команды журнала | 13:50:21 2013- 6-11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 15:59:10 2013- 6-11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 20.79 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.98 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.78 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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