| /l3/trainings/nt-bsdnet/2006-04-03/fbsd3.unix.nt/user :1 :2 |
|
|
$ su -
Password: |
|
#ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=b<RXCSUM,TXCSUM,VLAN_MTU>
inet6 fe80::207:e9ff:fe3c:2c15%em0 prefixlen 64 scopeid 0x1
inet 192.168.15.23 netmask 0xffffff00 broadcast 192.168.15.255
ether 00:07:e9:3c:2c:15
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
xl0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
options=9<RXCSUM,VLAN_MTU>
ether 00:04:76:a1:f2:1e
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
|
|
#mc
|
|
#cd /usr/ports/
|
|
#whereis sudo
sudo: /usr/ports/security/sudo |
|
#cd /security/sudo
bash: cd: /security/sudo: No such file or directory |
|
#cd security/
|
|
#cd sudo
|
|
#make install
checking for sys/bsdtypes.h... no
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking POSIX termios... yes
checking login_cap.h usability... yes
checking login_cap.h presence... yes
...
increased privileges.
/usr/local/bin/sudo
/usr/local/bin/sudoedit
If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type 'make deinstall'
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
http://www.courtesan.com/sudo/
|
|
#man sudo
|
|
#visudo
# sudoers file. # # See the sudoers man page for the details on how to write a sudoers file. # sudoers file. # # See the sudoers man page for the details on how to write a sudoers file. # sudoers file. # # This file MUST be edited with the 'visudo' command as root. # ... # Host alias specification # User alias specification # Cmnd alias specification # Defaults specification # Runas alias specification # User privilege specification visudo: sudoers file unchanged A# Samples A# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom A# %users localhost=/sbin/shutdown -h now |
|
#visudo
# sudoers file. # # This file MUST be edited with the 'visudo' command as root. # # See the sudoers man page for the details on how to write a sudoers file. # # Host alias specification # User alias specification # Cmnd alias specification # Defaults specification # Runas alias specification # User privilege specification root ALL=(ALL) ALL # Uncomment to allow people in group wheel to run all commands # %wheel ALL=(ALL) ALL # Same thing without a password visudo: sudoers file unchanged |
|
#man sudoers
|
|
#man sudoers
|
|
#cd /usr/local/etc/sudoers
bash: cd: /usr/local/etc/sudoers: Not a directory |
|
#cd /usr/local/etc/sudoers
bash: cd: /usr/local/etc/sudoers: Not a directory |
|
#ls -l
total 12 -rw-r--r-- 1 root wheel 1598 Jun 21 2005 Makefile -rw-r--r-- 1 root wheel 97 Jun 21 2005 distinfo -rw-r--r-- 1 root wheel 706 Dec 22 1999 pkg-descr -rwxr-xr-x 1 root wheel 280 Jul 20 2004 pkg-install -rw-r--r-- 1 root wheel 162 Aug 20 2004 pkg-plist drwxr-xr-x 3 root wheel 512 Apr 2 22:58 work |
|
#cd ..
|
|
#cd ..\
> |
|
#cd ..
|
|
#cd ..
|
|
#cd ..
|
|
#cd /usr/local/
|
|
#pkg_info -Lx sudo | grep /etc
/usr/local/etc/sudoers.sample |
|
#cd ..
|
|
#cd ..
|
|
#cd /usr/local/etc/
|
|
#ls -l -A
total 74 drwxr-xr-x 2 root wheel 512 Mar 31 12:16 bonobo-activation -r--r--r-- 1 root wheel 1107 Mar 31 12:17 cdrecord -r--r--r-- 1 root wheel 1107 Oct 12 10:48 cdrecord.sample drwxr-xr-x 5 root wheel 512 Mar 31 12:07 cups -r--r--r-- 1 root wheel 153 Mar 31 12:16 esd.conf -r--r--r-- 1 root wheel 153 Oct 12 13:44 esd.conf.default -r--r--r-- 1 root wheel 1480 Oct 12 15:59 fam.conf -r--r--r-- 1 root wheel 848 May 23 2005 ksysguarddrc drwxr-xr-x 2 root wheel 512 Mar 31 12:10 openldap ... -r--r--r-- 1 root wheel 13744 Mar 31 12:07 pkgtools.conf -r--r--r-- 1 root wheel 13744 Oct 12 09:00 pkgtools.conf.sample -r-xr-xr-x 1 root wheel 704 Oct 12 09:00 pkgtools.status-pkg.sh drwxr-xr-x 2 root wheel 512 Mar 31 12:16 rc.d drwxr-xr-x 2 root wheel 512 Mar 31 12:13 snmp -r--r----- 1 root wheel 608 Apr 2 22:58 sudoers -r--r--r-- 1 root wheel 4127 Apr 2 22:58 sudoers.sample drwxr-xr-x 3 root wheel 512 Mar 31 12:10 xdg -r--r--r-- 1 root wheel 340 Oct 12 12:38 xml2Conf.sh -r--r--r-- 1 root wheel 232 Oct 12 14:16 xsltConf.sh |
|
#vi sudoers
|
|
#pkg_info -Lx sudo | grep /etc
/usr/local/etc/sudoers.sample |
|
#visudo
# sudoers file. # # This file MUST be edited with the 'visudo' command as root. # # See the sudoers man page for the details on how to write a sudoers file. # # Host alias specification # User alias specification # Cmnd alias specification # Defaults specification # Runas alias specification # User privilege specification root ALL=(ALL) ALL # Uncomment to allow people in group wheel to run all commands # %wheel ALL=(ALL) ALL # Same thing without a password visudo: sudoers file unchanged |
|
#cp /etc/lo
localtime locate.rc login.access login.conf login.conf.db |
|
#cp /etc/lo
localtime locate.rc login.access login.conf login.conf.db |
|
#cp /usr/local/etc/sudoers{.sample,}
|
|
#vi /usr/local/etc/sudoers
|
|
#vi /usr/local/etc/sudoers
|
|
#vim /usr/local/etc/sudoers
|
|
#touch ~/.vimrc
|
|
#vim /usr/local/etc/sudoers
|
|
#exit
exit |
|
$cat /etc/master.passwd
cat: /etc/master.passwd: Permission denied |
|
$sudo
usage: sudo -K | -L | -V | -h | -k | -l | -v
usage: sudo [-HPSb] [-c class|-] [-p prompt] [-u username|#uid]
{ -e file [...] | -i | -s | <command> }
|
|
$sudo cat /etc/master.passwd
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
Password:
Sorry, try again.
Password:
Sorry, try again.
Password:
Sorry, try again.
sudo: 3 incorrect password attempts
|
|
$su -
Password: |
|
#exit
exit |
|
$sudo cat /etc/master.passwd
Password: Sorry, try again. Password: sudo: 1 incorrect password attempt |
|
$su -
Password: |
|
#traceroute 80.91.162.154
traceroute to 80.91.162.154 (80.91.162.154), 64 hops max, 40 byte packets 1 linux.nt (192.168.15.254) 0.311 ms 0.249 ms 0.221 ms 2 10.0.1.1 (10.0.1.1) 0.531 ms 0.429 ms 0.459 ms 3 * * * 4 tekexpert-lgw.sovam.net.ua (62.64.113.245) 40.352 ms 40.239 ms 40.684 ms 5 srp-2-1-cr0-co11.kv.sovam.net.ua (212.109.37.9) 40.926 ms 41.133 ms 40.545 ms 6 gi-0-1-55-br1-co11.kv.sovam.net.ua (85.223.224.101) 42.431 ms 41.365 ms 41.053 ms 7 datacom-gw.ix.net.ua (195.35.65.32) 46.426 ms 42.490 ms 42.300 ms 8 KE1-KTU.rtr.newline.net.ua (80.91.160.70) 43.050 ms 43.374 ms 42.803 ms 9 ll-datasat-r.newline.net.ua (80.91.160.222) 44.048 ms 44.378 ms 43.312 ms 10 * * * 11 * * * 12 gw.megabit.com.ua (80.91.160.214) 1844.892 ms 1720.702 ms 2025.306 ms 13 ns.zarja.com.ua (80.91.162.154) 2316.606 ms 3500.209 ms 2487.506 ms |
|
#apropos copy | grep file
cp(1) - copy files cpio(1) - copy files to and from archives dd(1) - convert and copy a file krb5_kt_ops(3), krb5_keytab_entry(3), krb5_kt_cursor(3), krb5_kt_add_entry(3), krb5_kt_close(3), krb5_kt_compare(3), krb5_kt_copy_entry_contents(3), krb5_kt_default(3), krb5_kt_default_name(3), krb5_kt_end_seq_get(3), krb5_kt_free_entry(3), krb5_kt_get_entry(3), krb5_kt_get_name(3), krb5_kt_get_type(3), krb5_kt_next_entry(3), krb5_kt_read_service_key(3), krb5_kt_register(3), krb5_kt_remove_entry(3 objcopy(1) - copy and translate object files pax(1) - read and write file archives and copy directory hierarchies rcp(1) - remote file copy scp(1) - secure copy (remote file copy program) |
|
#whatis intro
intro(1) - introduction to general commands (tools and utilities) intro(2) - introduction to system calls and error numbers intro(3) - introduction to the C libraries intro(4) - introduction to devices and device drivers intro(5) - introduction to file formats intro(6) - introduction to games intro(7) - miscellaneous information pages intro(8) - introduction to system maintenance and operation commands intro(9) - introduction to system kernel interfaces |
|
#ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=b<RXCSUM,TXCSUM,VLAN_MTU>
inet6 fe80::207:e9ff:fe3c:2c15%em0 prefixlen 64 scopeid 0x1
inet 192.168.15.23 netmask 0xffffff00 broadcast 192.168.15.255
ether 00:07:e9:3c:2c:15
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
xl0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
options=9<RXCSUM,VLAN_MTU>
ether 00:04:76:a1:f2:1e
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
|
|
#!if
ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=b<RXCSUM,TXCSUM,VLAN_MTU>
inet6 fe80::207:e9ff:fe3c:2c15%em0 prefixlen 64 scopeid 0x1
inet 192.168.15.23 netmask 0xffffff00 broadcast 192.168.15.255
ether 00:07:e9:3c:2c:15
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
xl0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
options=9<RXCSUM,VLAN_MTU>
ether 00:04:76:a1:f2:1e
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
|
|
#traceroute zarja.com.ua
traceroute to zarja.com.ua (80.91.162.154), 64 hops max, 40 byte packets 1 linux.nt (192.168.15.254) 0.378 ms 0.286 ms 0.209 ms 2 10.0.1.1 (10.0.1.1) 0.442 ms 0.431 ms 0.334 ms 3 * * * 4 tekexpert-lgw.sovam.net.ua (62.64.113.245) 43.761 ms 40.901 ms 40.183 ms 5 srp-2-1-cr0-co11.kv.sovam.net.ua (212.109.37.9) 40.679 ms 41.528 ms 40.933 ms 6 gi-0-1-55-br1-co11.kv.sovam.net.ua (85.223.224.101) 41.052 ms 41.905 ms 42.305 ms 7 datacom-gw.ix.net.ua (195.35.65.32) 42.681 ms 42.777 ms 42.446 ms 8 KE1-KTU.rtr.newline.net.ua (80.91.160.70) 43.418 ms 42.148 ms 42.430 ms 9 ll-datasat-r.newline.net.ua (80.91.160.222) 44.309 ms 43.782 ms 44.052 ms 10 * * * 11 * * * 12 gw.megabit.com.ua (80.91.160.214) 1492.501 ms 3427.516 ms 2814.294 ms 13 ns.zarja.com.ua (80.91.162.154) 1333.235 ms 2191.067 ms 2059.775 ms |
|
#ssh 80.91.162.153
Connection to 80.91.162.153 closed. |
|
#ssh 80.91.162.154
ssh_exchange_identification: Connection closed by remote host |
|
#pkg_info
kdegames-3.4.2_1 Games for the KDE integrated X11 desktop kdegraphics-3.4.2_1 Graphics utilities for the KDE3 integrated X11 desktop kdehier-1.0_6 Utility port which installs a hierarchy of shared KDE direc kdelibs-3.4.2_1 Base set of libraries needed by KDE programs kdemultimedia-3.4.2 Multimedia utilities for the KDE integrated X11 desktop kdemultimedia-akode-3.4.2 Default KDE audio backend kdemultimedia-akode-plugins-mpc-3.4.2 Musepack decoder plugin for akode kdemultimedia-akode-plugins-mpeg-3.4.2 MPEG audio decoder plugin for akode kdemultimedia-akode-plugins-oss-3.4.2 OSS output plugin for akode kdemultimedia-akode-plugins-resampler-3.4.2 Resampler plugin for akode ... xorg-nestserver-6.8.2 Nesting X server from X.Org xorg-printserver-6.8.2 X Print server from X.Org xorg-server-6.8.2_6 X.Org X server and related programs xorg-vfbserver-6.8.2 X virtual framebuffer server from X.Org xpdf-3.00_7 Display PDF files, and convert them to other formats xscreensaver-gnome-4.22 Save your screen while you entertain your cat (for GNOME us xterm-203 Terminal emulator for the X Window System xvid-1.0.3,1 An opensource MPEG-4 codec, based on OpenDivx yelp-2.10.0_1 A help browser for the GNOME 2 desktop zenity-2.10.0 Display GNOME dialogs from the command line |
|
#pkg_
pkg_add pkg_deinstall pkg_glob pkg_sort pkg_check pkg_delete pkg_info pkg_version pkg_create pkg_fetch pkg_sign pkg_which |
|
$rsync -avz fbsd4:/etc /tmp/
^Crsync error: received SIGUSR1 or SIGINT (code 20) at rsync.c(163) |
|
$rsync -avz fbsd4:/etc/rc.conf /tmp
^Crsync error: received SIGUSR1 or SIGINT (code 20) at rsync.c(163) |
|
$ping fbsd4
PING fbsd4.unix.nt (192.168.15.24): 56 data bytes ^C --- fbsd4.unix.nt ping statistics --- 11 packets transmitted, 0 packets received, 100% packet loss |
|
$ipfw list
ipfw: socket: Operation not permitted |
|
$su -
Password: |
|
#ping fbsd4
PING fbsd4.unix.nt (192.168.15.24): 56 data bytes ^C --- fbsd4.unix.nt ping statistics --- 5 packets transmitted, 0 packets received, 100% packet loss |
|
#ping fbsd2
PING fbsd2.unix.nt (192.168.15.22): 56 data bytes 64 bytes from 192.168.15.22: icmp_seq=0 ttl=64 time=0.833 ms 64 bytes from 192.168.15.22: icmp_seq=1 ttl=64 time=0.446 ms 64 bytes from 192.168.15.22: icmp_seq=2 ttl=64 time=0.457 ms ^C --- fbsd2.unix.nt ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.446/0.579/0.833/0.180 ms |
|
#ipfw list
00010 divert 8668 ip from any to any via em0 00110 pipe 1 ip from any 80 to 192.168.16.130 via xl0 in 00210 pipe 1 ip from any 21 to 192.168.16.130 via xl0 in 00310 pipe 1 ip from any 21 to 192.168.16.130 via xl0 out 00410 pipe 1 ip from any 80 to 192.168.16.130 via xl0 out 65535 allow ip from any to any |
|
#exit
exit |
|
$rsync -avz fbsd2:/etc/rc.conf /tmp
The authenticity of host 'fbsd2.unix.nt (192.168.15.22)' can't be established. DSA key fingerprint is ec:0e:af:b0:8b:3b:94:cf:e7:06:c8:13:b9:7b:ff:fa. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'fbsd2.unix.nt' (DSA) to the list of known hosts. Password: Password: receiving file list ... done rc.conf sent 42 bytes received 526 bytes 18.62 bytes/sec total size is 802 speedup is 1.41 |
|
$cd /tmp
|
|
$ls -l -A
total 58 drwxrwxrwt 2 root wheel 512 Apr 3 21:58 .ICE-unix drwxrwxrwt 2 root wheel 512 Apr 3 21:58 .X11-unix drwxrwxrwt 2 root wheel 512 Apr 3 21:58 .XIM-unix drwxrwxrwt 2 root wheel 512 Apr 3 21:58 .font-unix drwxrwxr-x 2 root operator 512 Apr 3 00:21 .snap drwx------ 5 500 500 512 Apr 2 21:52 Term-VT102-0.82 -rw-r--r-- 1 root wheel 25211 Apr 2 21:52 Term-VT102-0.82.tar.gz drwxr-xr-x 4 101 staff 512 Apr 2 21:51 Text-Iconv-1.4 -rw-r--r-- 1 root wheel 8986 Apr 2 21:52 Text-Iconv-1.4.tar.gz -rw-r--r-- 1 root wheel 6 Apr 4 14:39 file drwx------ 2 root wheel 512 Apr 2 23:52 mc-root -rw-r--r-- 1 user wheel 802 Apr 4 11:38 rc.conf drwxr-xr-x 3 root wheel 512 Apr 3 06:36 screens |
|
$zsh
\[v2#\!#$?#$UID#$$#$(/bin/date +)#$PWD#\033[1024D\033[K\]\[\033[0;32m\][\u@\h:\W]\$ \[\033[0m\]exit |
|
$mc
|
|
$File: l3bashrc Col 0 5740 bytes 0%
<~/.lilalov></tmpv>
/.. UP--DIR /.. UP--DIR
13679230~67.info 398Apr 4 15:01/.X11-unix 512Apr 3 21:58
16972343~ The Midnight Commander r 3 21:58
18009265~ r 2 21:52
l3-agent.
r 2 23:52
/screens 512Apr 3 06:36
return 0 Text-Ico~.tar.gz 8986Apr 2 21:52
====== rc.conf 802Apr 4 11:38
$
ps waux | awk '{print $2" "$11 }' | grep -q ^$PPID" "script
ps waux | awk '{print $2" "$11 }' | grep -q ^$PPID" "script
ps waux | awk '{print $2" "$11 }' | grep -q ^$PPID" "script
|
|
$cd /tmp; ssh fbsd2 tar cf - /etc | tar x
tar: Error opening archive: Failed to open '/dev/sa0': No such file or directory Password: tar: Removing leading '/' from member names tar: /etc/master.passwd: could not open file: Permission denied tar: /etc/nsmb.conf: could not open file: Permission denied tar: /etc/opieaccess: could not open file: Permission denied tar: /etc/spwd.db: could not open file: Permission denied tar: /etc/ssh/ssh_host_key: could not open file: Permission denied tar: /etc/ssh/ssh_host_dsa_key: could not open file: Permission denied tar: /etc/ssh/ssh_host_rsa_key: could not open file: Permission denied tar: /etc/ppp/ppp.conf: could not open file: Permission denied tar: /etc/ntp: Couldn't visit directory: Permission denied tar: /etc/isdn: Couldn't visit directory: Permission denied tar: /etc/bluetooth/hcsecd.conf: could not open file: Permission denied |
|
$cd /tmp/1; ssh fbsd2 tar cf - /tmp | tar x
bash: cd: /tmp/1: No such file or directory tar: Error opening archive: Failed to open '/dev/sa0': No such file or directory Password: tar: Removing leading '/' from member names tar: /tmp/mc-root: Couldn't visit directory: Permission denied tar: /tmp/Term-VT102-0.82: Couldn't visit directory: Permission denied |
|
$ls -l -A
total 60 drwxrwxrwt 2 root wheel 512 Apr 3 21:58 .ICE-unix drwxrwxrwt 2 root wheel 512 Apr 3 21:58 .X11-unix drwxrwxrwt 2 root wheel 512 Apr 3 21:58 .XIM-unix drwxrwxrwt 2 root wheel 512 Apr 3 21:58 .font-unix drwxrwxr-x 2 root operator 512 Apr 3 00:21 .snap drwx------ 5 500 500 512 Apr 2 21:52 Term-VT102-0.82 -rw-r--r-- 1 root wheel 25211 Apr 2 21:52 Term-VT102-0.82.tar.gz drwxr-xr-x 4 101 staff 512 Apr 2 21:51 Text-Iconv-1.4 -rw-r--r-- 1 root wheel 8986 Apr 2 21:52 Text-Iconv-1.4.tar.gz -rw-r--r-- 1 root wheel 6 Apr 4 14:39 file drwx------ 2 root wheel 512 Apr 2 23:52 mc-root drwx------ 2 user wheel 512 Apr 4 15:01 mc-user -rw-r--r-- 1 user wheel 802 Apr 4 11:38 rc.conf drwxr-xr-x 3 root wheel 512 Apr 3 06:36 screens |
|
$cd /tmp/1; ssh fbsd2 tar cf - /tmp | tar x
bash: cd: /tmp/1: No such file or directory tar: Error opening archive: Failed to open '/dev/sa0': No such file or directory Password: tar: Removing leading '/' from member names tar: /tmp/etc/master.passwd: could not open file: Permission denied tar: /tmp/etc/nsmb.conf: could not open file: Permission denied tar: /tmp/etc/opieaccess: could not open file: Permission denied tar: /tmp/etc/rc.conf.b: could not open file: Permission denied tar: /tmp/etc/spwd.db: could not open file: Permission denied tar: /tmp/etc/ssh/ssh_host_dsa_key: could not open file: Permission denied tar: /tmp/etc/ssh/ssh_host_key: could not open file: Permission denied tar: /tmp/etc/ssh/ssh_host_rsa_key: could not open file: Permission denied tar: /tmp/etc/ppp/ppp.conf: could not open file: Permission denied tar: /tmp/etc/ntp: Couldn't visit directory: Permission denied tar: /tmp/etc/isdn: Couldn't visit directory: Permission denied tar: /tmp/etc/bluetooth/hcsecd.conf: could not open file: Permission denied tar: /tmp/mc-root: Couldn't visit directory: Permission denied tar: /tmp/Term-VT102-0.82: Couldn't visit directory: Permission denied |
|
$cd /tmp/1; ssh fbsd2 tar cf - /tmp | tar xf -
bash: cd: /tmp/1: No such file or directory Password: |
|
$mkdir /tmp/1
|
|
$cd /tmp/1; ssh fbsd2 tar cf - /tmp | tar xf -
Password: tar: Removing leading '/' from member names tar: /tmp/etc/master.passwd: could not open file: Permission denied tar: /tmp/etc/nsmb.conf: could not open file: Permission denied tar: /tmp/etc/opieaccess: could not open file: Permission denied tar: /tmp/etc/rc.conf.b: could not open file: Permission denied tar: /tmp/etc/spwd.db: could not open file: Permission denied tar: /tmp/etc/ssh/ssh_host_dsa_key: could not open file: Permission denied tar: /tmp/etc/ssh/ssh_host_key: could not open file: Permission denied tar: /tmp/etc/ssh/ssh_host_rsa_key: could not open file: Permission denied tar: /tmp/etc/ppp/ppp.conf: could not open file: Permission denied tar: /tmp/etc/ntp: Couldn't visit directory: Permission denied tar: /tmp/etc/isdn: Couldn't visit directory: Permission denied tar: /tmp/etc/bluetooth/hcsecd.conf: could not open file: Permission denied tar: /tmp/mc-root: Couldn't visit directory: Permission denied tar: /tmp/Term-VT102-0.82: Couldn't visit directory: Permission denied |
|
$su -
Password: |
|
#ssh-key
ssh-keygen ssh-keyscan |
|
#ssh-keygen -l -f /etc/ss
ssh/ ssl/ |
|
#ssh-keygen -l -f /etc/ssh/ssh
ssh_config ssh_host_key ssh_host_rsa_key.pub ssh_host_dsa_key ssh_host_key.pub sshd_config ssh_host_dsa_key.pub ssh_host_rsa_key |
|
#ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key
2048 62:7f:97:d0:ae:68:b2:e3:7a:82:76:6a:fa:51:76:73 /etc/ssh/ssh_host_dsa_key.pub |
|
#ssh 127.0.0.1
The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established. DSA key fingerprint is 62:7f:97:d0:ae:68:b2:e3:7a:82:76:6a:fa:51:76:73. Are you sure you want to continue connecting (yes/no)? no Host key verification failed. |
|
#man ssh-keygen
|
|
#ssh-key
ssh-keygen ssh-keyscan |
|
#ssh-keygen -t dsa
Generating public/private dsa key pair. Enter file in which to save the key (/root/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_dsa. Your public key has been saved in /root/.ssh/id_dsa.pub. The key fingerprint is: 4c:c6:7c:eb:5d:ea:55:22:8d:bd:e6:c3:5d:68:81:35 root@fbsd3.unix.nt |
|
#ca
caesar callbootd cap_mkdb catalogmanager cal caller case catman calendar camcontrol cat |
|
#cat ~/.ssh/id_dsa
id_dsa id_dsa.pub |
|
#cat ~/.ssh/id_dsa.pub | ssh fbsd2 'cat >> ~/.ssh/authorize_keys
' |
|
#ssh fbsd2
Last login: Tue Apr 4 15:58:40 2006 from fbsd3.linux.nt
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 6.0-RELEASE (MAIN) #0: Mon Apr 3 14:33:41 EEST 2006
Welcome to FreeBSD!
Before seeking technical support, please use the following resources:
o Security advisories and updated errata information for all releases are
at http://www.FreeBSD.org/releases/ - always consult the ERRATA section
for your release first as it's updated frequently.
o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and,
along with the mailing lists, can be searched by going to
http://www.FreeBSD.org/search/. If the doc distribution has
been installed, they're also available formatted in /usr/share/doc.
If you still have a question or problem, please take the output of
`uname -a', along with any relevant error messages, and email it
as a question to the questions@FreeBSD.org mailing list. If you are
unfamiliar with FreeBSD's directory layout, please refer to the hier(7)
manual page. If you are not familiar with manual pages, type `man man'.
You may also use sysinstall(8) to re-enter the installation and
configuration utility. Edit /etc/motd to change this login announcement.
|
|
#exit
exit Connection to fbsd2.unix.nt closed. |
|
#cat ~/.ssh/id_dsa.pub | ssh fbsd2 'cat >> ~/.ssh/authorize_keys
|
|
#cat ~/.ssh/id_dsa.pub | ssh fbsd2 'cat >> ~/.ssh/authorize_keys
> > > |
|
#cat ~/.ssh/id_dsa.pub | ssh fbsd2 'cat >> ~/.ssh/authorize_keys
|
|
#cat ~/.ssh/id_dsa.pub | ssh fbsd2 'cat >> ~/.ssh/authorize_key
|
|
#vim /etc/passwd
|
id_dsa id_dsa.pub
| Время первой команды журнала | 22:53:07 2006- 4- 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Время последней команды журнала | 16:05:48 2006- 4- 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Количество командных строк в журнале | 100 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Процент команд с ненулевым кодом завершения, % | 21.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Процент синтаксически неверно набранных команд, % | 2.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Суммарное время работы с терминалом *, час | 2.67 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Количество командных строк в единицу времени, команда/мин | 0.62 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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