/l3/users/igor-public/nt-ids-2008-dec/linux1.unix.nt/root :1 |
|
#cat /etc/apt/sources.list
#deb http://debian.org.ua/debian sid main deb http://10.0.35.1:9999/debian sid main |
#vi /etc/apt/sources.list
--- /tmp/l3-saved-2552.29010.12433 2008-12-15 10:04:11.000000000 +0000 +++ /etc/apt/sources.list 2008-12-15 10:04:55.000000000 +0000 @@ -1,2 +1,3 @@ #deb http://debian.org.ua/debian sid main -deb http://10.0.35.1:9999/debian sid main +#deb http://10.0.35.1:9999/debian sid main +deb http://10.0.35.1:9999/ubuntu intrepid main universe |
#apt-get update && apt-get dist-upgrade
|
#vi /etc/apt/sources.list
--- /tmp/l3-saved-2552.32541.8107 2008-12-15 10:05:53.000000000 +0000 +++ /etc/apt/sources.list 2008-12-15 10:06:00.000000000 +0000 @@ -1,3 +1,3 @@ #deb http://debian.org.ua/debian sid main -#deb http://10.0.35.1:9999/debian sid main -deb http://10.0.35.1:9999/ubuntu intrepid main universe +deb http://10.0.35.1:9999/debian sid main +#deb http://10.0.35.1:9999/ubuntu intrepid main universe |
#id
uid=0(root) gid=0(root) groups=0(root) |
#apt-get install sudo
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: python2.4-minimal python2.4 libttf2 cpp-4.2 Use 'apt-get autoremove' to remove them. The following packages will be upgraded: sudo 1 upgraded, 0 newly installed, 0 to remove and 375 not upgraded. Need to get 177kB of archives. After this operation, 8192B of additional disk space will be used. Get:1 http://10.0.35.1 sid/main sudo 1.6.9p17-1 [177kB] Fetched 177kB in 0s (2909kB/s) (Reading database ... 37582 files and directories currently installed.) Preparing to replace sudo 1.6.9p12-1 (using .../sudo_1.6.9p17-1_i386.deb) ... Unpacking replacement sudo ... Setting up sudo (1.6.9p17-1) ... pkg_add -r sudo <!-- analog dlya freebsd |
#vi /etc/sudoers
--- /tmp/l3-saved-2552.29711.30765 2008-12-15 10:17:15.000000000 +0000 +++ /etc/sudoers 2008-12-15 10:19:02.000000000 +0000 @@ -18,3 +18,6 @@ # User privilege specification root ALL=(ALL) ALL +user ALL=(ALL) ALL +vitaliy samba=(ALL) ALL +sergey mail=(ALL) ALL |
#scp /etc/sudoers 192.168.15.2:/etc/
The authenticity of host '192.168.15.2 (192.168.15.2)' can't be established. RSA key fingerprint is 2d:f3:fd:cb:8a:9c:90:7e:ad:8d:32:7d:d8:cc:9b:72. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.15.2' (RSA) to the list of known hosts. root@192.168.15.2's password: sudoers 100% 459 0.5KB/s 00:00 |
#hostname
linux1.unix.nt |
#su - user
list:*:13930:0:99999:7::: irc:*:13930:0:99999:7::: gnats:*:13930:0:99999:7::: nobody:*:13930:0:99999:7::: libuuid:!:13930:0:99999:7::: sshd:*:13930:0:99999:7::: messagebus:*:13939:0:99999:7::: haldaemon:*:13939:0:99999:7::: "/etc/shadow" 25 lines, 737 characters written user@linux1:~$ exit logout |
#vi /etc/sudoers
--- /tmp/l3-saved-2552.28688.24934 2008-12-15 10:22:57.000000000 +0000 +++ /etc/sudoers 2008-12-15 10:26:29.000000000 +0000 @@ -19,5 +19,5 @@ # User privilege specification root ALL=(ALL) ALL user ALL=(ALL) ALL -vitaliy samba=(ALL) ALL +vitaliy samba=(ALL) testparm, /etc/init.d/samba, /usr/sbin/chown sergey mail=(ALL) ALL |
#tail /var/log/messages
Dec 15 10:26:22 linux1 kernel: 4gb seg fixup, process l3-agent (pid 2519), cs:ip 73:b7df150e Dec 15 10:26:22 linux1 kernel: 4gb seg fixup, process l3-agent (pid 2519), cs:ip 73:b7df1522 Dec 15 10:26:28 linux1 kernel: printk: 6564 messages suppressed. Dec 15 10:26:28 linux1 kernel: 4gb seg fixup, process sshd (pid 2630), cs:ip 73:b7b3f50e Dec 15 10:26:32 linux1 kernel: printk: 1823 messages suppressed. Dec 15 10:26:32 linux1 kernel: 4gb seg fixup, process l3-agent (pid 2519), cs:ip 73:b7df150e Dec 15 10:26:39 linux1 kernel: printk: 32933 messages suppressed. Dec 15 10:26:39 linux1 kernel: 4gb seg fixup, process screen (pid 2639), cs:ip 73:b7e30fbd Dec 15 10:26:41 linux1 kernel: printk: 1 messages suppressed. Dec 15 10:26:41 linux1 kernel: 4gb seg fixup, process sshd (pid 2630), cs:ip 73:b7b3f50e |
#vi /etc/ld.so.conf.d/
|
#vi /etc/ld.so.conf.d/libc6-xen.conf
--- /tmp/l3-saved-2552.1489.31910 2008-12-15 10:27:02.000000000 +0000 +++ /etc/ld.so.conf.d/libc6-xen.conf 2008-12-15 10:27:06.000000000 +0000 @@ -3,4 +3,4 @@ # fields. In Xen guest kernels, the vDSO tells the dynamic linker to # search in nosegneg subdirectories and to match this extra hwcap bit # in the ld.so.cache file. -hwcap 1 nosegneg +hwcap 0 nosegneg |
#ldconfig -a
ldconfig: invalid option -- a Try `ldconfig --help' or `ldconfig --usage' for more information. |
#ldconfig
|
#grep sudo /var/log/* | less
|
#/var/log/auth.log:Dec 15 10:21:25 linux1 sudo: user : TTY=pts/7 ; PWD=/home/
Dec 15 10:17:01 linux1 CRON[2716]: pam_unix(cron:session): session closed for user root Dec 15 10:21:11 linux1 su[2752]: Successful su for user by root Dec 15 10:21:12 linux1 su[2752]: + pts/7 root:user Dec 15 10:21:12 linux1 su[2752]: pam_env(su:session): Unable to open env file: /etc/environment: No such file or directory Dec 15 10:21:12 linux1 su[2752]: pam_env(su:session): Unable to open env file: /etc/default/locale: No such file or directory Dec 15 10:21:12 linux1 su[2752]: pam_unix(su:session): session opened for user user by (uid=0) Dec 15 10:21:25 linux1 sudo: user : TTY=pts/7 ; PWD=/home/user ; USER=root ; COMMAND=/bin/cat /etc/shadow Dec 15 10:22:03 linux1 sudo: user : TTY=pts/7 ; PWD=/home/user ; USER=root ; COMMAND=/usr/sbin/vipw Dec 15 10:22:09 linux1 sudo: user : TTY=pts/7 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/vi /etc/shadow Dec 15 10:22:39 linux1 su[2752]: pam_unix(su:session): session closed for user user |
#dpkg-reconfigure tzdata
Package configuration lqqqqqqqqqqqqqqqqqqqqu Configuring tzdata tqqqqqqqqqqqqqqqqqqqqk x Please select the time zone corresponding to your location. x x x x Time zone: x x x x Jersey - x x Kaliningrad a x x Kiev a x x Lisbon 0 x ... x Malta a x x Mariehamn . x x x x x x <Ok> <Cancel> x x x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj Current default timezone: 'Europe/Kiev' Local time is now: Mon Dec 15 12:28:24 EET 2008. Universal Time is now: Mon Dec 15 10:28:24 UTC 2008. |
#vi /etc/apt/sources.list
--- /tmp/l3-saved-2552.9130.21362 2008-12-15 12:32:18.000000000 +0200 +++ /etc/apt/sources.list 2008-12-15 12:32:26.000000000 +0200 @@ -1,3 +1,4 @@ #deb http://debian.org.ua/debian sid main deb http://10.0.35.1:9999/debian sid main +deb http://10.0.35.1:9999/debian etch main #deb http://10.0.35.1:9999/ubuntu intrepid main universe |
#apt-get update
Get:1 http://10.0.35.1 sid Release.gpg [189B] Get:2 http://10.0.35.1 etch Release.gpg [386B] Get:3 http://10.0.35.1 sid Release [80.6kB] Get:4 http://10.0.35.1 etch Release [58.2kB] Get:5 http://10.0.35.1 sid/main Packages/DiffIndex [2038B] Get:6 http://10.0.35.1 etch/main Packages [5624kB] Get:7 http://10.0.35.1 sid/main 2008-12-14-2033.20.pdiff [10.1kB] Get:8 http://10.0.35.1 sid/main 2008-12-14-2033.20.pdiff [10.1kB] Get:9 http://10.0.35.1 sid/main 2008-12-14-2033.20.pdiff [10.1kB] Get:10 http://10.0.35.1 sid/main 2008-12-15-0843.36.pdiff [17.2kB] Get:11 http://10.0.35.1 sid/main 2008-12-15-0843.36.pdiff [17.2kB] Get:12 http://10.0.35.1 sid/main 2008-12-15-0843.36.pdiff [17.2kB] Fetched 5793kB in 11s (495kB/s) Reading package lists... Done |
#apt-get install bash-completion
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: python2.4-minimal python2.4 libttf2 cpp-4.2 Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: bash-completion 0 upgraded, 1 newly installed, 0 to remove and 376 not upgraded. Need to get 89.2kB of archives. After this operation, 459kB of additional disk space will be used. Get:1 http://10.0.35.1 sid/main bash-completion 20080705 [89.2kB] Fetched 89.2kB in 0s (1148kB/s) Selecting previously deselected package bash-completion. (Reading database ... 37582 files and directories currently installed.) Unpacking bash-completion (from .../bash-completion_20080705_all.deb) ... Setting up bash-completion (20080705) ... |
#. /etc/bash_completion
|
#passwd
backup gnats lp nobody sys bin haldaemon mail proxy user daemon irc man root uucp games libuuid messagebus sshd www-data gdm list news sync xrdp |
#which syslog
syslog-facility syslogd syslogd-listfiles |
#which syslogd
/sbin/syslogd |
#vi ~/.bashrc
--- /tmp/l3-saved-2552.13032.14452 2008-12-15 12:34:49.000000000 +0200 +++ /root/.bashrc 2008-12-15 12:35:11.000000000 +0200 @@ -14,4 +14,5 @@ # alias rm='rm -i' # alias cp='cp -i' # alias mv='mv -i' +. /etc/bash_completion [ $0 == l3script ] && . /root/.lilalo/l3bashrc && _l3_start |
#which syslogd
/sbin/syslogd |
#strings `!!` | grep /etc/
strings `which syslogd` | grep /etc/ /etc/syslog.conf The file /etc/services does not seem exist. |
#file `which syslogd`
/sbin/syslogd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped |
#less `which syslogd`
|
#file `which syslogd`
/sbin/syslogd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped |
#strings `which syslogd` | grep /etc/
/etc/syslog.conf The file /etc/services does not seem exist. |
#strings `which syslogd` | wc -l
287 |
#ssh user@192.168.15.31
The authenticity of host '192.168.15.31 (192.168.15.31)' can't be established. DSA key fingerprint is a8:7c:c7:fe:ec:1b:54:ee:1f:7d:8b:34:1c:97:c0:95. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.15.31' (DSA) to the list of known hosts. Password: Removing stale pidfile [user@fbsd1 ~]$ ls -l /etc/sudoers ls: /etc/sudoers: No such file or directory [user@fbsd1 ~]$ su Password: ... [root@fbsd1 /home/user]# apropos user | grep add | grep [18] adding_user(8) - procedure for adding new users adduser(8) - command for adding new users adduser.conf(5) - adduser(8) configuration file chpass(1), chfn(1), chsh(1), ypchpass(1), ypchfn(1), ypchsh(1) - add or change user database information [root@fbsd1 /home/user]# exit exit [user@fbsd1 ~]$ exit logout Connection to 192.168.15.31 closed. |
#apropos user | grep add | grep [18]
/etc/adduser.conf (5) [adduser.conf] - configuration file for adduser(8) and ... addgroup (8) - add a user or group to the system adduser (8) - add a user or group to the system adduser.conf (5) - configuration file for adduser(8) and addgroup(8) . pam_issue (8) - PAM module to add issue file to user prompt useradd (8) - create a new user or update default new user information |
#which useradd
/usr/sbin/useradd |
#ls -l `!!`
ls -l `which useradd` -rwxr-xr-x 1 root root 60504 Jan 13 2008 /usr/sbin/useradd |
#ls -l `which adduser`
-rwxr-xr-x 1 root root 33168 Aug 31 2007 /usr/sbin/adduser |
#echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
#echo $PATH | tr : '\n'
/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin |
#whatis intro
intro (2) - Introduction to system calls intro (1) - Introduction to user commands intro (8) - Introduction to administration and privileged commands intro (3) - Introduction to library functions intro (4) - Introduction to special files intro (7) - Introduction to overview, conventions, and miscellany ... intro (6) - Introduction to games intro (5) - Introduction to file formats |
#ldd `which sshd`
linux-gate.so.1 => (0xb7fcf000) libwrap.so.0 => /lib/libwrap.so.0 (0xb7fbd000) libpam.so.0 => /lib/libpam.so.0 (0xb7fb3000) libdl.so.2 => /lib/i686/nosegneg/libdl.so.2 (0xb7fae000) libselinux.so.1 => /lib/libselinux.so.1 (0xb7f95000) libresolv.so.2 => /lib/i686/nosegneg/libresolv.so.2 (0xb7f81000) libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0xb7e37000) libutil.so.1 => /lib/i686/nosegneg/libutil.so.1 (0xb7e33000) libz.so.1 => /usr/lib/libz.so.1 (0xb7e1e000) libnsl.so.1 => /lib/i686/nosegneg/libnsl.so.1 (0xb7e04000) libcrypt.so.1 => /lib/i686/nosegneg/libcrypt.so.1 (0xb7dd2000) libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0xb7da9000) libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0xb7d1b000) libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0xb7cf8000) libcom_err.so.2 => /lib/libcom_err.so.2 (0xb7cf5000) libc.so.6 => /lib/i686/nosegneg/libc.so.6 (0xb7b96000) /lib/ld-linux.so.2 (0xb7fd0000) libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0xb7b8e000) libkeyutils.so.1 => /lib/libkeyutils.so.1 (0xb7b8b000) |
#ssh user@192.168.15.31
syslog.conf -- syslogd(8) configuration file DESCRIPTION The syslog.conf file is the configuration file for the syslogd(8) pro- gram. It consists of blocks of lines separated by program and hostname specifications (separations appear alone on their lines), with each line containing two fields: the selector field which specifies the types of messages and priorities to which the line applies, and an action field which specifies the action to be taken if a message syslogd(8) receives matches the selection criteria. The selector field is separated from the action field by one or more tab characters or spaces. Note that if you use spaces as separators, your syslog.conf might be incompatible with other Unices or Unix-like systems. This functionality was added for ease of configuration (e.g. it is possible to cut-and-paste into syslog.conf), and to avoid possible mistakes. This change however preserves backwards compatibility with the old style of syslog.conf (i.e., tab characters only). The selectors are encoded as a facility, a period (``.''), an optional set of comparison flags ([!] [<=>]), and a level, with no intervening white-space. Both the facility and the level are case insensitive. |
#netstat -lnp | grep sys
unix 2 [ ACC ] STREAM LISTENING 3926 1313/dbus-daemon /var/run/dbus/system_bus_socket |
#ps aux | grep syslog
root 1297 0.0 0.1 1768 600 ? Ss 10:36 0:00 /sbin/syslogd root 3371 0.0 0.1 1848 512 pts/7 R+ 14:28 0:00 grep syslog |
#vi /etc/default/syslogd
--- /tmp/l3-saved-2552.9200.3707 2008-12-15 14:28:53.000000000 +0200 +++ /etc/default/syslogd 2008-12-15 14:29:00.000000000 +0200 @@ -10,4 +10,4 @@ # # For remote UDP logging use SYSLOGD="-r" # -SYSLOGD="" +SYSLOGD="-r" |
#/etc/init.d/sysklogd restart
Restarting system log daemon.... |
#ssh user@192.168.15.31
Password: Removing stale pidfile [user@fbsd1 ~]$ sudo /etc/rc.d/syslogd restart Stopping syslogd. Starting syslogd. [user@fbsd1 ~]$ exit logout Connection to 192.168.15.31 closed. |
#tail /var/log/messages
Dec 15 14:29:54 linux1 kernel: 4gb seg fixup, process sshd (pid 2630), cs:ip 73:b7b3f50e Dec 15 14:29:54 192.168.15.31 syslogd: restart Dec 15 14:29:54 192.168.15.31 syslogd: kernel boot file is /boot/kernel/kernel Dec 15 14:29:54 192.168.15.31 kernel: Dec 15 12:29:47 fbsd1 syslogd: exiting on signal 15 Dec 15 14:29:56 linux1 kernel: printk: 8 messages suppressed. Dec 15 14:29:56 linux1 kernel: 4gb seg fixup, process sshd (pid 2630), cs:ip 73:b7b3f50e Dec 15 14:30:01 linux1 kernel: printk: 23203 messages suppressed. Dec 15 14:30:01 linux1 kernel: 4gb seg fixup, process sshd (pid 2630), cs:ip 73:b7b3f50e Dec 15 14:30:06 linux1 kernel: printk: 144 messages suppressed. Dec 15 14:30:06 linux1 kernel: 4gb seg fixup, process sshd (pid 2630), cs:ip 73:b7b3f50e |
#ssh user@192.168.15.31
Password: Removing stale pidfile [user@fbsd1 ~]$ echo privet | logger [user@fbsd1 ~]$ exit logout Connection to 192.168.15.31 closed. |
#tail /var/log/messages
Dec 15 14:30:26 linux1 kernel: 4gb seg fixup, process sshd (pid 2630), cs:ip 73:b7b3f50e Dec 15 14:30:33 linux1 kernel: printk: 15657 messages suppressed. Dec 15 14:30:33 linux1 kernel: 4gb seg fixup, process sshd (pid 2630), cs:ip 73:b7b3f50e Dec 15 14:30:36 linux1 kernel: printk: 13 messages suppressed. Dec 15 14:30:36 linux1 kernel: 4gb seg fixup, process sshd (pid 2630), cs:ip 73:b7b3f50e Dec 15 14:30:41 linux1 kernel: printk: 15783 messages suppressed. Dec 15 14:30:41 linux1 kernel: 4gb seg fixup, process sshd (pid 2630), cs:ip 73:b7b3f50e Dec 15 14:30:42 192.168.15.31 user: privet Dec 15 14:30:47 linux1 kernel: printk: 13 messages suppressed. Dec 15 14:30:47 linux1 kernel: 4gb seg fixup, process sshd (pid 2630), cs:ip 73:b7b3f50e |
#ssh user@192.168.15.31
Password: |
#ssh user@192.168.15.31
Password: Removing stale pidfile [user@fbsd1 ~]$ ls -l /etc/rc.conf -rw-r--r-- 1 root wheel 601 Dec 15 11:59 /etc/rc.conf [user@fbsd1 ~]$ ls -l /etc/defaults/rc.conf -r--r--r-- 1 root wheel 33245 Feb 24 2008 /etc/defaults/rc.conf [user@fbsd1 ~]$ grep syslog /etc/defaults/rc.conf syslogd_enable="YES" # Run syslog daemon (or NO). syslogd_program="/usr/sbin/syslogd" # path to syslogd, if you want a different one. syslogd_flags="-s" # Flags to syslogd (if enabled). amd_flags="-a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map" newsyslog_enable="YES" # Run newsyslog at startup. newsyslog_flags="-CN" # Newsyslog flags to create marked files [user@fbsd1 ~]$ exit logout Connection to 192.168.15.31 closed. |
#reboot
|
#tail /var/log/messages
Dec 15 14:52:21 linux1 kernel: EXT3-fs: mounted filesystem with ordered data mode. Dec 15 14:52:21 linux1 kernel: EXT3-fs warning: maximal mount count reached, running e2fsck is recommended Dec 15 14:52:21 linux1 kernel: EXT3 FS on hda1, internal journal Dec 15 14:52:21 linux1 kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled Dec 15 14:52:21 linux1 kernel: input: PC Speaker as /class/input/input0 Dec 15 14:52:21 linux1 kernel: EXT3-fs warning: maximal mount count reached, running e2fsck is recommended Dec 15 14:52:21 linux1 kernel: EXT3 FS on hda1, internal journal Dec 15 14:52:21 linux1 kernel: NET: Registered protocol family 10 Dec 15 14:52:21 linux1 kernel: lo: Disabled Privacy Extensions Dec 15 14:52:21 linux1 kernel: IPv6 over IPv4 tunneling driver |
#ssh user@192.168.15.31
Password: Removing stale pidfile [user@fbsd1 ~]$ grep syslog /etc/defaults/rc.conf syslogd_enable="YES" # Run syslog daemon (or NO). syslogd_program="/usr/sbin/syslogd" # path to syslogd, if you want a different one. syslogd_flags="-s" # Flags to syslogd (if enabled). amd_flags="-a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map" newsyslog_enable="YES" # Run newsyslog at startup. newsyslog_flags="-CN" # Newsyslog flags to create marked files [user@fbsd1 ~]$ exit logout Connection to 192.168.15.31 closed. |
#cat /dev/urandom | hexdump -C | tail -5 | logger
|
#cat /dev/urandom | hexdump -C | ???? -5 | logger
l3script: ????: command not found |
#cat /dev/urandom | hexdump -C | head -5 | logger
|
#cat /dev/urandom | hexdump -C | head -5
00000000 f8 b2 ed 90 13 19 50 cd 4c c6 3b 71 72 06 84 b6 |......P.L.;qr...| 00000010 03 d1 b8 6b 70 dc 91 51 ca 92 b5 03 70 0e 05 24 |...kp..Q....p..$| 00000020 99 16 74 31 1b ce 56 b1 5d e2 56 27 a4 f6 53 2b |..t1..V.].V'..S+| 00000030 30 52 06 46 c0 d2 ee 83 a9 4d 97 43 52 b7 3d e4 |0R.F.....M.CR.=.| 00000040 ea a3 cc c0 f2 b7 c8 59 16 2e be 69 e3 c0 b1 b7 |.......Y...i....| |
#cat /dev/urandom | hexdump -C | head -5 | tr 4-8 ' '
00000000 f a 00 ed da e e1 9d b a e3 0a af da 12 |.j...d...[......| 00000010 3c 9 90 23 b 0 b a2 b9 a9 d 10 f 3 2 0c |<..#......... '.| 00000020 b b 99 c0 cf 1f 9 e c f ae 00 ce d cc |.K...f..N.......| 00000030 23 ad ac 0 a9 cd 0b 3c 2a 3f cc c9 13 d d1 |#D......<*?...m.| 000000 0 f 9d c 9 fa a 1c c 1 d 0d e 0 f9 d 39 |O....z.|q..^..M9| |
#cat /dev/urandom | hexdump -C | head -5 | tr 2-8 ' '
00000000 9e ca fa 9 e fa d c cc 1d 1 d9 c 1d 9 |...xi..m...A.L.9| 00000010 e9 90 9c a 99 d a d d d a 1 |...d.. .z}mcmZbq| 000000 0 ee d 9 b a9 f f a 0 b b c9 |..%.K. ....0.K(.| 000000 0 c ed e ca a a 1 e f 11 fa b |L...J:cA. g?..D.| 000000 0 d f c 9e bf 91 ef fd f 9e c |.b... ......'...| |
#cat /dev/urandom | hexdump -C | head -5 | tr 1-9 ' '
00000000 e af c b df de c 0 c 00 0 cd |......f .P......| 000000 0 f 0 b e b d e |o..s .[...U..".| 000000 0 d d d bf 0a f0 ad b0 be cf fa e 0 df | ....u........`.| 000000 0 b b e a d 0 f f e b ac f b |...j....N.;...(.| 000000 0 b cf e bd 0 f 0a b0 |.[..FW%.. F@....| |
#cat /dev/urandom | hexdump -C | head -5 | tr 2-9 ' '
00000000 a cb f d e e0 e b eb b e f0 |z..OM...g.{...>.| 00000010 0c e c b c f b a d1 b a |.R.cT\....'..+*.| 000000 0 f d 1b e d a ad af a bd d 0 a c ec |..............<.| 000000 0 c e f1 e a a 0 ad e dc ea |..." .).....R..u| 000000 0 fd c 1 d e 0b d 0 a d ba c aa d |..A=...m...m.,.-| |
#cat /dev/urandom | hexdump -C | head -5 | tr 2-9 ' ' | wall
|
#cat /dev/urandom | hexdump -C | head -5 | tr 2-9 ' '/ ?? | lo
|
#cat /dev/urandom | hexdump -C | head -5 | tr 2-9 ' '/ ?? | log
|
#cat /dev/urandom | hexdump -C | head -5 | tr 2-9 ' ' | tr | lo
|
#echo kernel panic | logger
|
#tail /var/log/messages
Dec 15 15:23:08 linux1 logger: 64 bytes from 4.2.2.2: icmp_seq=25 ttl=248 time=50.4 ms Dec 15 15:23:09 linux1 logger: 64 bytes from 4.2.2.2: icmp_seq=26 ttl=248 time=51.3 ms Dec 15 15:23:10 linux1 logger: 64 bytes from 4.2.2.2: icmp_seq=27 ttl=248 time=52.1 ms Dec 15 15:23:11 linux1 logger: 64 bytes from 4.2.2.2: icmp_seq=28 ttl=248 time=48.9 ms Dec 15 15:23:57 linux1 logger: 00000000 a4 33 4c 6c 35 96 76 33 d2 d4 5a 5e ff 5c a2 2a |.3Ll5.v3..Z^.\.*| Dec 15 15:23:57 linux1 logger: 00000010 3a 3b 89 57 25 ae 57 40 97 0a 37 5a a4 00 fa dd |:;.W%.W@..7Z....| Dec 15 15:23:57 linux1 logger: 00000020 22 64 3d e1 7d 6f 79 b3 5d 9e d6 e1 8d 56 25 f9 |"d=.}oy.]....V%.| Dec 15 15:23:57 linux1 logger: 00000030 ea 45 cf 2a 1e 7f 2d 9f 24 5c d3 29 04 54 ed fa |.E.*..-.$\.).T..| Dec 15 15:23:57 linux1 logger: 00000040 1e 68 0b 07 b1 2d bd f0 ca b9 34 55 e0 1c 3b 35 |.h...-....4U..;5| Dec 15 15:30:33 linux1 logger: kernel panic |
#echo kernel panic | logger -t kernel
|
#tail /var/log/messages
Dec 15 15:23:09 linux1 logger: 64 bytes from 4.2.2.2: icmp_seq=26 ttl=248 time=51.3 ms Dec 15 15:23:10 linux1 logger: 64 bytes from 4.2.2.2: icmp_seq=27 ttl=248 time=52.1 ms Dec 15 15:23:11 linux1 logger: 64 bytes from 4.2.2.2: icmp_seq=28 ttl=248 time=48.9 ms Dec 15 15:23:57 linux1 logger: 00000000 a4 33 4c 6c 35 96 76 33 d2 d4 5a 5e ff 5c a2 2a |.3Ll5.v3..Z^.\.*| Dec 15 15:23:57 linux1 logger: 00000010 3a 3b 89 57 25 ae 57 40 97 0a 37 5a a4 00 fa dd |:;.W%.W@..7Z....| Dec 15 15:23:57 linux1 logger: 00000020 22 64 3d e1 7d 6f 79 b3 5d 9e d6 e1 8d 56 25 f9 |"d=.}oy.]....V%.| Dec 15 15:23:57 linux1 logger: 00000030 ea 45 cf 2a 1e 7f 2d 9f 24 5c d3 29 04 54 ed fa |.E.*..-.$\.).T..| Dec 15 15:23:57 linux1 logger: 00000040 1e 68 0b 07 b1 2d bd f0 ca b9 34 55 e0 1c 3b 35 |.h...-....4U..;5| Dec 15 15:30:33 linux1 logger: kernel panic Dec 15 15:30:50 linux1 kernel: kernel panic |
#echo kernel panic | logger -t acpid
|
#tail /var/log/messages
Dec 15 15:23:10 linux1 logger: 64 bytes from 4.2.2.2: icmp_seq=27 ttl=248 time=52.1 ms Dec 15 15:23:11 linux1 logger: 64 bytes from 4.2.2.2: icmp_seq=28 ttl=248 time=48.9 ms Dec 15 15:23:57 linux1 logger: 00000000 a4 33 4c 6c 35 96 76 33 d2 d4 5a 5e ff 5c a2 2a |.3Ll5.v3..Z^.\.*| Dec 15 15:23:57 linux1 logger: 00000010 3a 3b 89 57 25 ae 57 40 97 0a 37 5a a4 00 fa dd |:;.W%.W@..7Z....| Dec 15 15:23:57 linux1 logger: 00000020 22 64 3d e1 7d 6f 79 b3 5d 9e d6 e1 8d 56 25 f9 |"d=.}oy.]....V%.| Dec 15 15:23:57 linux1 logger: 00000030 ea 45 cf 2a 1e 7f 2d 9f 24 5c d3 29 04 54 ed fa |.E.*..-.$\.).T..| Dec 15 15:23:57 linux1 logger: 00000040 1e 68 0b 07 b1 2d bd f0 ca b9 34 55 e0 1c 3b 35 |.h...-....4U..;5| Dec 15 15:30:33 linux1 logger: kernel panic Dec 15 15:30:50 linux1 kernel: kernel panic Dec 15 15:31:08 linux1 acpid: kernel panic |
#tail /var/log/messages0
tail: cannot open `/var/log/messages0' for reading: No such file or directory |
#echo kernel panic | logger -t acpid0
|
#tail /var/log/messages0
tail: cannot open `/var/log/messages0' for reading: No such file or directory |
#tail /var/log/messages
Dec 15 15:23:11 linux1 logger: 64 bytes from 4.2.2.2: icmp_seq=28 ttl=248 time=48.9 ms Dec 15 15:23:57 linux1 logger: 00000000 a4 33 4c 6c 35 96 76 33 d2 d4 5a 5e ff 5c a2 2a |.3Ll5.v3..Z^.\.*| Dec 15 15:23:57 linux1 logger: 00000010 3a 3b 89 57 25 ae 57 40 97 0a 37 5a a4 00 fa dd |:;.W%.W@..7Z....| Dec 15 15:23:57 linux1 logger: 00000020 22 64 3d e1 7d 6f 79 b3 5d 9e d6 e1 8d 56 25 f9 |"d=.}oy.]....V%.| Dec 15 15:23:57 linux1 logger: 00000030 ea 45 cf 2a 1e 7f 2d 9f 24 5c d3 29 04 54 ed fa |.E.*..-.$\.).T..| Dec 15 15:23:57 linux1 logger: 00000040 1e 68 0b 07 b1 2d bd f0 ca b9 34 55 e0 1c 3b 35 |.h...-....4U..;5| Dec 15 15:30:33 linux1 logger: kernel panic Dec 15 15:30:50 linux1 kernel: kernel panic Dec 15 15:31:08 linux1 acpid: kernel panic Dec 15 15:31:16 linux1 acpid0: kernel panic |
#vi /etc/syslog.conf
|
#daemon.
brltty-flite - Access software for a blind person using a braille display eflite - Festival-Lite based emacspeak speech server espeak - A multi-lingual software speech synthesizer festival - General multi-lingual speech synthesis system festival-czech - Czech support for Festival speech synthesis system festival-dev - Development kit for the Festival speech synthesis system festival-doc - Documentation for Festival festival-freebsoft-utils - Festival extensions and utilities festival-hi - festival text to speech synthesizer for Hindi language festival-mr - festival text to speech synthesizer for Marathi language ... libperlspeak-perl - Perl Module for text to speech with festival, espeak, cepstral pidgin-festival - pidgin plugin to hear incoming messages using voice synthesis raccess4vbox3 - DTMF support and utilities for vbox3 screader - Screen reader using software or hardware speech synthesizer speech-dispatcher-festival - Festival support for Speech Dispatcher stardict-plugin-festival - International dictionary - Festival TTS plugin yasr - General-purpose console screen reader festival-gaim - gaim plugin to hear incoming messages using voice synthesis gstreamer0.8-festival - Festival speech synthesis plugin for GStreamer libgnome-speech3 - GNOME text-to-speech library |
#apt-get install mtr
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: python2.4-minimal python2.4 libttf2 cpp-4.2 Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: mtr 0 upgraded, 1 newly installed, 0 to remove and 376 not upgraded. Need to get 51.7kB of archives. After this operation, 172kB of additional disk space will be used. Get:1 http://10.0.35.1 sid/main mtr 0.75-2 [51.7kB] Fetched 51.7kB in 0s (56.0kB/s) Selecting previously deselected package mtr. (Reading database ... 37621 files and directories currently installed.) Unpacking mtr (from .../archives/mtr_0.75-2_i386.deb) ... Setting up mtr (0.75-2) ... |
#mtr ya.ru
My traceroute [v0.75] Mon Dec 15 15:59:00 2008 linux1.unix.nt (0.0.0.0) Keys: Help Display mode Restart Packets Pings quit56 Loss% Snt Last Avg Best Wrst StDev Host 0.0% 59 0.1 0.3 0.1 6.7 0.8 192.168.70.1 0.0% 59 6.2 7.6 4.9 19.8 2.5 2. ip.194.150.93.65.veer.net.ua 0.0% 59 7.6 7.7 5.3 19.8 2.0 3. uplink-uaix.veer.net.ua 0.0% 59 10.2 12.7 7.6 58.1 9.0 4. 217.27.155.29.sitel.com.ua 0.0% 59 10.2 10.3 7.2 29.6 3.2 5. yandex-gw.ix.net.ua 0.0% 59 6.8 10.0 6.8 25.1 3.1 6. korolev-vlan951.yandex.net 0.0% 59 33.3 29.2 23.0 58.3 5.7 7. apollo-lagg121.yandex.net 0.0% 59 56.4 36.3 23.6 240.2 29.4 8. einstein-vlan2.yandex.net 0.0% 59 30.0 62.3 24.6 312.3 71.7 9. ya.ru 0.0% 58 32.8 35.0 24.5 196.2 23.7 10. ??? |
#apt-get install syslog-ng
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? |
#vi /etc/syslog
|
#vi /etc/syslog-ng/syslog-ng.conf
--- /tmp/l3-saved-1696.1399.25421 2008-12-15 16:01:45.000000000 +0200 +++ /etc/syslog-ng/syslog-ng.conf 2008-12-15 16:17:10.000000000 +0200 @@ -187,6 +187,14 @@ and level(crit,err,notice)); }; +filter my_f_ping { + match('ping'); +} + +destination my_df_ping { + file("/var/log/ping"); +}; + ###### # logs @@ -202,6 +210,12 @@ destination(df_auth); }; +log { + source(s_all); + filter(my_f_ping); + destination(my_df_ping); +}; + # *.*;auth,authpriv.none -/var/log/syslog log { source(s_all); |
#/etc/init.d/klogd stop
|
#ps aux | grep syslo
root 2670 0.0 0.1 2992 760 ? Ss 16:01 0:00 /usr/sbin/syslog-ng -p /var/run/syslog-ng.pid root 2758 0.0 0.2 2284 1176 pts/7 S+ 16:03 0:00 nano /etc/syslog-ng/syslog-ng.conf root 2780 0.0 0.1 1844 512 pts/4 R+ 16:17 0:00 grep syslo |
#/etc/init.d/syslog-ng restart
Stopping system logging: syslog-ng. Starting system logging: syslog-ngsyntax error at 194 failed! |
#vi /etc/syslog-ng/syslog-ng.conf
--- /tmp/l3-saved-1696.28473.17165 2008-12-15 16:17:47.000000000 +0200 +++ /etc/syslog-ng/syslog-ng.conf 2008-12-15 16:18:27.000000000 +0200 @@ -192,7 +192,7 @@ } destination my_df_ping { - file("/var/log/ping"); + file('/var/log/ping'); }; |
#/etc/init.d/syslog-ng restart
Stopping system logging: syslog-ng failed! Starting system logging: syslog-ngsyntax error at 194 failed! |
#vi /etc/syslog-ng/syslog-ng.conf
--- /tmp/l3-saved-1696.21899.30581 2008-12-15 16:18:33.000000000 +0200 +++ /etc/syslog-ng/syslog-ng.conf 2008-12-15 16:19:10.000000000 +0200 @@ -187,11 +187,11 @@ and level(crit,err,notice)); }; -filter my_f_ping { +filter f_ping { match('ping'); -} +}; -destination my_df_ping { +destination df_ping { file('/var/log/ping'); }; @@ -212,8 +212,8 @@ log { source(s_all); - filter(my_f_ping); - destination(my_df_ping); + filter(f_ping); + destination(df_ping); }; # *.*;auth,authpriv.none -/var/log/syslog |
#/etc/init.d/syslog-ng restart
Stopping system logging: syslog-ng failed! Starting system logging: syslog-ng. |
#echo logger ping | logger
|
#ls /var/log/p
ping pycentral.log |
#tail /var/log/ping
Dec 15 16:19:23 linux1 logger: logger ping |
#vi /etc/syslog-ng/syslog-ng.conf
--- /tmp/l3-saved-1696.24496.19331 2008-12-15 16:20:21.000000000 +0200 +++ /etc/syslog-ng/syslog-ng.conf 2008-12-15 16:21:26.000000000 +0200 @@ -195,6 +195,10 @@ file('/var/log/ping'); }; +destination df_send_sms { + program('/usr/local/bin/sendsms'); +}; + ###### # logs |
#apt-get install gnokii
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: python2.4-minimal python2.4 libttf2 cpp-4.2 Use 'apt-get autoremove' to remove them. The following extra packages will be installed: dialog gnokii-cli gnokii-common gnome-icon-theme libbluetooth2 libgnokii3 libical0 libpcsclite1 xgnokii Suggested packages: ... Setting up libpcsclite1 (1.4.102-1) ... Setting up gnokii-common (0.6.26.dfsg-3) ... Setting up libgnokii3 (0.6.26.dfsg-3) ... Setting up dialog (1.1-20080819-1) ... Setting up gnokii-cli (0.6.26.dfsg-3) ... Adding group `gnokii' (GID 109) ... Done. Setting up gnome-icon-theme (2.22.0-1) ... Setting up xgnokii (0.6.26.dfsg-3) ... Setting up gnokii (0.6.26.dfsg-3) ... |
#grep attempt /var/log/*
|
#deb http://debian.org.ua/debian sid main deb http://10.0.35.1:9999/debian sid main
Время первой команды журнала | 12:02:36 2008-12-15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 16:22:01 2008-12-15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 9.09 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.63 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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