/l3/users/13-02-2012/NT-Lnet/debian1.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 |
|
#ssh root@192.168.168.1
Password: Last login: Wed Feb 15 14:13:09 2012 from 192.168.64.1 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.4-RELEASE (GENERIC) #1: Sun Feb 12 15:17:17 EET 2012 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section for your release first as it's updated frequently. ... http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the questions@FreeBSD.org mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. Removing stale pidfile |
#iptables -D INPUT 4
|
#iptables -A INPUT -i eth2 -p tcp --syn -j DROP
|
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:ssh ACCEPT tcp -- anywhere anywhere tcp dpt:www ACCEPT tcp -- anywhere anywhere tcp dpt:echo DROP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK/SYN Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#nmap 192.168.16.16
Starting Nmap 5.00 ( http://nmap.org ) at 2012-02-15 15:42 EET Interesting ports on 192.168.16.16: Not shown: 996 closed ports PORT STATE SERVICE 7/tcp open echo 19/tcp open chargen 22/tcp open ssh 111/tcp open rpcbind Nmap done: 1 IP address (1 host up) scanned in 1.44 seconds |
#ipfw list
bash: ipfw: команда не найдена |
#nmap 192.168.168.5
Starting Nmap 5.00 ( http://nmap.org ) at 2012-02-15 15:42 EET Interesting ports on 192.168.168.5: Not shown: 996 closed ports PORT STATE SERVICE 7/tcp open echo 19/tcp open chargen 22/tcp open ssh 111/tcp open rpcbind Nmap done: 1 IP address (1 host up) scanned in 0.35 seconds |
#nmap 127.0.0.1
Starting Nmap 5.00 ( http://nmap.org ) at 2012-02-15 15:43 EET Interesting ports on localhost.localdomain (127.0.0.1): Not shown: 995 closed ports PORT STATE SERVICE 7/tcp open echo 19/tcp open chargen 22/tcp open ssh 25/tcp open smtp 111/tcp open rpcbind Nmap done: 1 IP address (1 host up) scanned in 0.24 seconds |
#Write failed: Broken pipe
|
#ssh 192.168.168.5
ssh: connect to host 192.168.168.5 port 22: Connection timed out |
#netstat -nlp
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:37684 0.0.0.0:* LISTEN 796/rpc.statd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1085/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1284/exim4 tcp 0 0 0.0.0.0:55555 0.0.0.0:* LISTEN 5295/xinetd tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 784/portmap tcp6 0 0 :::22 :::* LISTEN 1085/sshd tcp6 0 0 :::23 :::* LISTEN 5295/xinetd tcp6 0 0 ::1:25 :::* LISTEN 1284/exim4 udp 0 0 0.0.0.0:972 0.0.0.0:* 796/rpc.statd udp 0 0 0.0.0.0:111 0.0.0.0:* 784/portmap udp 0 0 0.0.0.0:54422 0.0.0.0:* 796/rpc.statd Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 3351 973/acpid /var/run/acpid.socket |
#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 |
#ssh 192.168.168.5
root@192.168.168.5's password: Linux debian3 2.6.32-5-686 #1 SMP Fri Sep 9 20:51:05 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: Wed Feb 15 15:39:15 2012 from 192.168.0.254 l3-agent is already running: pid=1362; pidfile=/root/.lilalo/l3-agent.pid l3-agent is already running: pid=1362; pidfile=/root/.lilalo/l3-agent.pid |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:ssh ACCEPT tcp -- anywhere anywhere tcp dpt:www ACCEPT tcp -- anywhere anywhere tcp dpt:echo DROP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK/SYN Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -L -S
iptables v1.4.8: Cannot use -E with -L Try `iptables -h' or 'iptables --help' for more information. |
#iptables -L -list-rules
iptables v1.4.8: option `-L' requires an argument Try `iptables -h' or 'iptables --help' for more information. |
#iptables -list-rules
iptables v1.4.8: option `iptables' requires an argument Try `iptables -h' or 'iptables --help' for more information. |
#iptables -L --list-rules
iptables v1.4.8: Cannot use -E with -L Try `iptables -h' or 'iptables --help' for more information. |
#iptables --list-rules
-P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT -A INPUT -i eth2 -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -i eth2 -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -i eth2 -p tcp -m tcp --dport 7 -j ACCEPT -A INPUT -i eth2 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j DROP |
#iptables -F
|
#iptables --list-rules
-P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT |
#iptables -t nat -L -n
Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- 192.168.64.0/24 0.0.0.0/0 Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#ssh root@192.168.64.150
The authenticity of host '192.168.64.150 (192.168.64.150)' can't be established. RSA key fingerprint is 3e:c3:8c:6f:e8:92:5b:31:dd:04:d2:51:48:57:c9:99. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.64.150' (RSA) to the list of known hosts. root@192.168.64.150's password: Linux debian2 2.6.32-5-686 #1 SMP Fri Sep 9 20:51:05 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: Wed Feb 15 15:42:13 2012 from 192.168.13.253 l3-agent is already running: pid=1322; pidfile=/root/.lilalo/l3-agent.pid l3-agent is already running: pid=1322; pidfile=/root/.lilalo/l3-agent.pid |
#iptables -A INPUT -i eth1 -p tcp --dport 7 -j ACCEPT
|
#iptables -A INPUT -i eth1 -p tcp -j DROP
|
#nmap 192.168.168.5
Starting Nmap 5.00 ( http://nmap.org ) at 2012-02-15 15:50 EET Interesting ports on 192.168.168.5: Not shown: 995 closed ports PORT STATE SERVICE 7/tcp open echo 19/tcp open chargen 22/tcp open ssh 80/tcp filtered http 111/tcp open rpcbind Nmap done: 1 IP address (1 host up) scanned in 9.55 seconds |
#apt-get install nmap
Чтение списков пакетов... Готово Построение дерева зависимостей Чтение информации о состоянии... Готово Уже установлена самая новая версия nmap. обновлено 0, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 54 пакетов не обновлено. |
#nmap 192.168.64.150
Starting Nmap 5.00 ( http://nmap.org ) at 2012-02-15 15:50 EET Interesting ports on 192.168.64.150: Not shown: 998 filtered ports PORT STATE SERVICE 22/tcp open ssh 80/tcp closed http MAC Address: 00:16:3E:00:01:02 (Xensource) Nmap done: 1 IP address (1 host up) scanned in 5.22 seconds |
#nmap 192.168.168.5
Starting Nmap 5.00 ( http://nmap.org ) at 2012-02-15 15:50 EET Interesting ports on 192.168.168.5: Not shown: 998 filtered ports PORT STATE SERVICE 7/tcp open echo 22/tcp open ssh Nmap done: 1 IP address (1 host up) scanned in 25.89 seconds |
#netstat -nlp
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:19 0.0.0.0:* LISTEN 2917/xinetd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1066/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1248/exim4 tcp 0 0 0.0.0.0:37 0.0.0.0:* LISTEN 2917/xinetd tcp 0 0 0.0.0.0:57701 0.0.0.0:* LISTEN 764/rpc.statd tcp 0 0 0.0.0.0:7 0.0.0.0:* LISTEN 2917/xinetd tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 752/portmap tcp6 0 0 :::22 :::* LISTEN 1066/sshd tcp6 0 0 ::1:25 :::* LISTEN 1248/exim4 tcp6 0 0 :::110 :::* LISTEN 2917/xinetd udp 0 0 0.0.0.0:111 0.0.0.0:* 752/portmap udp 0 0 0.0.0.0:49278 0.0.0.0:* 764/rpc.statd udp 0 0 0.0.0.0:9 0.0.0.0:* 2917/xinetd udp 0 0 0.0.0.0:940 0.0.0.0:* 764/rpc.statd Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 3375 944/acpid /var/run/acpid.socket |
#netstat -nL |less
|
#netstat -nl |less
|
#telnet 192.168.168.5 7
Trying 192.168.168.5... Connected to 192.168.168.5. Escape character is '^]'. exo exo ^] telnet> quit Connection closed. |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:www ACCEPT tcp -- anywhere anywhere tcp dpt:ssh DROP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK/SYN Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#nc -l -p 80
^C |
#exit
exit Connection to 192.168.64.150 closed. |
#ssh root@192.168.168.1
Password: Last login: Wed Feb 15 17:42:22 2012 from 192.168.64.1 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.4-RELEASE (GENERIC) #1: Sun Feb 12 15:17:17 EET 2012 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section for your release first as it's updated frequently. ... http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the questions@FreeBSD.org mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. Removing stale pidfile |
#ping ya.ru
PING ya.ru (77.88.21.3) 56(84) bytes of data. 64 bytes from www.yandex.ru (77.88.21.3): icmp_req=1 ttl=57 time=22.7 ms 64 bytes from www.yandex.ru (77.88.21.3): icmp_req=2 ttl=57 time=28.0 ms ^C --- ya.ru ping statistics --- 3 packets transmitted, 2 received, 33% packet loss, time 2003ms rtt min/avg/max/mdev = 22.734/25.370/28.007/2.641 ms |
#nmap 192.168.168.5
Starting Nmap 5.00 ( http://nmap.org ) at 2012-02-15 15:57 EET Interesting ports on 192.168.168.5: Not shown: 996 closed ports PORT STATE SERVICE 7/tcp open echo 19/tcp open chargen 22/tcp open ssh 111/tcp open rpcbind Nmap done: 1 IP address (1 host up) scanned in 1.09 seconds |
#vim /etc/
|
#nmap 192.168.64.150
Starting Nmap 5.00 ( http://nmap.org ) at 2012-02-15 16:00 EET Interesting ports on 192.168.64.150: Not shown: 998 filtered ports PORT STATE SERVICE 22/tcp open ssh 80/tcp closed http MAC Address: 00:16:3E:00:01:02 (Xensource) Nmap done: 1 IP address (1 host up) scanned in 7.46 seconds |
#vim /etc/ssh/sshd_config
|
#ssh 192.168.0.254
Password: Last login: Wed Feb 15 17:55:58 2012 from 192.168.64.1 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.4-RELEASE (GENERIC) #1: Sun Feb 12 15:17:17 EET 2012 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section for your release first as it's updated frequently. ... http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the questions@FreeBSD.org mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. Removing stale pidfile |
#ssh 192.168.0.254
Password: Last login: Wed Feb 15 18:24:27 2012 from 192.168.64.1 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.4-RELEASE (GENERIC) #1: Sun Feb 12 15:17:17 EET 2012 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section for your release first as it's updated frequently. ... http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the questions@FreeBSD.org mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. Removing stale pidfile |
#ssh root@192.168.168.5 -f -N
root@192.168.168.5's password: |
#ps aux|grep ssh
root 1085 0.0 0.1 5496 984 ? Ss Feb14 0:01 /usr/sbin/sshd root 1144 0.1 0.5 8400 2868 ? Ss Feb14 1:40 sshd: root@pts/1 root 6564 0.0 0.5 8400 2892 ? Ss 10:35 0:11 sshd: root@pts/3 root 6652 0.0 0.5 8400 2852 ? Ss 10:35 0:20 sshd: root@pts/6 root 6763 0.0 0.5 8400 2852 ? Ss 11:10 0:17 sshd: root@pts/8 root 6851 0.0 0.5 8400 2852 ? Ss 11:16 0:17 sshd: root@pts/10 root 6939 0.0 0.5 8260 2836 ? Ss 11:16 0:08 sshd: root@pts/12 root 7161 0.0 0.4 5128 2412 pts/5 S+ 12:13 0:01 ssh 192.168.168.5 root 8673 0.0 0.4 4992 2276 pts/13 S+ 15:46 0:01 ssh 192.168.168.5 root 8720 0.0 0.5 8260 2836 ? Ss 15:49 0:00 sshd: root@pts/14 root 8916 0.1 0.5 8260 2840 ? Ss 16:24 0:02 sshd: root@pts/16 root 9064 0.1 0.4 4992 2276 pts/17 S+ 16:52 0:00 ssh 192.168.0.254 root 9090 0.0 0.1 4992 568 ? Ss 16:58 0:00 ssh root@192.168.168.5 -f -N root 9099 0.0 0.1 3884 784 pts/4 S+ 16:58 0:00 grep ssh |
#ssh root@192.168.168.5 -v
OpenSSH_5.5p1 Debian-6, OpenSSL 0.9.8o 01 Jun 2010 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 192.168.168.5 [192.168.168.5] 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: Sending env LANG = ru_RU.UTF-8 Linux debian3 2.6.32-5-686 #1 SMP Fri Sep 9 20:51:05 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: Wed Feb 15 15:46:43 2012 from 192.168.0.254 l3-agent is already running: pid=1362; pidfile=/root/.lilalo/l3-agent.pid l3-agent is already running: pid=1362; pidfile=/root/.lilalo/l3-agent.pid |
#exit
exit debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0 debug1: channel 0: free: client-session, nchannels 1 Connection to 192.168.168.5 closed. Transferred: sent 1960, received 2952 bytes, in 11.6 seconds Bytes per second: sent 168.8, received 254.2 debug1: Exit status 0 |
#vim /etc/ssh/ssh_config
|
#man ssh
|
#ssh-key
ssh-keygen ssh-keyscan |
#ssh-key
ssh-keygen ssh-keyscan |
#ssh-keygen
Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: passphrase too short: have 3 bytes, need > 4 Saving the key failed: /root/.ssh/id_rsa. |
#ssh-keygen
Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: passphrase too short: have 4 bytes, need > 4 Saving the key failed: /root/.ssh/id_rsa. |
#ssh-keygen
Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: e0:6d:bb:ab:a8:4f:80:f9:60:57:4f:65:5c:e9:22:36 root@debian1 The key's randomart image is: +--[ RSA 2048]----+ | .o... | | o. . | | ... . | | o ..oE . . | |+... o.S . | |.o.. . . | | . . . | | . . . | | .oo ..o. | +-----------------+ |
#ls .ssh/
id_rsa id_rsa.pub known_hosts |
#rm .ssh/id*
|
#ls
-22 disk.iso file1 install -rf route_for_lab xinetd.conf |
#rm .ssh/id*
rm: невозможно удалить «.ssh/id*»: Нет такого файла или каталога |
#ls .ssh/
known_hosts |
#ssh-keygen
Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: f5:35:e7:7f:67:6f:b4:09:b7:7c:28:34:19:56:9b:c1 root@debian1 The key's randomart image is: +--[ RSA 2048]----+ | . | | E | | . .o+.| | . .o.o+ | | S ..o .| | +. .o| | . .+oO| | . .**| | . .o| +-----------------+ |
#ls .ssh/
id_rsa id_rsa.pub known_hosts |
#UsePAM yes
" ============================================================================ " Netrw Directory Listing (netrw v138) " /etc/ssh " Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec " Sorted by name " ============================================================================ modulirt sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\. ../ ssh_config ssh_host_dsa_key ssh_host_dsa_key.pub ssh_host_rsa_key ssh_host_rsa_key.pub sshd_config "/etc/ssh" является каталогом |
#sh root@192.168.168.1
Password: |
#sh root@192.168.168.1
|
#sh root@192.168.168.1
Enter passphrase for key '/root/.ssh/id_rsa': Last login: Wed Feb 15 18:52:51 2012 from 192.168.64.1 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.4-RELEASE (GENERIC) #1: Sun Feb 12 15:17:17 EET 2012 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section for your release first as it's updated frequently. ... http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the questions@FreeBSD.org mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. Removing stale pidfile |
#eval `ssh-agent`
Agent pid 9414 |
#ssh-a
ssh-add ssh-agent ssh-argv0 |
#ssh-a
ssh-add ssh-agent ssh-argv0 |
#ssh-add
Enter passphrase for /root/.ssh/id_rsa: Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa) |
#ssh-add -l
2048 f5:35:e7:7f:67:6f:b4:09:b7:7c:28:34:19:56:9b:c1 /root/.ssh/id_rsa (RSA) |
#ssh root@192.168.168.1
Last login: Wed Feb 15 19:10:03 2012 from 192.168.64.1 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.4-RELEASE (GENERIC) #1: Sun Feb 12 15:17:17 EET 2012 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section for your release first as it's updated frequently. o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, along with the mailing lists, can be searched by going to http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the questions@FreeBSD.org mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. Removing stale pidfile |
#ssh root@192.168.168.1 ps aux|grep ssh
root 1088 0.0 0.6 5784 3288 ?? Is 2:09PM 0:00.00 /usr/sbin/sshd root 4051 0.0 0.8 8460 3980 ?? Is 6:52PM 0:00.04 sshd: root@ttyp1 root 4369 0.0 0.8 8460 4000 ?? Ss 7:13PM 0:00.02 sshd: root@notty |
#ssh root@192.168.168.1 ls /root
.bash_history .bash_profile .bash_profile~ .bashrc .bashrc~ .cache .cshrc .history .k5login .l3rc .lesshst .lilalo .login .profile .ssh .vim .viminfo .vimrc \ |
#ssh root@192.168.168.1 touch /root/1111
|
#sh root@192.168.168.1
eys cp .ssh/id_rsa.pub root@192.168.168.1:/root/.ssh/authorized_ke id_rsa.pub 100% 394 0.4KB/s 00:00 |
#screen
|
#ps aux|grep ssh-agent
root 9414 0.0 0.1 3236 796 ? Ss 17:11 0:00 ssh-agent root 9865 0.0 0.1 3884 780 pts/3 S+ 17:15 0:00 grep ssh-agent |
#ps aux|grep ssh-agent
root 9881 0.0 0.1 3880 780 pts/3 S+ 17:15 0:00 grep ssh-agent |
#sh-keygen
root@192.168.168.1 Last login: Wed Feb 15 19:11:55 2012 from 192.168.64.1 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.4-RELEASE (GENERIC) #1: Sun Feb 12 15:17:17 EET 2012 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section for your release first as it's updated frequently. ... http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the questions@FreeBSD.org mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. Removing stale pidfile |
#sh-keygen
-t dsa Generating public/private dsa key pair. Enter file in which to save the key (/root/.ssh/id_dsa): ^C |
#ssh-keygen -t rsa1
Generating public/private rsa1 key pair. Enter file in which to save the key (/root/.ssh/identity): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/identity. Your public key has been saved in /root/.ssh/identity.pub. The key fingerprint is: 66:4f:bd:a4:26:74:d4:b4:9d:75:07:bf:03:35:e4:6e root@debian1 The key's randomart image is: +--[RSA1 2048]----+ | . o=+| | o oo++| | . o.o..| | . . o .| | S o o E | | + + o .. .| | . + . | | o | | | +-----------------+ |
Время первой команды журнала | 14:39:46 2012- 2-15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 16:17:59 2012- 2-15 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 13.86 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.99 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 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