/l3/users/07-09-2009/nt-ladm/debian1.net.nt/user :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 |
|
$vim .ssh/config
![]() --- /dev/null 2009-09-07 08:26:30.044750476 +0300 +++ .ssh/config 2009-09-10 10:50:31.000000000 +0300 @@ -0,0 +1,2 @@ +Host 192.168.16.2 +User root |
$ssh 192.168.16.2
Last login: Thu Sep 10 10:48:14 2009 from 192.168.16.1 Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=1255; pidfile=/root/.lilalo/l3-agent.pid |
#exit
exit Connection to 192.168.16.2 closed. |
$vim
![]() |
$ls -la .ssh/
итого 21 drwxr-xr-x 2 user user 192 2009-09-10 10:50 . drwxr-xr-x 11 user user 752 2009-09-10 10:50 .. -rw-r--r-- 1 user user 393 2009-04-30 15:12 authorized_keys -rw-r--r-- 1 user user 28 2009-09-10 10:50 config -rw------- 1 user user 1675 2009-09-10 10:46 id_rsa -rw-r--r-- 1 user user 394 2009-09-10 10:46 id_rsa.pub -rw-r--r-- 1 user user 3302 2009-09-10 10:45 known_hosts |
$dat
![]() bash: dat: command not found |
$date
Чтв Сен 10 10:51:23 EEST 2009 |
$date
![]() |
$scp 192.168.16.2:/root/1234 /tmp
1234 100% 0 0.0KB/s 00:00 |
$scp 192.168.16.2:/root/1234 /tmp
![]() |
$ssh 192.168.16.2
Last login: Thu Sep 10 10:50:43 2009 from 192.168.16.1 Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=1255; pidfile=/root/.lilalo/l3-agent.pid |
#netstat -lnp | grep -q 127.0.0.1:3333
![]() |
#netstat -lnp | grep -q 127.0.0.1:3333 ; echo$?
![]() bash: echo1: command not found |
#netstat -lnp | grep -q 127.0.0.1:3333 ; echo
1 |
#exit
exit Connection to 192.168.16.2 closed. |
$ssh -f -N -R 3333:127.0.0.1:22
ssh: netstat -lnp | grep -q 127.0.0.1: Name or service not known lost connection 1 |
$ssh 192.168.16.2
|
$ssh -f -N -R 3333:127.0.0.1:22 192.168.16.2
![]() |
$ssh 192.168.16.2
|
$scp 192.168.16.2 'netstat -lnp | grep -q 127.0.0.1:3333' ; ec
![]() [user@debian1:~]$ ssh 192.168.16.2 |
$scp 192.168.16.2 'netstat -lnp | grep :3333'
![]() ssh: netstat -lnp | grep : Name or service not known lost connection |
$whereis netstat
netstat: /bin/netstat /usr/share/man/man8/netstat.8.gz |
$ssh 192.168.16.2
![]() |
$ssh -f -N -R 3333:127.0.0.1:22 192.168.16.2
![]() |
$ssh 192.168.16.2
|
$whereis netstat
![]() [user@debian1:~]$ ssh 0 |
$ssh 192.168.16.2
![]() |
$ls
= 1_2 123 3_4 hello script ug-ladm.pdf ug-lnet.pdf |
$ls /tmp/scripts/
case1 for1 for3 select1 while1 case2 for2 for4 ssh-port-forwarding while2 |
$cd /tmp/scripts/
|
$chmod +x ssh-port-forwarding
|
$vim ssh-port-forwarding
--- /tmp/l3-saved-30657.3365.5621 2009-09-10 10:58:23.000000000 +0300 +++ ssh-port-forwarding 2009-09-10 10:58:26.000000000 +0300 @@ -1,5 +1,5 @@ #!/bin/sh -#set -x +set -x IP=192.168.16.2 ssh -o StrictHostKeyChecking=no root@$IP 'netstat -lnp | grep -q 127.0.0.1:55000' || ssh -o StrictHostKeyChecking=no -f -N -R 55000:127.0.0.1:22 root@$IP |
$./ssh-port-forwarding
+ IP=192.168.16.2 + ssh -o StrictHostKeyChecking=no root@192.168.16.2 'netstat -lnp | grep -q 127.0.0.1:55000' + ssh -o StrictHostKeyChecking=no -f -N -R 55000:127.0.0.1:22 root@192.168.16.2 |
$whereis netstat
![]() [user@debian1:scripts]$ ./ssh-port-forwarding + IP=192.168.16.2 + ssh -o StrictHostKeyChecking=no root@192.168.16.2 'netstat -lnp | grep -q 127.0.0.1:55000' |
$ssh 192.168.16.2 'netstat -lnp | grep -q 127.0.0.1:3333
|
#ssh 127.0.0.1 -p 55000
[user@debian1:scripts]$ ssh 192.168.16.2 Last login: Thu Sep 10 10:54:54 2009 from 192.168.16.1 Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=1255; pidfile=/root/.lilalo/l3-agent.pid The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established. ... Warning: Permanently added '127.0.0.1' (RSA) to the list of known hosts. root@127.0.0.1's password: Last login: Thu Sep 10 10:30:43 2009 from host203.net.nt Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=1256; pidfile=/root/.lilalo/l3-agent.pid |
#exit
exit Connection to 127.0.0.1 closed. |
$w
![]() [root@debian2:~]# ssh 127.0.0.1 -p 55000 -l user user@127.0.0.1's password: Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Thu Sep 10 10:27:52 2009 from 192.168.16.25 l3-agent is already running: pid=1406; pidfile=/home/user/.lilalo/l3-agent.pid 10:59:48 up 3 days, 2:33, 8 users, load average: 0,05, 0,02, 0,00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT user ttyp0 host239.net.nt Mon15 0.00s 2.84s 0.09s script -f -q /h user ttyp2 192.168.16.3 Wed11 20:07 0.34s 0.08s script -f -q /h user ttyp6 192.168.16.2 Wed11 18:38 0.28s 0.07s script -f -q /h root ttyp3 host203.net.nt 10:30 28:57m 0.01s 0.01s script -f -q /r user :0 - Tue14 ?xdm? 30:24m 0.14s /usr/bin/fluxbo user ttyp9 :0.0 Tue14 44:22 0.05s 0.05s script -f -q /h user ttypd localhost.locald 10:59 0.00s 0.08s 0.08s script -f -q /h user ttyp8 :ttyp5:S.0 Wed14 0.00s 0.14s 0.08s script -f -q /h |
$w
10:59:48 up 3 days, 2:33, 8 users, load average: 0,05, 0,02, 0,00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT user ttyp0 host239.net.nt Mon15 0.00s 2.84s 0.09s script -f -q /h user ttyp2 192.168.16.3 Wed11 20:07 0.34s 0.08s script -f -q /h user ttyp6 192.168.16.2 Wed11 18:38 0.28s 0.07s script -f -q /h root ttyp3 host203.net.nt 10:30 28:57m 0.01s 0.01s script -f -q /r user :0 - Tue14 ?xdm? 30:24m 0.14s /usr/bin/fluxbo user ttyp9 :0.0 Tue14 44:22 0.05s 0.05s script -f -q /h user ttypd localhost.locald 10:59 0.00s 0.08s 0.08s script -f -q /h user ttyp8 :ttyp5:S.0 Wed14 0.00s 0.14s 0.08s script -f -q /h |
#exit
exit Connection to 192.168.16.2 closed. |
$cat ssh-port-forwarding
#!/bin/sh set -x IP=192.168.16.2 ssh -o StrictHostKeyChecking=no root@$IP 'netstat -lnp | grep -q 127.0.0.1:55000' || ssh -o StrictHostKeyChecking=no -f -N -R 55000:127.0.0.1:22 root@$IP |
$crontab -e
# m h dom mon dow command [ Wrote 2 lines ] crontab: installing new crontab |
$EDITOR=vim crontab -e
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "crontab.LoU0P4/crontab" 3L, 44C записано сь crontab: installing new crontab |
$cp ssh-port-forwarding ~
|
$sudo grep -r ssh /var/spool/cron/crontabs/
Password: /var/spool/cron/crontabs/user:*/10 * * * * /home/user/ssh-port-forwarding |
$man pam
|
$sudo vim /etc/passwd
|
$sudo vim /etc/shadow
|
$sudo vim /etc/shadow
|
$man shadow
|
$man passwd
|
$man passwd
|
$whereis passwd
passwd: /usr/bin/passwd /etc/passwd /usr/X11R6/bin/passwd /usr/bin/X11/passwd /usr/share/man/man1/passwd.1.gz /usr/share/man/man5/passwd.5.gz |
$strings /usr/bin/passwd | less
|
$sudo adduser
![]() adduser: Можно указать только одно или два имени. |
$sudo adduser yarik
![]() Добавляется пользователь `yarik' ... Добавляется новая группа `yarik' (1304) ... Добавляется новый пользователь `yarik' (1304) в группу `yarik' ... Создаётся домашний каталог `/home/yarik' ... Копирование файлов из `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: Sorry, passwords do not match passwd: Authentication information cannot be recovered passwd: password unchanged Попробовать ещё раз? [Д/н] y Enter new UNIX password: Retype new UNIX password: Sorry, passwords do not match passwd: Authentication information cannot be recovered passwd: password unchanged Попробовать ещё раз? [Д/н] n Изменение информации о пользователе yarik Введите новое значение или нажмите ВВОД для выбора значения по умолчанию Полное имя []: adduser: `/usr/bin/chfn yarik' завершился по сигналу 2. Завершение работы. |
$sudo adduser yarik
![]() adduser: Пользователь `yarik' уже существует. |
$sudo adduser yarik3
[user@debian1:scripts]$ sudo adduser yarik2 ÐобавлÑеÑÑÑ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ `yarik2' ... ÐобавлÑеÑÑÑ Ð½Ð¾Ð²Ð°Ñ Ð³ÑÑппа `yarik2' (1305) ... ÐобавлÑеÑÑÑ Ð½Ð¾Ð²Ñй полÑзоваÑÐµÐ»Ñ `yarik2' (1305) в гÑÑÐ¿Ð¿Ñ `yarik2' ... СоздаÑÑÑÑ Ð´Ð¾Ð¼Ð°Ñний каÑалог `/home/yarik2' ... ÐопиÑование Ñайлов из `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: паÑÐ¾Ð»Ñ ÑÑпеÑно обновлÑн Ðзменение инÑоÑмаÑии о полÑзоваÑеле yarik2 ... Retype new UNIX password: passwd: паÑÐ¾Ð»Ñ ÑÑпеÑно обновлÑн Ðзменение инÑоÑмаÑии о полÑзоваÑеле yarik3 ÐведиÑе новое знаÑение или нажмиÑе ÐÐÐÐ Ð´Ð»Ñ Ð²ÑбоÑа знаÑÐµÐ½Ð¸Ñ Ð¿Ð¾ ÑмолÑÐ°Ð½Ð¸Ñ Ðолное Ð¸Ð¼Ñ []: Yaroslav ÐÐ¾Ð¼ÐµÑ ÐºÐ¾Ð¼Ð½Ð°ÑÑ []: A2 РабоÑий ÑелеÑон []: 102 ÐомаÑний ÑелеÑон []: 103 ÐÑÑгое []: Other ÐÐ°Ð½Ð½Ð°Ñ Ð¸Ð½ÑоÑмаÑÐ¸Ñ ÐºÐ¾ÑÑекÑна? [д/Ð] y |
$sudo
5 sync:x:4:65534:sync:/bin:/bin/sync 6 games:x:5:60:games:/usr/games:/bin/sh 7 man:x:6:12:man:/var/cache/man:/bin/sh 8 lp:x:7:7:lp:/var/spool/lpd:/bin/sh 9 mail:x:8:8:mail:/var/mail:/bin/sh 10 news:x:9:9:news:/var/spool/news:/bin/sh 11 uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh 12 proxy:x:13:13:proxy:/bin:/bin/sh 13 www-data:x:33:33:www-data:/var/www:/bin/sh 14 backup:x:34:34:backup:/var/backups:/bin/sh 15 list:x:38:38:Mailing List Manager:/var/list:/bin/sh 16 irc:x:39:39:ircd:/var/run/ircd:/bin/sh 17 gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh 18 nobody:x:65534:65534:nobody:/nonexistent:/bin/sh 19 sshd:x:100:65534::/var/run/sshd:/usr/sbin/nologin 20 gdm:x:101:103:Gnome Display Manager:/var/lib/gdm:/bin/false 21 user:x:1000:1000:User,,,:/home/user:/bin/bash 22 test:x:1001:1001:,,,:/home/test:/bin/bash 23 user1:x:1002:1002::/home/user1:/bin/sh vipw: /etc/passwd не был изменён |
$sudo vim /etc/passwd
|
$sudo useradd -s /bin/bash -m -d /home/wwww wwww
64 # regular expression when creating a new home directory 65 SKEL_IGNORE_REGEX="dpkg-(old|new|dist)" 66 ( ) 67 # Set this if you want the --add_extra_groups option to adduser to add 68 # new users to other groups. 69 # This is the list of groups that new non-system users will be added to 70 # Default: 71 #EXTRA_GROUPS="dialout cdrom floppy audio src video lp src users" 72 73 # If ADD_EXTRA_GROUPS is set to something non-zero, the EXTRA_GROUPS 74 # option above will be default behavior for adding new, non-system users 34 # allocated user accounts/groups. 74,27 98% рху |
$sudo vim /etc/shadow
|
$id wwww
31 # copied to the new user's home directory when it is created. 32 # SKEL=/etc/skel 33 # 31 # copied to the new user's home directory when it is created. 32 # SKEL=/etc/skel 33 # 34 # Defines whether the mail spool should be created while 35 # creating the account 36 # CREATE_MAIL_SPOOL=yes uid=1307(wwww) gid=1307(wwww) гÑÑппÑ=1307(wwww) ¸Ñ] 37L,36,1 92%¸Ð·ÑÑ |
$man useradd.conf\
![]() |
$man 5
![]() |
$man useradd
|
$sudo useradd -s /bin/bash -m -d /home/wwwww
|
$id wwwww
uid=1308(wwwww) gid=0(root) группы=0(root) |
$vim /etc/group
|
$usermod --help
![]() bash: usermod: command not found |
$sudo
![]() Usage: usermod [options] LOGIN Options: -c, --comment COMMENT new value of the GECOS field -d, --home HOME_DIR new home directory for the user account -e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE -f, --inactive INACTIVE set password inactive after expiration to INACTIVE -g, --gid GROUP force use GROUP as new primary group -G, --groups GROUPS new list of supplementary GROUPS -a, --append append the user to the supplemental GROUPS ... -h, --help display this help message and exit -l, --login NEW_LOGIN new value of the login name -L, --lock lock the user account -m, --move-home move contents of the home directory to the new location (use only with -d) -o, --non-unique allow using duplicate (non-unique) UID -p, --password PASSWORD use encrypted password for the new password -s, --shell SHELL new login shell for the user account -u, --uid UID new UID for the user account -U, --unlock unlock the user account |
$sudo usermod --help | less
|
$sudo usermod --help > /tmp/usermod-help
![]() Usage: usermod [options] LOGIN Options: -c, --comment COMMENT new value of the GECOS field -d, --home HOME_DIR new home directory for the user account -e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE -f, --inactive INACTIVE set password inactive after expiration to INACTIVE -g, --gid GROUP force use GROUP as new primary group -G, --groups GROUPS new list of supplementary GROUPS -a, --append append the user to the supplemental GROUPS ... -h, --help display this help message and exit -l, --login NEW_LOGIN new value of the login name -L, --lock lock the user account -m, --move-home move contents of the home directory to the new location (use only with -d) -o, --non-unique allow using duplicate (non-unique) UID -p, --password PASSWORD use encrypted password for the new password -s, --shell SHELL new login shell for the user account -u, --uid UID new UID for the user account -U, --unlock unlock the user account |
$sudo usermod --help &
![]() |
$sudo usermod -L yarik3
|
$vim /etc/shadow
![]() |
$sudo usermod -L yarik2
[user@debian1:scripts]$ sudo |
$sudo usermod -U yarik{2,3}
![]() -h, --help display this help message and exit -l, --login NEW_LOGIN new value of the login name -L, --lock lock the user account -m, --move-home move contents of the home directory to the new location (use only with -d) -o, --non-unique allow using duplicate (non-unique) UID -p, --password PASSWORD use encrypted password for the new password -s, --shell SHELL new login shell for the user account -u, --uid UID new UID for the user account -U, --unlock unlock the user account 328,8 99%¸Ð·ÑÑ |
$sudo sh -c 'usermod -U yarik2 yarik3'
![]() [user@debian1:scripts]$ sudo sh -c 'usermod -U yarik{2,3}' Usage: usermod [options] LOGIN Options: -c, --comment COMMENT new value of the GECOS field -d, --home HOME_DIR new home directory for the user account -e, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE -f, --inactive INACTIVE set password inactive after expiration to INACTIVE -g, --gid GROUP force use GROUP as new primary group -G, --groups GROUPS new list of supplementary GROUPS ... -h, --help display this help message and exit -l, --login NEW_LOGIN new value of the login name -L, --lock lock the user account -m, --move-home move contents of the home directory to the new location (use only with -d) -o, --non-unique allow using duplicate (non-unique) UID -p, --password PASSWORD use encrypted password for the new password -s, --shell SHELL new login shell for the user account -u, --uid UID new UID for the user account -U, --unlock unlock the user account |
$sudo sh -c 'usermod -U yarik2 yarik3'
![]() |
$sudo usermod -U yarik2
|
$sudo usermod -U yarik3
|
$sudo vim /etc/shadow
|
$passwd
![]() [user@debian1:scripts]$ sudo chfn yarik3 Изменение информации о пользователе yarik3 Введите новое значение или нажмите ВВОД для выбора значения по умолчанию Полное имя [Yaroslav]: Номер комнаты [A2]: Рабочий телефон [102]: Домашний телефон [103]: Другое [Other]: Changing password for user (current) UNIX password: Enter new UNIX password: Retype new UNIX password: Password unchanged Enter new UNIX password: Retype new UNIX password: No password supplied Enter new UNIX password: Retype new UNIX password: No password supplied passwd: Authentication token manipulation error passwd: password unchanged |
$ssh 192.168.16.25
![]() |
$ssh 192.168.16.25 -o VerifyHostKeyDNS=no
UsePrivilegedPort User Password: UserKnownHostsFile below).1:scripts]$ man ssh Password: If command is specified, it is executed on the remote host instead of a Last login: Thu Sep 10 10:26:31 2009 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 -1 The Regents of the University of California. All rights reserved. -2 Forces ssh to try protocol version 2 only. ... be forwarded to the given host and port on the local side. This You may also use sysinstall(8) to re-enter the installation andthe remoteThisn configuration utility. Edit /etc/motd to change this login announcement.nnec‐ tion is forwarded over the secure channel, and a connection isry l3-agent is already running: pid=20393; pidfile=/home/user/.lilalo/l3-agent.pid Agent forwarding should be enabled with caution. Users with the Port forwardings can also be specified in the configuration file. Privileged ports can be forwarded only when logging in as root on the remote machine. IPv6 addresses can be specified by enclosing the address in square braces or using an alternative syntax: |
#[user@fbsd5:~]$
|
#[user@fbsd5:~]$
![]() |
#[user@fbsd5:~]$
|
#[user@fbsd5:~]$ vim /tmp/pw-useradd_help
pw: illegal option -- - pw: unknown switch "/tmp/pw-useradd_help" 2 lines, 43 characters |
#[user@fbsd5:~]$ sudo pw useradd -h &>/tmp/pw-useradd_help
![]() |
#[user@fbsd5:~]$ sudo pw useradd help &>/tmp/pw-useradd_help
![]() pw: option requires an argument -- h pw: unknown switch "/tmp/pw-useradd_help" 2 lines, 56 characters |
#[user@fbsd5:~]$ vim /tmp/pw-useradd_help
usage: pw useradd [name] [switches] -V etcdir alternate /etc location -C config configuration file -q quiet operation Adding-n name login name -u uid user id -c comment user name/comment -d directory home directory -e date account expiry date -p date password expiry date ... -m [ -k dir ] create and set up home -M mode home directory permissions -s shell name of login shell -o duplicate uid ok -L class user class -h fd read password on fd -H fd read encrypted password on fd -Y update NIS maps -N no update Setting defaults:lp" 38 lines, 1308 characters |
#[user@fbsd5:~]$
![]() |
#[user@fbsd5:~]$
|
#[user@fbsd5:~]$ vim /tmp/pw-useradd_help
usage: pw userdel [uid|name] [switches] -V etcdir alternate /etc location -n name login name -u uid user id -Y update NIS maps -r remove home & contents "/tmp/pw-useradd_help" 6 lines, 202 characters |
#[user@fbsd5:~]$ sudo pw usermod help &>/tmp/pw-useradd_help
![]() |
#[user@fbsd5:~]$
![]() [user@fbsd5:~]$ vim /tmp/pw-useradd_help |
#[user@fbsd5:~]$
|
#[user@fbsd5:~]$ vim /etc/group
user590:*:1092: user591:*:1093: user592:*:1094: user593:*:1095: user594:*:1096: user595:*:1097: user596:*:1098: user597:*:1099: user598:*:1100: user599:*:1101: user600:*:1102: |
#!/bin/sh set -x IP=192.168.16.2 ssh -o StrictHostKeyChecking=no root@$IP 'netstat -lnp | grep -q 127.0.0.1:55000' || ssh -o StrictHostKeyChecking=no -f -N -R 55000:127.0.0.1:22 root@$IP
Время первой команды журнала | 09:49:40 2009- 9-10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 11:17:44 2009- 9-10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 20.79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 2.97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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