/l3/users/bas/2011-03/linux3.unix.bas/root :1 :2 :3 :4 :5 :6 :7 :8 :9 |
|
#mii-tool
eth0: negotiated 100baseTx-FD flow-control, link ok SIOCGMIIPHY on 'eth1' failed: Operation not supported |
#arp
Address HWtype HWaddress Flags Mask Iface linux1.unix.bas ether E0:CB:4E:DD:EA:D7 C eth0 linux253.unix.bas ether 00:1F:29:BC:3A:D8 C eth0 |
#arp -an
? (192.168.15.1) at E0:CB:4E:DD:EA:D7 [ether] on eth0 ? (192.168.15.253) at 00:1F:29:BC:3A:D8 [ether] on eth0 |
#arp -an | awk '{print $2" "$4 }' | tr -d '()'
192.168.15.253 00:1F:29:BC:3A:D8 192.168.15.1 E0:CB:4E:DD:EA:D7 192.168.15.2 00:26:18:E4:56:5E 192.168.15.4 00:26:18:E4:56:60 192.168.15.5 00:26:18:CA:EE:7B |
#arp -an | awk '{print $2" "$4 }' | tr -d '()' > /etc/ethers
|
#arp -f /etc/ethers
|
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0.0.0.0 192.168.15.253 0.0.0.0 UG 0 0 0 eth0 |
#netstat -rn
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0.0.0.0 192.168.15.253 0.0.0.0 UG 0 0 0 eth0 |
#host mail.ru
mail.ru has address 94.100.191.204 mail.ru has address 94.100.191.201 mail.ru has address 94.100.191.202 mail.ru has address 94.100.191.203 mail.ru mail is handled by 10 mxs.mail.ru. |
#dig kolesa.kz
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <<>> kolesa.kz ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4270 ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 0 ;; QUESTION SECTION: ;kolesa.kz. IN A ;; ANSWER SECTION: kolesa.kz. 86400 IN A 195.210.46.150 kolesa.kz. 86400 IN A 195.210.46.143 ;; AUTHORITY SECTION: kolesa.kz. 86400 IN NS ns1.ps.kz. kolesa.kz. 86400 IN NS ns.ps.kz. ;; Query time: 206 msec ;; SERVER: 192.168.15.253#53(192.168.15.253) ;; WHEN: Tue Apr 5 12:41:48 2011 ;; MSG SIZE rcvd: 97 |
#cd
|
#ls
anaconda-ks.cfg graph_dec_c_1 graph_sep_c_3 memo_oct_c_1 report_nov_c_1 a_reports graph_dec_c_2 install.log memo_oct_c_2 report_nov_c_2 backups graph_dec_c_3 install.log.syslog memo_oct_c_3 report_nov_c_3 bin graph_nov_c_1 Mail memo_sep_c_1 report_oct_c_1 cats graph_nov_c_2 mbox memo_sep_c_2 report_oct_c_2 december graph_nov_c_3 memo_dec_c_1 memo_sep_c_3 report_oct_c_3 Desktop graph_oct_c_1 memo_dec_c_2 november report_sep_c_1 DIR graph_oct_c_2 memo_dec_c_3 october report_sep_c_2 DIR2 graph_oct_c_3 memo_nov_c_1 report_dec_c_1 report_sep_c_3 disk1.img graph_sep_c_1 memo_nov_c_2 report_dec_c_2 scsrun.log fotki.tar graph_sep_c_2 memo_nov_c_3 report_dec_c_3 september |
#ls
anaconda-ks.cfg graph_dec_c_1 graph_sep_c_3 memo_oct_c_1 report_nov_c_1 a_reports graph_dec_c_2 install.log memo_oct_c_2 report_nov_c_2 backups graph_dec_c_3 install.log.syslog memo_oct_c_3 report_nov_c_3 bin graph_nov_c_1 Mail memo_sep_c_1 report_oct_c_1 cats graph_nov_c_2 mbox memo_sep_c_2 report_oct_c_2 december graph_nov_c_3 memo_dec_c_1 memo_sep_c_3 report_oct_c_3 Desktop graph_oct_c_1 memo_dec_c_2 november report_sep_c_1 DIR graph_oct_c_2 memo_dec_c_3 october report_sep_c_2 DIR2 graph_oct_c_3 memo_nov_c_1 report_dec_c_1 report_sep_c_3 disk1.img graph_sep_c_1 memo_nov_c_2 report_dec_c_2 scsrun.log fotki.tar graph_sep_c_2 memo_nov_c_3 report_dec_c_3 september |
#tar xvfj /fotki.tar
tar: /fotki.tar: Cannot open: No such file or directory tar: Error is not recoverable: exiting now tar: Child returned status 2 tar: Error exit delayed from previous errors |
#tar xvfj /fotki.tar
tar: /fotki.tar: Cannot open: No such file or directory tar: Error is not recoverable: exiting now tar: Child returned status 2 tar: Error exit delayed from previous errors |
#tar xvf fotki.tar
fotki/ fotki/IMG_0057.JPG fotki/IMG_0059.JPG fotki/IMG_0060.JPG fotki/IMG_0061.JPG fotki/IMG_0063.JPG |
#ls
anaconda-ks.cfg graph_dec_c_1 install.log memo_oct_c_3 report_oct_c_1 a_reports graph_dec_c_2 install.log.syslog memo_sep_c_1 report_oct_c_2 backups graph_dec_c_3 Mail memo_sep_c_2 report_oct_c_3 bin graph_nov_c_1 mbox memo_sep_c_3 report_sep_c_1 cats graph_nov_c_2 memo_dec_c_1 november report_sep_c_2 december graph_nov_c_3 memo_dec_c_2 october report_sep_c_3 Desktop graph_oct_c_1 memo_dec_c_3 report_dec_c_1 scsrun.log DIR graph_oct_c_2 memo_nov_c_1 report_dec_c_2 september DIR2 graph_oct_c_3 memo_nov_c_2 report_dec_c_3 disk1.img graph_sep_c_1 memo_nov_c_3 report_nov_c_1 fotki graph_sep_c_2 memo_oct_c_1 report_nov_c_2 fotki.tar graph_sep_c_3 memo_oct_c_2 report_nov_c_3 |
#cd fotki
|
#ls
IMG_0057.JPG IMG_0059.JPG IMG_0060.JPG IMG_0061.JPG IMG_0063.JPG |
#ls
anaconda-ks.cfg graph_dec_c_3 memo_dec_c_1 report_dec_c_1 a_reports graph_nov_c_1 memo_dec_c_2 report_dec_c_2 backups graph_nov_c_2 memo_dec_c_3 report_dec_c_3 bin graph_nov_c_3 memo_nov_c_1 report_nov_c_1 cats graph_oct_c_1 memo_nov_c_2 report_nov_c_2 december graph_oct_c_2 memo_nov_c_3 report_nov_c_3 Desktop graph_oct_c_3 memo_oct_c_1 report_oct_c_1 DIR graph_sep_c_1 memo_oct_c_2 report_oct_c_2 DIR2 graph_sep_c_2 memo_oct_c_3 report_oct_c_3 disk1.img graph_sep_c_3 memo_sep_c_1 report_sep_c_1 fotki install.log memo_sep_c_2 report_sep_c_2 fotki.tar install.log.syslog memo_sep_c_3 report_sep_c_3 graph_dec_c_1 Mail november scsrun.log graph_dec_c_2 mbox october september |
#ls Mail
|
#ls
anaconda-ks.cfg graph_dec_c_3 memo_dec_c_1 report_dec_c_1 a_reports graph_nov_c_1 memo_dec_c_2 report_dec_c_2 backups graph_nov_c_2 memo_dec_c_3 report_dec_c_3 bin graph_nov_c_3 memo_nov_c_1 report_nov_c_1 cats graph_oct_c_1 memo_nov_c_2 report_nov_c_2 december graph_oct_c_2 memo_nov_c_3 report_nov_c_3 Desktop graph_oct_c_3 memo_oct_c_1 report_oct_c_1 DIR graph_sep_c_1 memo_oct_c_2 report_oct_c_2 DIR2 graph_sep_c_2 memo_oct_c_3 report_oct_c_3 disk1.img graph_sep_c_3 memo_sep_c_1 report_sep_c_1 fotki install.log memo_sep_c_2 report_sep_c_2 fotki.tar install.log.syslog memo_sep_c_3 report_sep_c_3 graph_dec_c_1 Mail november scsrun.log graph_dec_c_2 mbox october september |
#mbox
bash: mbox: command not found |
#ls mbox |less
|
#mii-tool
SIOCGMIIPHY on 'eth0' failed: Operation not supported eth1: no link |
#ifconfig
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:1275 errors:0 dropped:0 overruns:0 frame:0 TX packets:1275 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1800079 (1.7 MiB) TX bytes:1800079 (1.7 MiB) |
#vim /etc/sysconfig/network
--- /tmp/l3-saved-3570.12966.14063 2011-04-05 10:44:29.000000000 +0600 +++ /etc/sysconfig/network-scripts/ifcfg-eth0:0 2011-04-05 10:45:36.000000000 +0600 @@ -1,8 +1,7 @@ # Atheros Communications Atheros AR8121/AR8113/AR8114 PCI-E Ethernet Controller -DEVICE=eth0 +DEVICE=eth0:0 BOOTPROTO=none ONBOOT=yes NETMASK=255.255.255.0 -IPADDR=192.168.15.3 -GATEWAY=192.168.15.253 +IPADDR=192.168.16.3 TYPE=Ethernet |
#vim /etc/sysconfig/network-scripts/
|
#vim /etc/sysconfig/network-scripts/ifcfg-eth0
|
#~
bash: xm: command not found |
#ifdown eth0
|
#ifup eth0
SIOCSIFFLAGS: No such file or directory Failed to bring up eth0. |
#vim /etc/sysconfig/network-scripts/ifcfg-eth1
--- /tmp/l3-saved-3965.16819.4661 2011-04-05 15:43:51.000000000 +0600 +++ /etc/sysconfig/network-scripts/ifcfg-eth1 2011-04-05 15:43:54.000000000 +0600 @@ -1,5 +1,5 @@ # Atheros Communications Atheros AR8121/AR8113/AR8114 PCI-E Ethernet Controller -DEVICE=eth0 +DEVICE=eth1 BOOTPROTO=none ONBOOT=yes NETMASK=255.255.255.0 |
#ifconfig
eth1 Link encap:Ethernet HWaddr 00:26:18:CA:E8:DC inet addr:192.168.15.3 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::226:18ff:feca:e8dc/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:29 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:5369 (5.2 KiB) Interrupt:66 Memory:feac0000-feb00000 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:1275 errors:0 dropped:0 overruns:0 frame:0 TX packets:1275 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1800079 (1.7 MiB) TX bytes:1800079 (1.7 MiB) |
#mii-tool
SIOCGMIIPHY on 'eth0' failed: Operation not supported eth1: negotiated 100baseTx-FD flow-control, link ok |
#ls
anaconda-ks.cfg fotki graph_oct_c_3 memo_dec_c_3 november report_oct_c_3 a_reports fotki.tar graph_sep_c_1 memo_nov_c_1 october report_sep_c_1 backups graph_dec_c_1 graph_sep_c_2 memo_nov_c_2 report_dec_c_1 report_sep_c_2 bin graph_dec_c_2 graph_sep_c_3 memo_nov_c_3 report_dec_c_2 report_sep_c_3 cats graph_dec_c_3 install.log memo_oct_c_1 report_dec_c_3 scsrun.log december graph_nov_c_1 install.log.syslog memo_oct_c_2 report_nov_c_1 september Desktop graph_nov_c_2 Mail memo_oct_c_3 report_nov_c_2 DIR graph_nov_c_3 mbox memo_sep_c_1 report_nov_c_3 DIR2 graph_oct_c_1 memo_dec_c_1 memo_sep_c_2 report_oct_c_1 disk1.img graph_oct_c_2 memo_dec_c_2 memo_sep_c_3 report_oct_c_2 |
#ls /home/user/winda1.iso
/home/user/winda1.iso |
#scp /home/user/winda1.iso 192.168.15.2:/home/user
The authenticity of host '192.168.15.2 (192.168.15.2)' can't be established. RSA key fingerprint is b0:eb:1b:d3:22:b5:d5:bb:e8:4a:10:1d:3b:fb:59:f4. 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: Permission denied, please try again. root@192.168.15.2's password: winda1.iso 100% 589MB 11.1MB/s 00:53 |
#scp /home/user/winda1.iso 192.168.15.1:/home/user
The authenticity of host '192.168.15.1 (192.168.15.1)' can't be established. RSA key fingerprint is e3:0e:09:ae:33:7d:81:a1:0f:24:09:ec:67:47:9a:3f. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.15.1' (RSA) to the list of known hosts. root@192.168.15.1's password: Permission denied, please try again. root@192.168.15.1's password: winda1.iso 100% 589MB 11.1MB/s 00:53 |
#scp /home/user/winda1.iso 192.168.15.5:/home/user
The authenticity of host '192.168.15.5 (192.168.15.5)' can't be established. RSA key fingerprint is 15:5e:e7:df:4b:47:21:44:da:38:70:6c:aa:b9:ef:80. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.15.5' (RSA) to the list of known hosts. root@192.168.15.5's password: winda1.iso 100% 589MB 11.1MB/s 00:53 |
#cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=disabled # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted |
#vim /etc/sysconfig/selinux
--- /tmp/l3-saved-4934.13957.22430 2011-04-05 17:29:24.000000000 +0600 +++ /etc/sysconfig/selinux 2011-04-05 17:29:35.000000000 +0600 @@ -3,7 +3,7 @@ # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. -SELINUX=disabled +SELINUX=enforcing # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. |
#reboot
|
#sestatus
SELinux status: enabled SELinuxfs mount: /selinux Current mode: enforcing Mode from config file: enforcing Policy version: 21 Policy from config file: targeted |
#sestatus -v
SELinux status: enabled SELinuxfs mount: /selinux Current mode: enforcing Mode from config file: enforcing Policy version: 21 Policy from config file: targeted Process contexts: Current context: root:system_r:unconfined_t:SystemLow-SystemHigh Init context: system_u:system_r:init_t /sbin/mingetty system_u:system_r:getty_t ... /etc/shadow system_u:object_r:shadow_t /bin/bash system_u:object_r:shell_exec_t /bin/login system_u:object_r:login_exec_t /bin/sh system_u:object_r:bin_t -> system_u:object_r:shell_exec_t /sbin/agetty system_u:object_r:getty_exec_t /sbin/init system_u:object_r:init_exec_t /sbin/mingetty system_u:object_r:getty_exec_t /usr/sbin/sshd system_u:object_r:sshd_exec_t /lib/libc.so.6 system_u:object_r:lib_t -> system_u:object_r:lib_t /lib/ld-linux.so.2 system_u:object_r:lib_t -> system_u:object_r:ld_so_t |
#sestatus -b | grep http
allow_httpd_anon_write off allow_httpd_bugzilla_script_anon_write off allow_httpd_cvs_script_anon_write off allow_httpd_mod_auth_pam off allow_httpd_nagios_script_anon_write off allow_httpd_prewikka_script_anon_write off allow_httpd_squid_script_anon_write off allow_httpd_sys_script_anon_write off httpd_builtin_scripting on httpd_can_network_connect off ... httpd_enable_ftp_server off httpd_enable_homedirs on httpd_read_user_content off httpd_rotatelogs_disable_trans off httpd_ssi_exec off httpd_suexec_disable_trans off httpd_tty_comm on httpd_unified on httpd_use_cifs off httpd_use_nfs off |
#sestatus -b | less
|
#ps aux | grep http
root 3129 0.0 0.0 61148 724 pts/2 S+ 17:36 0:00 grep http |
#ps aux | grep apa
root 3138 0.0 0.0 61148 720 pts/2 S+ 17:36 0:00 grep apa |
#ps auxZ | less
|
#system_u:system_r:sendmail_t smmsp 2640 0.0 0.0 59756 1784 ? Ss 17:32 0:00 s
SELinux status: enabled SELinuxfs mount: /selinux Current mode: enforcing Mode from config file: enforcing Policy version: 21 Policy from config file: targeted Policy booleans: NetworkManager_disable_trans off aisexec_disable_trans off allow_console_login off ... allow_ftpd_anon_write off allow_ftpd_full_access off allow_ftpd_use_cifs off allow_ftpd_use_nfs off allow_gpg_execstack off allow_gssd_read_tmp on allow_httpd_anon_write off allow_httpd_bugzilla_script_anon_write off SELinux status: enabled SELinuxfs mount: /selinux |
#yum install apache
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.neolabs.kz * base: mirror.neolabs.kz * extras: mirror.neolabs.kz * rpmforge: fr2.rpmfind.net * updates: mirror.neolabs.kz Setting up Install Process No package apache available. Nothing to do |
#yum search apache
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.neolabs.kz * base: mirror.neolabs.kz * extras: mirror.neolabs.kz * rpmforge: fr2.rpmfind.net * updates: mirror.neolabs.kz ======================================== Matched: apache ========================================= jakarta-commons-daemon.x86_64 : Jakarta Commons Daemon Package jakarta-commons-daemon-javadoc.x86_64 : Javadoc for jakarta-commons-daemon ... xml-commons-apis-manual.x86_64 : Manual for xml-commons-api xml-commons-resolver.x86_64 : Resolver subproject of xml-commons. xml-commons-resolver-javadoc.x86_64 : Javadoc for xml-commons-resolver xml-commons-which.x86_64 : Which subproject of xml-commons xml-commons-which-javadoc.x86_64 : Javadoc for xml-commons-which xml-security-c.x86_64 : Implementation of security standards for XML xml-security-c-devel.x86_64 : Header files, libraries and development documentation for : xml-security-c. xmlrpc.x86_64 : Java XML-RPC implementation xmlrpc-javadoc.x86_64 : Javadoc for xmlrpc |
#yum install httpd
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.space.kz * base: mirror.space.kz * extras: mirror.space.kz * rpmforge: fr2.rpmfind.net * updates: mirror.space.kz Setting up Install Process Resolving Dependencies --> Running transaction check ... Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Updating : httpd 1/2 Cleanup : httpd 2/2 Updated: httpd.x86_64 0:2.2.3-43.el5.centos.3 Complete! |
#ls -Z /var/www
drwxr-xr-x root root system_u:object_r:httpd_sys_script_exec_t cgi-bin drwxr-xr-x root root system_u:object_r:httpd_sys_content_t error drwxr-xr-x root root system_u:object_r:httpd_sys_content_t html drwxr-xr-x root root system_u:object_r:httpd_sys_content_t icons |
#ls -Z /var/www/html/
|
#mkdir /var/www/html/dir
|
#cp /etc/passwd /var/www/html/dir
|
#ps auxZ | grep http
root:system_r:unconfined_t:SystemLow-SystemHigh root 3413 0.0 0.0 61148 724 pts/2 S+ 17:40 0:00 grep http |
#/etc/init.d/httpd start
Starting httpd: [ OK ] |
#ch
chacl chcat chgrp chroot chage chcon chkconfig chrt change_console check-binary-files chkfontpath chsh charmap checkmodule chmod chvt chat checkpolicy chown chattr chfn chpasswd |
#chcon
chcon: too few arguments Try `chcon --help' for more information. |
#chcon --help
Usage: chcon [OPTION]... CONTEXT FILE... or: chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE... or: chcon [OPTION]... --reference=RFILE FILE... Change the security context of each FILE to CONTEXT. -c, --changes like verbose but report only when a change is made -h, --no-dereference affect symbolic links instead of any referenced file (available only on systems with lchown system call) -f, --silent, --quiet suppress most error messages --reference=RFILE use RFILE's context instead of using a CONTEXT value -u, --user=USER set user USER in the target security context -r, --role=ROLE set role ROLE in the target security context -t, --type=TYPE set type TYPE in the target security context -l, --range=RANGE set range RANGE in the target security context -R, --recursive change files and directories recursively -v, --verbose output a diagnostic for every file processed --help display this help and exit --version output version information and exit |
#chcon --reference /etc/passwd /var/www/
cgi-bin/ error/ html/ icons/ |
#chcon --reference /etc/passwd /var/www/html/dir/passwd
|
#ls -Z /var/www/html/dir/passwd
-rw-r--r-- root root system_u:object_r:etc_t /var/www/html/dir/passwd |
#ls -Z /var/www/html/dir/passwd
-rw-r--r-- root root system_u:object_r:etc_t /var/www/html/dir/passwd |
#tail /var/log/httpd/
access_log error_log |
#tail /var/log/httpd/error_log
[Tue Apr 05 17:41:02 2011] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0 [Tue Apr 05 17:41:02 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Tue Apr 05 17:41:02 2011] [notice] Digest: generating secret for digest authentication ... [Tue Apr 05 17:41:02 2011] [notice] Digest: done [Tue Apr 05 17:41:02 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations [Tue Apr 05 17:41:16 2011] [error] [client 192.168.15.10] Directory index forbidden by Options directive: /var/www/html/ [Tue Apr 05 17:41:16 2011] [error] [client 192.168.15.10] File does not exist: /var/www/html/favicon.ico [Tue Apr 05 17:41:19 2011] [error] [client 192.168.15.10] File does not exist: /var/www/html/favicon.ico [Tue Apr 05 17:41:20 2011] [error] [client 192.168.15.10] File does not exist: /var/www/html/dir. |
#tail /var/log/httpd/
access_log error_log |
#tail /var/log/httpd/access_log
192.168.15.10 - - [05/Apr/2011:17:41:26 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:42:14 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:42:15 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:42:15 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:42:15 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:42:16 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:00 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:00 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:01 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:01 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" |
#tail -f /var/log/httpd/access_log
192.168.15.10 - - [05/Apr/2011:17:41:26 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:42:14 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:42:15 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:42:15 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:42:15 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:42:16 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:00 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:00 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:01 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:01 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:30 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:31 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:32 +0600] "GET /dir/passwd HTTP/1.1" 304 - "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:36 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:36 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" 192.168.15.10 - - [05/Apr/2011:17:43:36 +0600] "GET /dir/passwd HTTP/1.1" 200 1692 "http://192.168.15.3/dir/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010021718 CentOS/3.0.18-1.el5.centos Firefox/3.0.18" |
#chcon
chcon: too few arguments Try `chcon --help' for more information. |
#chcon --help
Usage: chcon [OPTION]... CONTEXT FILE... or: chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE... or: chcon [OPTION]... --reference=RFILE FILE... Change the security context of each FILE to CONTEXT. -c, --changes like verbose but report only when a change is made -h, --no-dereference affect symbolic links instead of any referenced file (available only on systems with lchown system call) -f, --silent, --quiet suppress most error messages --reference=RFILE use RFILE's context instead of using a CONTEXT value -u, --user=USER set user USER in the target security context -r, --role=ROLE set role ROLE in the target security context -t, --type=TYPE set type TYPE in the target security context -l, --range=RANGE set range RANGE in the target security context -R, --recursive change files and directories recursively -v, --verbose output a diagnostic for every file processed --help display this help and exit --version output version information and exit |
#cp /root/1.txt /var/www/
cgi-bin/ error/ html/ icons/ |
#cp /root/1.txt /var/www/html/dir/
|
#ls -l /var/www/html/dir/1.txt
-rw-r--r-- 1 root root 6 Apr 5 17:45 /var/www/html/dir/1.txt |
#ls -l /var/www/html/dir/1.txt -Z
-rw-r--r-- root root root:object_r:httpd_sys_content_t /var/www/html/dir/1.txt |
#ls -l /var/www/html/dir/ -Z
-rw-r--r-- root root root:object_r:user_home_t 1.txt -rw-r--r-- root root system_u:object_r:etc_t passwd |
#ps auxZ | grep httpd
root:system_r:httpd_t root 3427 0.0 0.0 176448 3332 ? Ss 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3431 0.0 0.0 176580 3032 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3433 0.0 0.0 176580 2952 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3434 0.0 0.0 176580 3008 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3435 0.0 0.0 176580 2968 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3437 0.0 0.0 176580 2968 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3440 0.0 0.0 176580 2960 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3442 0.0 0.0 176580 3036 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3443 0.0 0.0 176580 2952 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:unconfined_t:SystemLow-SystemHigh root 3645 0.0 0.0 61152 740 pts/2 S+ 17:46 0:00 grep httpd |
#chcon --reference /var/www/html/dir/
1.txt passwd |
#chcon --reference /var/www/html/dir/
1.txt passwd |
#chcon --reference /var/www/html/dir/1.txt /var/www/html/dir/passwd
|
#chcon --help
Usage: chcon [OPTION]... CONTEXT FILE... or: chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE... or: chcon [OPTION]... --reference=RFILE FILE... Change the security context of each FILE to CONTEXT. -c, --changes like verbose but report only when a change is made -h, --no-dereference affect symbolic links instead of any referenced file (available only on systems with lchown system call) -f, --silent, --quiet suppress most error messages --reference=RFILE use RFILE's context instead of using a CONTEXT value -u, --user=USER set user USER in the target security context -r, --role=ROLE set role ROLE in the target security context -t, --type=TYPE set type TYPE in the target security context -l, --range=RANGE set range RANGE in the target security context -R, --recursive change files and directories recursively -v, --verbose output a diagnostic for every file processed --help display this help and exit --version output version information and exit |
#chcon -t etc_t /var/www/html/dir/passwd
|
#chcon -t user_home_t /var/www/html/dir/passwd
|
#ps auxZ | grep http
root:system_r:httpd_t root 3427 0.0 0.0 176448 3332 ? Ss 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3431 0.0 0.0 176580 3032 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3433 0.0 0.0 176580 2992 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3434 0.0 0.0 176580 3032 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3435 0.0 0.0 176580 2996 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3437 0.0 0.0 176580 2996 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3440 0.0 0.0 176580 2988 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3442 0.0 0.0 176580 3036 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:httpd_t apache 3443 0.0 0.0 176580 2992 ? S 17:41 0:00 /usr/sbin/httpd root:system_r:unconfined_t:SystemLow-SystemHigh root 3715 0.0 0.0 61152 732 pts/2 R+ 17:49 0:00 grep http |
#vim /etc/sysconfig/selinux
--- /tmp/l3-saved-3570.12966.14063 2011-04-05 10:44:29.000000000 +0600 +++ /etc/sysconfig/network-scripts/ifcfg-eth0:0 2011-04-05 10:45:36.000000000 +0600 @@ -1,8 +1,7 @@ # Atheros Communications Atheros AR8121/AR8113/AR8114 PCI-E Ethernet Controller -DEVICE=eth0 +DEVICE=eth0:0 BOOTPROTO=none ONBOOT=yes NETMASK=255.255.255.0 -IPADDR=192.168.15.3 -GATEWAY=192.168.15.253 +IPADDR=192.168.16.3 TYPE=Ethernet |
#reboot
|
#edquota user
Disk quotas for user user (uid 500): Filesystem blocks soft hard inodes soft hard /dev/sda6 60 0 0 20 0 0 "/tmp//EdP.aSCP0Xl" 3L, 215C |
#~
Disk quotas for user root (uid 0): none |
#repquota
Bad number of arguments. repquota: Utility for reporting quotas. Usage: repquota [-vugsi] [-c|C] [-t|n] [-F quotaformat] (-a | mntpoint) Bugs to mvw@planets.elm.net, jack@suse.cz |
#repquota a
repquota: Can't stat() given mountpoint a: No such file or directory Skipping... repquota: No correct mountpoint specified. repquota: Can't initialize mountpoint scan. |
#repquota -a
*** Report for user quotas on device /dev/sda6 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- root -- 211252 0 0 2414 0 0 xfs -- 0 0 0 1 0 0 user -- 60 0 0 20 0 0 |
#cat /etc/fstab
LABEL=/ / ext3 defaults 1 1 LABEL=/tmp /tmp ext3 usrquota,grpquota 1 2 LABEL=/var /var ext3 defaults 1 2 LABEL=/usr /usr ext3 defaults 1 2 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 LABEL=SWAP-sda5 swap swap defaults 0 0 LABEL=DATA7 /data7 ext3 defaults 0 0 |
#~
repquota: Can't stat() given mountpoint a: No such file or directory Skipping... repquota: No correct mountpoint specified. repquota: Can't initialize mountpoint scan. |
#repquota -a
*** Report for user quotas on device /dev/sda6 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- root -- 211252 0 0 2414 0 0 xfs -- 0 0 0 1 0 0 user -- 60 0 0 20 0 0 |
#passwd
Changing password for user root. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. |
LABEL=/ / ext3 defaults 1 1 LABEL=/tmp /tmp ext3 usrquota,grpquota 1 2 LABEL=/var /var ext3 defaults 1 2 LABEL=/usr /usr ext3 defaults 1 2 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 LABEL=SWAP-sda5 swap swap defaults 0 0 LABEL=DATA7 /data7 ext3 defaults 0 0
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=disabled # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted
Время первой команды журнала | 07:00:48 2011- 4- 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 06:07:43 2011- 4- 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 7.92 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 2.97 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.51 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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