/l3/users/eb/2009/linux9/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 :22 :23 :24 :25 :26 :27 :28 :29 :30 :31 :32 :33 :34 :35 :36 :37 :38 :39 |
|
#ls -al
итого 205464 drwxr-xr-x 10 root root 4096 Июн 3 14:23 . drwxr-xr-x 22 root root 4096 Май 26 10:24 .. -rw------- 1 root root 10392 Июн 3 12:57 .bash_history -rw-r--r-- 1 root root 21 Май 25 09:34 .bash_profile -rw-r--r-- 1 root root 450 Май 25 09:34 .bashrc drwxr-xr-x 2 root root 4096 Май 30 12:24 data ---x--x--x 1 root root 420 Май 27 11:40 date05.log -rw-rw-r-- 1 root root 2 Май 28 16:26 date2.log -rw-r--r-- 1 root root 1350 Май 28 17:53 date.log ... -rw-r--r-- 1 root root 271894 Май 29 10:18 screen.png -rw-r--r-- 1 root root 3984 Май 25 17:25 .screenrc -rw-rw---- 1 root root 31 Май 27 10:34 .sendxmpp -rw------- 1 root root 32 Май 27 11:12 .sendxmpprc drwxr-xr-x 2 root root 4096 Июн 3 10:48 .ssh -rwxr--r-- 1 root root 184 Май 28 14:53 userad drwxr-xr-x 2 root root 4096 Май 26 10:07 .vim -rw------- 1 root root 12593 Июн 3 12:07 .viminfo -rw-r--r-- 1 root root 51 Май 25 16:51 .vimrc -rw------- 1 root root 52 Июн 3 14:23 .Xauthority |
#vi .vimrc
|
#~ +q436f+q6b75+q6b64+q6b72+q6b6c+q2332+q2334+q2569+q2a37+q6b31
a boot etc initrd.img lost+found mnt proc sbin srv tmp var bin dev home lib media opt root selinux sys usr vmlinuz |
#dmesg
[ 1.360508] usb usb5: SerialNumber: 0000:00:1d.0 [ 1.360611] usb usb5: configuration #1 chosen from 1 choice [ 1.360686] hub 5-0:1.0: USB hub found [ 1.360746] hub 5-0:1.0: 2 ports detected [ 1.360880] uhci_hcd 0000:00:1d.1: PCI INT B -> GSI 20 (level, low) -> IRQ 20 [ 1.360946] uhci_hcd 0000:00:1d.1: setting latency timer to 64 [ 1.360948] uhci_hcd 0000:00:1d.1: UHCI Host Controller [ 1.361019] uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 6 [ 1.361122] uhci_hcd 0000:00:1d.1: irq 20, io base 0x0000d400 [ 1.361208] usb usb6: New USB device found, idVendor=1d6b, idProduct=0001 ... [ 10.453360] NET: Registered protocol family 10 [ 10.453871] lo: Disabled Privacy Extensions [ 16.241629] [drm] Initialized drm 1.1.0 20060810 [ 16.248833] pci 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [ 16.248839] pci 0000:00:02.0: setting latency timer to 64 [ 16.249872] mtrr: type mismatch for c0000000,10000000 old: write-back new: write-combining [ 16.249877] [drm] MTRR allocation failed. Graphics performance may suffer. [ 16.249908] pci 0000:00:02.0: irq 27 for MSI/MSI-X [ 16.249926] [drm] Initialized i915 1.6.0 20080730 on minor 0 [ 21.232008] eth0: no IPv6 routers present |
#ssh quiz@10.0.35.100
-----------------------------------------------------------------[39/39]----- Вы создали файловую систему и теперь хотите, чтобы она автоматически монтировалась при загрузке. В каком файле вам необходимо создать запись о ней? 1. /etc/mtab 2. /etc/vmtab 3. /etc/fstab 4. /etc/inittab 5. /etc/default/fs 6. /etc/default/mount --------------------------------------------------------------------------- 3 Your score: 31 Connection to 10.0.35.100 closed. |
#vi /etc/network/interfaces
--- /tmp/l3-saved-30944.9202.12317 2009-06-03 16:59:53.000000000 +0300 +++ /etc/network/interfaces 2009-06-03 17:00:07.000000000 +0300 @@ -10,6 +10,6 @@ network 192.168.15.0 broadcast 192.168.15.255 gateway 192.168.15.254 -#vconfig add eth0.105 -#ifconfig eth0.105 192.168.105.1 +vconfig add eth0.105 +ifconfig eth0.105 192.168.105.1 |
#ssh 10.0.35.100
Host key fingerprint is 69:b5:3e:1a:9a:b7:c3:c3:96:03:c7:b7:b4:69:1d:3b +--[ RSA 2048]----+ | | | | | . | | o . | | .S . | | ..o.o . | | =.+o= o | | oXo=.E | | ooo* . | +-----------------+ root@10.0.35.100's password: Linux linux0 2.6.18-6-xen-686 #1 SMP Sun Feb 10 22:43:13 UTC 2008 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 Jun 3 17:14:16 2009 from linux5.unix.nt l3-agent is already running: pid=4804; pidfile=/root/.lilalo/l3-agent.pid |
#ssh 192.168.15.254
Host key fingerprint is 7e:ed:6a:01:cb:0b:a2:37:07:c5:64:c0:e0:23:f1:e4 +--[ RSA 896]----+ |. oo.. | | * . o | |. E + | | . . o . | | . .So | | o ..o .. | | . o ...... | | . o . .... | | . o .... | +-----------------+ We'd like to keep you up to date about: * Software feature updates * New product announcements * Special events Please register your products now at: www.ProCurve.com root@192.168.15.254's password: Received disconnect from 192.168.15.254: 2: Sorry, the maximum number of sessions are active. Try again later. |
#ssh 192.168.15.254
Host key fingerprint is 7e:ed:6a:01:cb:0b:a2:37:07:c5:64:c0:e0:23:f1:e4 +--[ RSA 896]----+ |. oo.. | | * . o | |. E + | | . . o . | | . .So | | o ..o .. | | . o ...... | | . o . .... | | . o .... | +-----------------+ We'd like to keep you up to date about: * Software feature updates * New product announcements * Special events Please register your products now at: www.ProCurve.com root@192.168.15.254's password: Received disconnect from 192.168.15.254: 2: Sorry, the maximum number of sessions are active. Try again later. |
#ssh 192.168.15.254
Connection to 192.168.15.254 closed by remote host. |
# 19
6 iface lo inet loopback 7 iface eth0 inet static 8 address 192.168.15.9 9 netmask 255.255.255.0 10 network 192.168.15.0 #vconfig add eth0.105 11 #ifconfig eth0.105 192.168.105.1 12 gateway 192.168.15.254 ~ ~ ~ ~ ~ ~ ~ "/etc/network/interfaces" 15L, 372C записано |
#vconfig add eth0 105
WARNING: Could not open /proc/net/vlan/config. Maybe you need to load the 8021q module, or maybe you are not using PROCFS?? Added VLAN with VID == 105 to IF -:eth0:- |
#vconfig add eth0.105
ERROR: trying to add VLAN #0 to IF -:eth0.105:- error: Network is down |
#vconfig
Expecting argc to be 3-5, inclusive. Was: 1 Usage: add [interface-name] [vlan_id] rem [vlan-name] set_flag [interface-name] [flag-num] [0 | 1] set_egress_map [vlan-name] [skb_priority] [vlan_qos] set_ingress_map [vlan-name] [skb_priority] [vlan_qos] set_name_type [name-type] * The [interface-name] is the name of the ethernet card that hosts the VLAN you are talking about. * The vlan_id is the identifier (0-4095) of the VLAN you are operating on. * skb_priority is the priority in the socket buffer (sk_buff). * vlan_qos is the 3 bit priority in the VLAN header * name-type: VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5) * FLAGS: 1 REORDER_HDR When this is set, the VLAN device will move the ethernet header around to make it look exactly like a real ethernet device. This may help programs such as DHCPd which read the raw ethernet packet and make assumptions about the location of bytes. If you don't need it, don't turn it on, because there will be at least a small performance degradation. Default is OFF. |
#vconfig add eth0.105
ERROR: trying to add VLAN #0 to IF -:eth0.105:- error: Network is down |
#vconfig add eth0 105
ERROR: trying to add VLAN #105 to IF -:eth0:- error: File exists |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:53766 errors:0 dropped:0 overruns:0 frame:0 TX packets:45799 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:37207342 (35.4 MiB) TX bytes:6540741 (6.2 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a BROADCAST MULTICAST MTU:1500 Metric:1 ... collisions:0 txqueuelen:0 RX bytes:966 (966.0 B) TX bytes:0 (0.0 B) 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:43 errors:0 dropped:0 overruns:0 frame:0 TX packets:43 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:7773 (7.5 KiB) TX bytes:7773 (7.5 KiB) |
#vconfig add eth0 205
Added VLAN with VID == 205 to IF -:eth0:- |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:53785 errors:0 dropped:0 overruns:0 frame:0 TX packets:45806 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:37208700 (35.4 MiB) TX bytes:6542975 (6.2 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a BROADCAST MULTICAST MTU:1500 Metric:1 ... collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 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:43 errors:0 dropped:0 overruns:0 frame:0 TX packets:43 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:7773 (7.5 KiB) TX bytes:7773 (7.5 KiB) |
#ifconfig eth0.105 192.168.105.1
|
#ifconfig eth0.205 192.168.205.2
|
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:53843 errors:0 dropped:0 overruns:0 frame:0 TX packets:45853 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:37213327 (35.4 MiB) TX bytes:6550044 (6.2 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 ... collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:238 (238.0 B) 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:43 errors:0 dropped:0 overruns:0 frame:0 TX packets:43 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:7773 (7.5 KiB) TX bytes:7773 (7.5 KiB) |
#ifconfig -a | more
|
#ping 192.168.105.2
PING 192.168.105.2 (192.168.105.2) 56(84) bytes of data. 64 bytes from 192.168.105.2: icmp_seq=1 ttl=64 time=1.07 ms 64 bytes from 192.168.105.2: icmp_seq=2 ttl=64 time=1.09 ms 64 bytes from 192.168.105.2: icmp_seq=3 ttl=64 time=1.11 ms 64 bytes from 192.168.105.2: icmp_seq=4 ttl=64 time=1.10 ms ^C --- 192.168.105.2 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min/avg/max/mdev = 1.072/1.095/1.112/0.028 ms |
#ping 192.168.205.1
PING 192.168.205.1 (192.168.205.1) 56(84) bytes of data. 64 bytes from 192.168.205.1: icmp_seq=1 ttl=64 time=0.574 ms 64 bytes from 192.168.205.1: icmp_seq=2 ttl=64 time=0.564 ms 64 bytes from 192.168.205.1: icmp_seq=3 ttl=64 time=0.561 ms 64 bytes from 192.168.205.1: icmp_seq=4 ttl=64 time=0.723 ms ^C --- 192.168.205.1 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 2999ms rtt min/avg/max/mdev = 0.561/0.605/0.723/0.072 ms |
#ping 192.168.202.1
PING 192.168.202.1 (192.168.202.1) 56(84) bytes of data. 64 bytes from 192.168.202.1: icmp_seq=1 ttl=64 time=0.562 ms 64 bytes from 192.168.202.1: icmp_seq=2 ttl=64 time=0.572 ms ^C --- 192.168.202.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.562/0.567/0.572/0.005 ms |
#ping 192.168.202.2
PING 192.168.202.2 (192.168.202.2) 56(84) bytes of data. 64 bytes from 192.168.202.2: icmp_seq=1 ttl=64 time=3.47 ms ^C --- 192.168.202.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 3.477/3.477/3.477/0.000 ms |
#ping 192.168.102.1
PING 192.168.102.1 (192.168.102.1) 56(84) bytes of data. ^C --- 192.168.102.1 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 999ms |
#ping 192.168.102.2
PING 192.168.102.2 (192.168.102.2) 56(84) bytes of data. ^C --- 192.168.102.2 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
#vconfig add eth0 105
ERROR: trying to add VLAN #105 to IF -:eth0:- error: File exists |
#vconfig add eth0.105
ERROR: trying to add VLAN #0 to IF -:eth0.105:- error: File exists |
#ping 192.168.102.1
PING 192.168.102.1 (192.168.102.1) 56(84) bytes of data. ^C --- 192.168.102.1 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1006ms |
#ping 192.168.102.2
PING 192.168.102.2 (192.168.102.2) 56(84) bytes of data. ^C --- 192.168.102.2 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
#apt-get install openvpn
Чтение списков пакетов... Готово Построение дерева зависимостей Чтение информации о состоянии... Готово Уже установлена самая новая версия openvpn. Следующие пакеты устанавливались автоматически и больше не требуются: portmap Для их удаления используйте 'apt-get autoremove'. обновлено 0, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 59 пакетов не обновлено. |
#ssh root@10.0.35.100
Host key fingerprint is 69:b5:3e:1a:9a:b7:c3:c3:96:03:c7:b7:b4:69:1d:3b +--[ RSA 2048]----+ | | | | | . | | o . | | .S . | | ..o.o . | | =.+o= o | | oXo=.E | | ooo* . | +-----------------+ root@10.0.35.100's password: Linux linux0 2.6.18-6-xen-686 #1 SMP Sun Feb 10 22:43:13 UTC 2008 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 Jun 3 18:02:28 2009 from linux1.unix.nt l3-agent is already running: pid=4804; pidfile=/root/.lilalo/l3-agent.pid |
#ls -al /etc/openvpn
итого 12 drwxr-xr-x 2 root root 4096 Июн 3 14:48 . drwxr-xr-x 96 root root 4096 Июн 3 14:48 .. -rwxr-xr-x 1 root root 1352 Май 1 15:25 update-resolv-conf |
#ping 10.0.35.100
PING 10.0.35.100 (10.0.35.100) 56(84) bytes of data. 64 bytes from 10.0.35.100: icmp_seq=1 ttl=63 time=0.231 ms 64 bytes from 10.0.35.100: icmp_seq=2 ttl=63 time=0.233 ms ^C --- 10.0.35.100 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.231/0.232/0.233/0.001 ms |
#ip route
192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.9 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 default via 192.168.15.254 dev eth0 |
#openvpn --genkey --secret linux9.key
|
#cd /etc/openvpn
|
#ls
update-resolv-conf |
#ls -l
итого 4 -rwxr-xr-x 1 root root 1352 Май 1 15:25 update-resolv-conf |
#openvpn --genkey --secret linux0.key
|
#vi server.conf
--- /dev/null 2009-06-03 09:32:25.504617420 +0300 +++ server.conf 2009-06-03 18:02:49.000000000 +0300 @@ -0,0 +1,6 @@ +port 443 +proto tcp-server +dev tun +ifconfig 172.16.1.5 172.16.1.6 +secret linux9.key + |
#ls -l /etc/openvpn/
итого 8 -rw------- 1 root root 636 Июн 3 17:57 linux0.key -rwxr-xr-x 1 root root 1352 Май 1 15:25 update-resolv-conf |
#ls -l /etc/openvpn/
итого 12 -rw------- 1 root root 636 Июн 3 18:03 linux9.key -rw-r--r-- 1 root root 84 Июн 3 18:02 server.conf -rwxr-xr-x 1 root root 1352 Май 1 15:25 update-resolv-conf |
#ls -l
итого 8 -rw-r--r-- 1 root root 84 Июн 3 18:02 server.conf -rwxr-xr-x 1 root root 1352 Май 1 15:25 update-resolv-conf |
#openvpn --genkey --secret linux9.key
|
#scp /etc/openvpn/linux9.key 192.168.206.2:/etc/openvpn/
The authenticity of host '192.168.206.2 (192.168.206.2)' can't be established. RSA key fingerprint is 34:6c:c2:da:38:7c:d7:17:e9:cd:17:8d:e7:cf:f1:a6. +--[ RSA 2048]----+ | | | . . . ..| | o = o ..o| | . + + o . + o.| | = o S . o o.o| | o . . o+| | =| | o | | E | +-----------------+ Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.206.2' (RSA) to the list of known hosts. root@192.168.206.2's password: Agent pid 1695 |
#scp /etc/openvpn/linux9.key 192.168.206.2:/etc/openvpn
Host key fingerprint is 34:6c:c2:da:38:7c:d7:17:e9:cd:17:8d:e7:cf:f1:a6 +--[ RSA 2048]----+ | | | . . . ..| | o = o ..o| | . + + o . + o.| | = o S . o o.o| | o . . o+| | =| | o | | E | +-----------------+ root@192.168.206.2's password: Permission denied, please try again. root@192.168.206.2's password: Agent pid 1695 |
#nmap
Nmap 4.68 ( http://nmap.org ) Usage: nmap [Scan Type(s)] [Options] {target specification} TARGET SPECIFICATION: Can pass hostnames, IP addresses, networks, etc. Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254 -iL <inputfilename>: Input from list of hosts/networks -iR <num hosts>: Choose random targets --exclude <host1[,host2][,host3],...>: Exclude hosts/networks --excludefile <exclude_file>: Exclude list from file HOST DISCOVERY: ... --send-eth/--send-ip: Send using raw ethernet frames or IP packets --privileged: Assume that the user is fully privileged --unprivileged: Assume the user lacks raw socket privileges -V: Print version number -h: Print this help summary page. EXAMPLES: nmap -v -A scanme.nmap.org nmap -v -sP 192.168.0.0/16 10.0.0.0/8 nmap -v -iR 10000 -PN -p 80 SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES |
#nmap 192.168.205.2
Starting Nmap 4.68 ( http://nmap.org ) at 2009-06-03 18:06 EEST Interesting ports on 192.168.205.2: Not shown: 1711 closed ports PORT STATE SERVICE 22/tcp open ssh 110/tcp open pop3 111/tcp open rpcbind 9999/tcp open abyss Nmap done: 1 IP address (1 host up) scanned in 0.191 seconds |
#/etc/init.d/openvpn restart
Stopping virtual private network daemon:. Starting virtual private network daemon: server. |
#ifconfig -a | more
|
#ping 172.16.1.5
PING 172.16.1.5 (172.16.1.5) 56(84) bytes of data. 64 bytes from 172.16.1.5: icmp_seq=1 ttl=64 time=0.021 ms 64 bytes from 172.16.1.5: icmp_seq=2 ttl=64 time=0.027 ms ^C --- 172.16.1.5 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.021/0.024/0.027/0.003 ms |
#scp linux9.key 192.168.206.2:/etc/openvpn
Host key fingerprint is 34:6c:c2:da:38:7c:d7:17:e9:cd:17:8d:e7:cf:f1:a6 +--[ RSA 2048]----+ | | | . . . ..| | o = o ..o| | . + + o . + o.| | = o S . o o.o| | o . . o+| | =| | o | | E | +-----------------+ root@192.168.206.2's password: Agent pid 1695 |
#~
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:56724 errors:0 dropped:0 overruns:0 frame:0 TX packets:48462 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:37560802 (35.8 MiB) TX bytes:6868293 (6.5 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 ... UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:793 errors:0 dropped:0 overruns:0 frame:0 TX packets:24 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:72281 (70.5 KiB) TX bytes:2064 (2.0 KiB) eth0.105.0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a BROADCAST MULTICAST MTU:1500 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 |
#ping eth0.105
ping: unknown host eth0.105 |
#ifconfig -a | more
|
#cat /proc/sys/net/ipv4/ip_forward
1 |
#tail -f /var/log/daemon.log
Jun 3 09:32:54 linux9 console-kit-daemon[2910]: WARNING: Couldn't read /proc/2909/environ: Failed to open file '/proc/2909/environ': No such file or directory Jun 3 09:35:39 linux9 monit[3112]: Monit has not changed Jun 3 15:39:15 linux9 console-kit-daemon[2910]: WARNING: Unable to activate console: No such device or address Jun 3 16:28:04 linux9 console-kit-daemon[2910]: WARNING: Unable to activate console: No such device or address Jun 3 18:07:33 linux9 ovpn-server[494]: OpenVPN 2.1_rc15 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on May 1 2009 Jun 3 18:07:33 linux9 ovpn-server[494]: NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables Jun 3 18:07:33 linux9 ovpn-server[494]: /usr/sbin/openvpn-vulnkey -q linux9.key Jun 3 18:07:34 linux9 ovpn-server[494]: TUN/TAP device tun0 opened Jun 3 18:07:34 linux9 ovpn-server[494]: /sbin/ifconfig tun0 172.16.1.5 pointopoint 172.16.1.6 mtu 1500 Jun 3 18:07:34 linux9 ovpn-server[504]: Listening for incoming TCP connection on [undef]:443 Jun 3 18:21:05 linux9 ovpn-server[504]: TCP connection established with 192.168.206.2:40164 Jun 3 18:21:05 linux9 ovpn-server[504]: TCPv4_SERVER link local (bound): [undef]:443 Jun 3 18:21:05 linux9 ovpn-server[504]: TCPv4_SERVER link remote: 192.168.206.2:40164 Jun 3 18:21:15 linux9 ovpn-server[504]: Peer Connection Initiated with 192.168.206.2:40164 Jun 3 18:21:15 linux9 ovpn-server[504]: WARNING: 'ifconfig' is present in local config but missing in remote config, local='ifconfig 172.16.1.5 172.16.1.6' Jun 3 18:21:16 linux9 ovpn-server[504]: Initialization Sequence Completed Jun 3 18:21:48 linux9 ovpn-server[504]: Connection reset, restarting [0] Jun 3 18:21:48 linux9 ovpn-server[504]: /sbin/ifconfig tun0 0.0.0.0 Jun 3 18:21:48 linux9 ovpn-server[504]: SIGUSR1[soft,connection-reset] received, process restarting ^C |
#tail -f /var/log/daemon.log
Jun 3 18:21:48 linux9 ovpn-server[504]: /sbin/ifconfig tun0 0.0.0.0 Jun 3 18:21:48 linux9 ovpn-server[504]: SIGUSR1[soft,connection-reset] received, process restarting Jun 3 18:21:49 linux9 ovpn-server[504]: NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables Jun 3 18:21:49 linux9 ovpn-server[504]: /usr/sbin/openvpn-vulnkey -q linux9.key Jun 3 18:21:49 linux9 ovpn-server[504]: TUN/TAP device tun0 opened Jun 3 18:21:49 linux9 ovpn-server[504]: /sbin/ifconfig tun0 172.16.1.5 pointopoint 172.16.1.6 mtu 1500 Jun 3 18:21:49 linux9 ovpn-server[504]: Listening for incoming TCP connection on [undef]:443 Jun 3 18:21:55 linux9 ovpn-server[504]: TCP connection established with 192.168.206.2:40188 Jun 3 18:21:55 linux9 ovpn-server[504]: TCPv4_SERVER link local (bound): [undef]:443 Jun 3 18:21:55 linux9 ovpn-server[504]: TCPv4_SERVER link remote: 192.168.206.2:40188 ... Jun 3 18:22:25 linux9 ovpn-server[504]: /usr/sbin/openvpn-vulnkey -q linux9.key Jun 3 18:22:25 linux9 ovpn-server[504]: TUN/TAP device tun0 opened Jun 3 18:22:25 linux9 ovpn-server[504]: /sbin/ifconfig tun0 172.16.1.5 pointopoint 172.16.1.6 mtu 1500 Jun 3 18:22:25 linux9 ovpn-server[504]: Listening for incoming TCP connection on [undef]:443 Jun 3 18:22:26 linux9 ovpn-server[504]: TCP connection established with 192.168.206.2:40217 Jun 3 18:22:26 linux9 ovpn-server[504]: TCPv4_SERVER link local (bound): [undef]:443 Jun 3 18:22:26 linux9 ovpn-server[504]: TCPv4_SERVER link remote: 192.168.206.2:40217 Jun 3 18:22:36 linux9 ovpn-server[504]: Peer Connection Initiated with 192.168.206.2:40217 Jun 3 18:22:36 linux9 ovpn-server[504]: Initialization Sequence Completed ^C |
#ping 172.16.1.6
PING 172.16.1.6 (172.16.1.6) 56(84) bytes of data. 64 bytes from 172.16.1.6: icmp_seq=1 ttl=64 time=0.588 ms 64 bytes from 172.16.1.6: icmp_seq=2 ttl=64 time=0.338 ms ^C --- 172.16.1.6 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.338/0.463/0.588/0.125 ms |
#ping 192.168.207.1
PING 192.168.207.1 (192.168.207.1) 56(84) bytes of data. 64 bytes from 192.168.207.1: icmp_seq=1 ttl=64 time=0.554 ms 64 bytes from 192.168.207.1: icmp_seq=2 ttl=64 time=0.564 ms ^C --- 192.168.207.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.554/0.559/0.564/0.005 ms |
#ping 192.168.207.2
PING 192.168.207.2 (192.168.207.2) 56(84) bytes of data. 64 bytes from 192.168.207.2: icmp_seq=1 ttl=64 time=2.64 ms 64 bytes from 192.168.207.2: icmp_seq=2 ttl=64 time=0.228 ms ^C --- 192.168.207.2 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.228/1.435/2.642/1.207 ms |
#ping 192.168.107.1
PING 192.168.107.1 (192.168.107.1) 56(84) bytes of data. ^C --- 192.168.107.1 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1008ms |
#ping 192.168.107.2
PING 192.168.107.2 (192.168.107.2) 56(84) bytes of data. ^C --- 192.168.107.2 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
#ping 172.16.1.6
PING 172.16.1.6 (172.16.1.6) 56(84) bytes of data. 64 bytes from 172.16.1.6: icmp_seq=1 ttl=64 time=0.561 ms 64 bytes from 172.16.1.6: icmp_seq=2 ttl=64 time=0.336 ms ^C --- 172.16.1.6 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.336/0.448/0.561/0.114 ms |
#ping 172.16.1.5
PING 172.16.1.5 (172.16.1.5) 56(84) bytes of data. 64 bytes from 172.16.1.5: icmp_seq=1 ttl=64 time=0.024 ms ^C --- 172.16.1.5 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.024/0.024/0.024/0.000 ms |
#ping 172.16.1.6
PING 172.16.1.6 (172.16.1.6) 56(84) bytes of data. 64 bytes from 172.16.1.6: icmp_seq=1 ttl=64 time=0.587 ms 64 bytes from 172.16.1.6: icmp_seq=2 ttl=64 time=0.335 ms ^C --- 172.16.1.6 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.335/0.461/0.587/0.126 ms |
#ifconfig -a | more
|
#ip route add 192.168.106.0/24 dev tun0
|
#ip route
172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.9 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 192.168.106.0/24 dev tun0 scope link default via 192.168.15.254 dev eth0 |
#ip route delete 192.168.106.0/24 dev tun0
RTNETLINK answers: No such process |
#ping 192.168.106.1
PING 192.168.106.1 (192.168.106.1) 56(84) bytes of data. ^C --- 192.168.106.1 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 999ms |
#ip route
192.168.106.0 via 172.16.1.6 dev tun0 172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.9 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 default via 192.168.15.254 dev eth0 |
#man ip route
|
#ping 192.168.106.1
PING 192.168.106.1 (192.168.106.1) 56(84) bytes of data. ^C --- 192.168.106.1 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 999ms |
#route delete default
|
#ip route
192.168.106.0 via 172.16.1.6 dev tun0 172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.9 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 |
#ping 192.168.106.1
connect: Network is unreachable |
#ip route
192.168.106.0 via 172.16.1.6 dev tun0 172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.9 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 |
#route delete 192.168.15.0/24
route: netmask 000000ff doesn't make sense with host route Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables route [-v] [-FC] {add|del|flush} ... Modify routing table for AF. route {-h|--help} [<AF>] Detailed usage syntax for specified AF. route {-V|--version} Display version/author and exit. -v, --verbose be verbose -n, --numeric don't resolve names -e, --extend display other/more information -F, --fib display Forwarding Information Base (default) -C, --cache display routing cache instead of FIB <AF>=Use '-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) |
#route delete 192.168.15.0/24 dev eth0
route: netmask 000000ff doesn't make sense with host route Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables route [-v] [-FC] {add|del|flush} ... Modify routing table for AF. route {-h|--help} [<AF>] Detailed usage syntax for specified AF. route {-V|--version} Display version/author and exit. -v, --verbose be verbose -n, --numeric don't resolve names -e, --extend display other/more information -F, --fib display Forwarding Information Base (default) -C, --cache display routing cache instead of FIB <AF>=Use '-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) |
#ip route
192.168.106.0 via 172.16.1.6 dev tun0 172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.9 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 |
#ip route
e link src 192.168.15./etc/init.d/openvpn restart Stopping virtual private network daemon: server. Starting virtual private network daemon: server. |
#ping 192.168.106.1
connect: Network is unreachable |
#ip route
e link src 192.168.15.ip route add 192.168.106.0/24 dev tun0 |
#ip route
192.168.106.0 via 172.16.1.6 dev tun0 172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.9 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 192.168.106.0/24 dev tun0 scope link |
#route delete 192.168.106.0/24 dev tun0 scope link
Usage: inet_route [-vF] del {-host|-net} Target[/prefix] [gw Gw] [metric M] [[dev] If] inet_route [-vF] add {-host|-net} Target[/prefix] [gw Gw] [metric M] [netmask N] [mss Mss] [window W] [irtt I] [mod] [dyn] [reinstate] [[dev] If] inet_route [-vF] add {-host|-net} Target[/prefix] [metric M] reject inet_route [-FC] flush NOT supported |
#route delete 192.168.106.0/24 dev tun0
route: netmask 000000ff doesn't make sense with host route Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables route [-v] [-FC] {add|del|flush} ... Modify routing table for AF. route {-h|--help} [<AF>] Detailed usage syntax for specified AF. route {-V|--version} Display version/author and exit. -v, --verbose be verbose -n, --numeric don't resolve names -e, --extend display other/more information -F, --fib display Forwarding Information Base (default) -C, --cache display routing cache instead of FIB <AF>=Use '-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) |
#route delete 192.168.106.0 via 172.16.1.6 dev tun0
Usage: inet_route [-vF] del {-host|-net} Target[/prefix] [gw Gw] [metric M] [[dev] If] inet_route [-vF] add {-host|-net} Target[/prefix] [gw Gw] [metric M] [netmask N] [mss Mss] [window W] [irtt I] [mod] [dyn] [reinstate] [[dev] If] inet_route [-vF] add {-host|-net} Target[/prefix] [metric M] reject inet_route [-FC] flush NOT supported |
1
Время первой команды журнала | 15:05:30 2009- 6- 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 18:36:24 2009- 6- 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 27.72 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.03 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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