/l3/users/07-07-2008/fbsd-adm/fbsd1.unix.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 :22 :23 :24 :25 :26 :27 :28 :29 :30 |
|
#vim for2
--- /tmp/l3-saved-58102.859.4729 2008-07-09 12:02:20.000000000 +0300 +++ for2 2008-07-09 12:02:27.000000000 +0300 @@ -3,5 +3,5 @@ for i in `jot 100 0` do pw user add user$i -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ -chpass -p "\$1\$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV." user$i +chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i done |
#vipw
user50:$1$gi4.dgMH.:1052:1052:russian:0:0:User &:/home/user50:/usr/local/bin/bas h user51:$1$gi4.dgMH.:1053:1053:russian:0:0:User &:/home/user51:/usr/local/bin/bas h user52:$1$gi4.dgMH.:1054:1054:russian:0:0:User &:/home/user52:/usr/local/bin/bas h user53:$1$gi4.dgMH.:1055:1055:russian:0:0:User &:/home/user53:/usr/local/bin/bas h user54:$1$gi4.dgMH.:1056:1056:russian:0:0:User &:/home/user54:/usr/local/bin/bas h user55:$1$gi4.dgMH.:1057:1057:russian:0:0:User &:/home/user55:/usr/local/bin/bas h user56:$1$gi4.dgMH.:1058:1058:russian:0:0:User &:/home/user56:/usr/local/bin/bas h user57:$1$gi4.dgMH.:1059:1059:russian:0:0:User &:/home/user57:/usr/local/bin/bas h user58:$1$gi4.dgMH.:1060:1060:russian:0:0:User &:/home/user58:/usr/local/bin/bas h user59:$1$gi4.dgMH.:1061:1061:russian:0:0:User &:/home/user59:/usr/local/bin/bas :q! vipw: no changes made |
#ls /home
user user18 user28 user38 user48 user58 user68 user78 user88 user98 user0 user19 user29 user39 user49 user59 user69 user79 user89 user99 user1 user2 user3 user4 user5 user6 user7 user8 user9 user10 user20 user30 user40 user50 user60 user70 user80 user90 user11 user21 user31 user41 user51 user61 user71 user81 user91 user12 user22 user32 user42 user52 user62 user72 user82 user92 user13 user23 user33 user43 user53 user63 user73 user83 user93 user14 user24 user34 user44 user54 user64 user74 user84 user94 user15 user25 user35 user45 user55 user65 user75 user85 user95 user16 user26 user36 user46 user56 user66 user76 user86 user96 user17 user27 user37 user47 user57 user67 user77 user87 user97 |
#cat for2
#!/usr/local/bin/bash set -x for i in `jot 100 0` do pw user add user$i -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i done |
#cat for1
#!/usr/local/bin/bash for i in "Kiev Moscow Lviv" do echo $i done |
#cp for2 for1
|
#cp for2 for3
|
#vim for3
--- /tmp/l3-saved-58102.20381.5900 2008-07-09 12:04:25.000000000 +0300 +++ for3 2008-07-09 12:04:41.000000000 +0300 @@ -1,7 +1,7 @@ #!/usr/local/bin/bash set -x for i in `jot 100 0` -do pw user add user$i -s /usr/local/bin/bash \ +do pw user delete user$i -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i done |
#man pw
|
#vim for3
--- /tmp/l3-saved-58102.32050.2844 2008-07-09 12:06:10.000000000 +0300 +++ for3 2008-07-09 12:06:30.000000000 +0300 @@ -1,7 +1,5 @@ #!/usr/local/bin/bash set -x for i in `jot 100 0` -do pw user delete user$i -s /usr/local/bin/bash \ --L russian -m -d /home/user$i ;\ -chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i +do pw user delete user$i -r done |
#./for3
+ pw user delete user50 -r pw: unknown keyword `delete' + for i in '`jot 100 0`' + pw user delete user51 -r pw: unknown keyword `delete' + for i in '`jot 100 0`' + pw user delete user52 -r pw: unknown keyword `delete' + for i in '`jot 100 0`' + pw user delete user53 -r ... pw: unknown keyword `delete' + for i in '`jot 100 0`' + pw user delete user97 -r pw: unknown keyword `delete' + for i in '`jot 100 0`' + pw user delete user98 -r pw: unknown keyword `delete' + for i in '`jot 100 0`' + pw user delete user99 -r pw: unknown keyword `delete' |
#vim for3
--- /tmp/l3-saved-58102.17378.18503 2008-07-09 12:06:39.000000000 +0300 +++ for3 2008-07-09 12:06:43.000000000 +0300 @@ -1,5 +1,5 @@ #!/usr/local/bin/bash set -x for i in `jot 100 0` -do pw user delete user$i -r +do pw user del user$i -r done |
#./for3
+ pw user del user25 -r + for i in '`jot 100 0`' + pw user del user26 -r + for i in '`jot 100 0`' + pw user del user27 -r + for i in '`jot 100 0`' + pw user del user28 -r + for i in '`jot 100 0`' + pw user del user29 -r + for i in '`jot 100 0`' ... + for i in '`jot 100 0`' + pw user del user95 -r + for i in '`jot 100 0`' + pw user del user96 -r + for i in '`jot 100 0`' + pw user del user97 -r + for i in '`jot 100 0`' + pw user del user98 -r + for i in '`jot 100 0`' + pw user del user99 -r |
#vim for3
--- /tmp/l3-saved-58102.18588.23441 2008-07-09 12:06:59.000000000 +0300 +++ for3 2008-07-09 12:09:57.000000000 +0300 @@ -1,5 +1,10 @@ #!/usr/local/bin/bash set -x -for i in `jot 100 0` -do pw user del user$i -r +for i in `jot 3 0` +do +echo "Please, give user name: " +read username +do pw user add $username -m -d /home/$username -s /usr/local/bin/bash ; chpass + + done |
#vim for2
|
#~
2 set -x 3 for i in `jot 3 0` 4 do pw user add /home/ /usr/ /bin/bash chp ss -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." $username 5 done "Please, give user name: " 8 done ~ ~ ~ a ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "for3" 8L, 235C written |
#./for3
./for3: line 7: syntax error near unexpected token `do' ./for3: line 7: `do pw user add $username -m -d /home/$username -s /usr/local/bin/bash ; chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." $username' |
#vim for3
--- /tmp/l3-saved-58102.20712.18056 2008-07-09 12:11:16.000000000 +0300 +++ for3 2008-07-09 12:12:25.000000000 +0300 @@ -1,8 +1,11 @@ #!/usr/local/bin/bash set -x -for i in `jot 3 0` -do + echo "Please, give user name: " read username +while [ $username != exit ] +do +#echo "Please, give user name: " +#read username do pw user add $username -m -d /home/$username -s /usr/local/bin/bash ; chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." $username done |
#./for3
+ echo 'Please, give user name: ' Please, give user name: + read username cherep ./for3: line 10: syntax error near unexpected token `do' ./for3: line 10: `do pw user add $username -m -d /home/$username -s /usr/local/bin/bash ; chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." $username' |
#vim for3
--- /tmp/l3-saved-58102.4556.9003 2008-07-09 12:12:46.000000000 +0300 +++ for3 2008-07-09 12:12:50.000000000 +0300 @@ -7,5 +7,5 @@ do #echo "Please, give user name: " #read username -do pw user add $username -m -d /home/$username -s /usr/local/bin/bash ; chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." $username +pw user add $username -m -d /home/$username -s /usr/local/bin/bash ; chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." $username done |
#./for3
+ pw user add cherep -m -d /home/cherep -s /usr/local/bin/bash pw: login name `cherep' already exists + chpass -p '$1$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV.' cherep chpass: user information updated + '[' cherep '!=' exit ']' + pw user add cherep -m -d /home/cherep -s /usr/local/bin/bash pw: login name `cherep' already exists + chpass -p '$1$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV.' cherep chpass: user information updated + '[' cherep '!=' exit ']' ... + '[' cherep '!=' exit ']' + pw user add cherep -m -d /home/cherep -s /usr/local/bin/bash pw: login name `cherep' already exists + chpass -p '$1$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV.' cherep chpass: user information updated + '[' cherep '!=' exit ']' + pw user add cherep -m -d /home/cherep -s /usr/local/bin/bash pw: login name `cherep' already exists + chpass -p '$1$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV.' cherep ^C |
#vim for3
--- /tmp/l3-saved-58102.12041.5982 2008-07-09 12:13:15.000000000 +0300 +++ for3 2008-07-09 12:13:36.000000000 +0300 @@ -1,11 +1,11 @@ #!/usr/local/bin/bash set -x -echo "Please, give user name: " -read username -while [ $username != exit ] -do #echo "Please, give user name: " #read username +while [ $username != exit ] +do +echo "Please, give user name: " +read username pw user add $username -m -d /home/$username -s /usr/local/bin/bash ; chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." $username done |
#./for3
+ '[' '!=' exit ']' ./for3: line 6: [: !=: unary operator expected |
#vim for3
--- /tmp/l3-saved-58102.2181.18975 2008-07-09 12:13:42.000000000 +0300 +++ for3 2008-07-09 12:13:55.000000000 +0300 @@ -1,6 +1,6 @@ #!/usr/local/bin/bash set -x - +username=0 #echo "Please, give user name: " #read username while [ $username != exit ] |
#./for3
+ username=0 + '[' 0 '!=' exit ']' + echo 'Please, give user name: ' Please, give user name: + read username cherepenin + pw user add cherepenin -m -d /home/cherepenin -s /usr/local/bin/bash + chpass -p '$1$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV.' cherepenin chpass: user information updated + '[' cherepenin '!=' exit ']' ... :q! + pw user add ':q!' -m -d '/home/:q!' -s /usr/local/bin/bash pw: invalid character `:' at position 0 in userid/group name + chpass -p '$1$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV.' ':q!' chpass: unknown user: :q! + '[' ':q!' '!=' exit ']' + echo 'Please, give user name: ' Please, give user name: + read username ^C |
#vim for3
|
#~
+ username=0 + '[' 0 '!=' exit ']' + echo 'Please, give user name: ' Please, give user name: + read username exit + pw user add exit -m -d /home/exit -s /usr/local/bin/bash + chpass -p '$1$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV.' exit chpass: user information updated + '[' exit '!=' exit ']' |
#vim for3
--- /tmp/l3-saved-58102.5805.30998 2008-07-09 12:16:21.000000000 +0300 +++ for3 2008-07-09 12:19:38.000000000 +0300 @@ -1,11 +1,13 @@ #!/usr/local/bin/bash -set -x -username=0 -#echo "Please, give user name: " -#read username -while [ $username != exit ] +FILES=" +/sbin/mount +/usr/local/bin/bash +/bin/sergey +/bin/sh" +for i in $FILES do -echo "Please, give user name: " -read username -pw user add $username -m -d /home/$username -s /usr/local/bin/bash ; chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." $username -done +if [ ! -e "$i" ] +then echo "File $i not found"; +continue +fi + |
#ls -lh /sbin/mount
-r-xr-xr-x 1 root wheel 15K Jan 16 02:31 /sbin/mount |
#ls -lh /sbin/mount | awk '{print$9 " and size: " $5}'
/sbin/mount and size: 15K |
#ls -lh /sbin/mount | awk '{print$9 " size: " $5}'
/sbin/mount size: 15K |
#vim for3
--- /tmp/l3-saved-58102.6091.17685 2008-07-09 12:20:52.000000000 +0300 +++ for3 2008-07-09 12:21:06.000000000 +0300 @@ -10,4 +10,5 @@ then echo "File $i not found"; continue fi +ls -lh /sbin/mount | awk '{print$9 " size: " $5}' |
#basename /sbin/mount
mount |
#vim for3
--- /tmp/l3-saved-58102.25050.28236 2008-07-09 12:21:30.000000000 +0300 +++ for3 2008-07-09 12:22:09.000000000 +0300 @@ -11,4 +11,6 @@ continue fi ls -lh /sbin/mount | awk '{print$9 " size: " $5}' +whatis `basename $i` +done |
#./for3
/sbin/mount size: 15K VFS_MOUNT(9) - mount a file system amd(8) - automatically mount file systems exports(5) - define remote mount points for NFS mount requests fixmount(8) - fix remote mount entries free_mntarg(9), kernel_mount(9), kernel_vmount(9), mount_arg(9), mount_argb(9), mount_argf(9), mount_argsu(9) - functions provided as part of the kernel mount interface mdmfs(8), mount_mfs(8) - configure and mount an in-memory file system using the md(4) driver mount(2), nmount(2), unmount(2) - mount or dismount a file system mount(8) - mount file systems mount_cd9660(8) - mount an ISO-9660 file system ... vfs_mount(9) - generic file system mount function vfs_rootmountalloc(9) - allocate a root mount structure vfs_suser(9) - check if credentials have superuser privileges for a mount point vfs_unbusy(9) - unbusy a mount point /sbin/mount size: 15K bash: nothing appropriate File /bin/sergey not found /sbin/mount size: 15K nanobsd(8), nanobsd.sh(8) - utility used to create a FreeBSD system image suitable for embedded applications sh(1) - command interpreter (shell) |
#vim for3
--- /tmp/l3-saved-58102.1087.9606 2008-07-09 12:22:27.000000000 +0300 +++ for3 2008-07-09 12:22:34.000000000 +0300 @@ -1,6 +1,5 @@ #!/usr/local/bin/bash FILES=" -/sbin/mount /usr/local/bin/bash /bin/sergey /bin/sh" |
#./for3
/sbin/mount size: 15K bash: nothing appropriate File /bin/sergey not found /sbin/mount size: 15K nanobsd(8), nanobsd.sh(8) - utility used to create a FreeBSD system image suitable for embedded applications sh(1) - command interpreter (shell) |
#vim for3
--- /tmp/l3-saved-58102.18782.20040 2008-07-09 12:22:42.000000000 +0300 +++ for3 2008-07-09 12:22:51.000000000 +0300 @@ -9,7 +9,7 @@ then echo "File $i not found"; continue fi -ls -lh /sbin/mount | awk '{print$9 " size: " $5}' +ls -lh $i | awk '{print$9 " size: " $5}' whatis `basename $i` done |
#./for3
/usr/local/bin/bash size: 593K bash: nothing appropriate File /bin/sergey not found /bin/sh size: 104K nanobsd(8), nanobsd.sh(8) - utility used to create a FreeBSD system image suitable for embedded applications sh(1) - command interpreter (shell) |
#cat for3
#!/usr/local/bin/bash FILES=" /usr/local/bin/bash /bin/sergey /bin/sh" for i in $FILES do if [ ! -e "$i" ] then echo "File $i not found"; continue fi ls -lh $i | awk '{print$9 " size: " $5}' whatis `basename $i` done |
#A=0
|
#while test $A -lt 100 ; do A=$((A+1)) ; echo $A ; done
1 2 3 4 5 6 7 8 9 10 ... 91 92 93 94 95 96 97 98 99 100 |
#while test $A -lt 100 ; do A=$((A+1)) ; echo $A; sleep 2
|
#while test $A -lt 100 ; do A=$((A+1)) ; echo $A; sleep
|
#while test $A -lt 100 ; do A=$((A+1)) ; echo $A
|
#while test $A -lt 100 ; do A=$((A+1)) ; echo $A ; done
|
#A=0
|
#^C
|
#^C
^C ^C ^C ^C |
#ls
'echo 09:48:03 | tr '[:lower:]' '[:upper:]'' 'echo 123456 | tr '[:lower:]' '[:upper:]'' 'echo 2008 | tr '[:lower:]' '[:upper:]'' 'echo 8 | tr '[:lower:]' '[:upper:]'' 'echo A:\WINDOWS\SYSTEM32 | tr '[:lower:]' '[:upper:]'' 'echo Jul | tr '[:lower:]' '[:upper:]'' 'echo NEWFILE | tr '[:lower:]' '[:upper:]'' 'echo TEST | tr '[:lower:]' '[:upper:]'' 'echo Tue Jul 8 09:48:20 UTC 2008 | tr '[:lower:]' '[:upper:]'' 'echo Tue | tr '[:lower:]' '[:upper:]'' ... .font-unix .snap .xorg.conf898 123.bmp 123.jpeg 123.jpg for1 for2 for3 test |
#cat names
cat: names: No such file or directory |
#vim name
--- /dev/null 2008-07-09 12:26:52.000000000 +0300 +++ name 2008-07-09 12:26:52.000000000 +0300 @@ -0,0 +1,5 @@ +administrator +admin +domainadmin +director +secretary |
#man pw
|
#cat for1
#!/usr/local/bin/bash set -x for i in `jot 100 0` do pw user add user$i -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i done |
#vipw
uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp /uucico pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin messagebus:*:556:556::0:0:D-BUS Daemon User:/nonexistent:/sbin/nologin polkit:*:562:562::0:0:PolicyKit Daemon User:/nonexistent:/sbin/nologin avahi:*:558:558::0:0:Avahi Daemon User:/nonexistent:/sbin/nologin gdm:*:92:92::0:0:GNOME Display Manager:/nonexistent:/sbin/nologin user:$1$Df1VmPYg$pCw2QihaJkfOvSuWmx8.50:1001:0::0:0:User &:/home/user:/usr/local /bin/bash cherep:$1$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV.:1002:1002::0:0:User &:/home/cherep:/us r/local/bin/bash cherepenin:$1$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV.:1003:1003::0:0:User &:/home/cherep enin:/usr/local/bin/bash ntua:$1$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV.:1004:1004::0:0:User &:/home/ntua:/usr/lo cal/bin/bash exit:$1$gi4.dgMH$Ifm9bzNLOTcLwJ8SAGEtV.:1005:1005::0:0:User &:/home/exit:/usr/lo cal/bin/bash :q! vipw: no changes made |
#cat for1
#!/usr/local/bin/bash set -x for i in `jot 100 0` do pw user add user$i -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i done |
#vim for1
--- /tmp/l3-saved-58102.9319.7622 2008-07-09 12:29:30.000000000 +0300 +++ for1 2008-07-09 12:30:00.000000000 +0300 @@ -3,5 +3,6 @@ for i in `jot 100 0` do pw user add user$i -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ -chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i +#chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i +pw usermod user done |
#pw add user user200
|
#pw usermod -h 0 user200
pw: user name or id required |
#pw usermod -h user200
pw: user name or id required |
#pw usermod user200 -h 0
new password for user user200: |
#ssh 127.0.0.1 -l user200
Password: Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 6.3-RELEASE (SMP) #0: Wed Jan 16 04:45:45 UTC 2008 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, ... 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. Could not chdir to home directory /home/user200: No such file or directory $ exit Connection to 127.0.0.1 closed. |
#echo password | pw usermod user200 -h 0
|
#ssh 127.0.0.1 -l user200
Password: Last login: Wed Jul 9 12:30:56 2008 from localhost.unix. Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 6.3-RELEASE (SMP) #0: Wed Jan 16 04:45:45 UTC 2008 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. ... 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. Could not chdir to home directory /home/user200: No such file or directory $ exit Connection to 127.0.0.1 closed. |
#vim for1
--- /tmp/l3-saved-58102.28529.8931 2008-07-09 12:31:28.000000000 +0300 +++ for1 2008-07-09 12:31:53.000000000 +0300 @@ -4,5 +4,5 @@ do pw user add user$i -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ #chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i -pw usermod user +echo password | pw usermod user$i -h 0 done |
#vim for1
|
#./for1
+ pw usermod user62 -h 0 + for i in '`jot 100 0`' + pw user add user63 -s /usr/local/bin/bash -L russian -m -d /home/user63 + echo password + pw usermod user63 -h 0 + for i in '`jot 100 0`' + pw user add user64 -s /usr/local/bin/bash -L russian -m -d /home/user64 + echo password + pw usermod user64 -h 0 + for i in '`jot 100 0`' ... + echo password + pw usermod user97 -h 0 + for i in '`jot 100 0`' + pw user add user98 -s /usr/local/bin/bash -L russian -m -d /home/user98 + echo password + pw usermod user98 -h 0 + for i in '`jot 100 0`' + pw user add user99 -s /usr/local/bin/bash -L russian -m -d /home/user99 + echo password + pw usermod user99 -h 0 |
#vipw
r90:/usr/local/bin/bash user91:$1$LKvgmch9$4EovcJxUirK.4AWgwWf61.:1098:1098:russian:0:0:User &:/home/use r91:/usr/local/bin/bash user92:$1$Sfvi294Q$sJsv3BWp5hY/HR89FaQBc.:1099:1099:russian:0:0:User &:/home/use r92:/usr/local/bin/bash user93:$1$0l8pI.ek$BhTHSvLhWcB2XbJkyfpPu.:1100:1100:russian:0:0:User &:/home/use r93:/usr/local/bin/bash user94:$1$jHZSPDD6$xNiO9GilNKfWdUBEs3c5W/:1101:1101:russian:0:0:User &:/home/use r94:/usr/local/bin/bash user95:$1$CPS5YfoQ$6dqF/6u9jtM9prwtWviZ10:1102:1102:russian:0:0:User &:/home/use r95:/usr/local/bin/bash user96:$1$tCRzYgcC$YKG77s8FRke2AZT.cGDff0:1103:1103:russian:0:0:User &:/home/use r96:/usr/local/bin/bash user97:$1$m92d7zJW$zRXCw8seDhdguak.BnfI2/:1104:1104:russian:0:0:User &:/home/use r97:/usr/local/bin/bash user98:$1$FEtGrQdj$O5N1Rkj8ocPpO4Y/c9V1o1:1105:1105:russian:0:0:User &:/home/use r98:/usr/local/bin/bash user99:$1$qbVfYJ7w$jUai4YxS4kvI/kh8uf1Ql1:1106:1106:russian:0:0:User &:/home/use r99:/usr/local/bin/bash :q! vipw: no changes made |
#ls
'echo 09:48:03 | tr '[:lower:]' '[:upper:]'' 'echo 123456 | tr '[:lower:]' '[:upper:]'' 'echo 2008 | tr '[:lower:]' '[:upper:]'' 'echo 8 | tr '[:lower:]' '[:upper:]'' 'echo A:\WINDOWS\SYSTEM32 | tr '[:lower:]' '[:upper:]'' 'echo Jul | tr '[:lower:]' '[:upper:]'' 'echo NEWFILE | tr '[:lower:]' '[:upper:]'' 'echo TEST | tr '[:lower:]' '[:upper:]'' 'echo Tue Jul 8 09:48:20 UTC 2008 | tr '[:lower:]' '[:upper:]'' 'echo Tue | tr '[:lower:]' '[:upper:]'' ... .snap .xorg.conf898 123.bmp 123.jpeg 123.jpg for1 for2 for3 name test |
#ls while*
ls: while*: No such file or directory |
#cp for1 while1
|
#cat names
cat: names: No such file or directory |
#cat name
administrator admin domainadmin director secretary |
#vim while1
--- /tmp/l3-saved-58102.17879.28262 2008-07-09 12:33:14.000000000 +0300 +++ while1 2008-07-09 12:33:58.000000000 +0300 @@ -1,8 +1,13 @@ #!/usr/local/bin/bash set -x -for i in `jot 100 0` -do pw user add user$i -s /usr/local/bin/bash \ --L russian -m -d /home/user$i ;\ -#chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i -echo password | pw usermod user$i -h 0 -done +while read /tmp/name; do echo $lines ; done + +# +# +# +#for i in `jot 100 0` +#do pw user add user$i -s /usr/local/bin/bash \ +#-L russian -m -d /home/user$i ;\ +##chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i +#echo password | pw usermod user$i -h 0 +#done |
#./while1
+ read /tmp/name ./while1: line 3: read: `/tmp/name': not a valid identifier |
#vim while1
--- /tmp/l3-saved-58102.14828.20280 2008-07-09 12:34:13.000000000 +0300 +++ while1 2008-07-09 12:34:46.000000000 +0300 @@ -1,6 +1,6 @@ #!/usr/local/bin/bash set -x -while read /tmp/name; do echo $lines ; done +cat /tmp/name | while read $lines ; do echo "$lines_output" ; done # # |
#./while1
+ cat /tmp/name + read + echo '' + read + echo '' + read + echo '' + read + echo '' + read + echo '' + read |
#cat /tmp/name
administrator admin domainadmin director secretary |
#cat /tmp/name | while read i ; do echo $i___ ; done
|
#cat /tmp/name | while read i ; do echo $lines ; done
|
#cat /tmp/name | while read ; do echo $lines ; done
|
#cat /tmp/name | while read i ; do echo $i ; done
administrator admin domainadmin director secretary |
#vim while1
--- /tmp/l3-saved-58102.25060.10775 2008-07-09 12:36:51.000000000 +0300 +++ while1 2008-07-09 12:39:20.000000000 +0300 @@ -1,13 +1,8 @@ #!/usr/local/bin/bash set -x -cat /tmp/name | while read $lines ; do echo "$lines_output" ; done - -# -# -# -#for i in `jot 100 0` -#do pw user add user$i -s /usr/local/bin/bash \ -#-L russian -m -d /home/user$i ;\ -##chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i -#echo password | pw usermod user$i -h 0 -#done +cat /tmp/names | while read $users +do +pw user add $users -s /usr/local/bin/bash \ +-L russian -m -d /home/user$i ;\ +echo password | pw usermod user$i -h 0 +done |
#./while1
+ cat /tmp/names cat: /tmp/names: + read No such file or directory |
#vim while1
--- /tmp/l3-saved-58102.27020.1809 2008-07-09 12:39:28.000000000 +0300 +++ while1 2008-07-09 12:39:58.000000000 +0300 @@ -1,8 +1,8 @@ #!/usr/local/bin/bash set -x -cat /tmp/names | while read $users +while read $users do pw user add $users -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ echo password | pw usermod user$i -h 0 -done +done < /tmp/names |
#./while1
./while1: line 8: /tmp/names: No such file or directory |
#./while1
./while1: line 8: /tmp/names: No such file or directory |
#vim while1
--- /tmp/l3-saved-58102.12655.10562 2008-07-09 12:40:05.000000000 +0300 +++ while1 2008-07-09 12:40:10.000000000 +0300 @@ -5,4 +5,4 @@ pw user add $users -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ echo password | pw usermod user$i -h 0 -done < /tmp/names +done < /tmp/name |
#./while1
+ read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/user pw: user name or id required + echo password + pw usermod user -h 0 + read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/user pw: user name or id required + echo password + pw usermod user -h 0 ... + pw user add -s /usr/local/bin/bash -L russian -m -d /home/user pw: user name or id required + echo password + pw usermod user -h 0 + read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/user pw: user name or id required + echo password + pw usermod user -h 0 + read |
#vim while1
--- /tmp/l3-saved-58102.13952.10761 2008-07-09 12:40:35.000000000 +0300 +++ while1 2008-07-09 12:41:10.000000000 +0300 @@ -3,6 +3,6 @@ while read $users do pw user add $users -s /usr/local/bin/bash \ --L russian -m -d /home/user$i ;\ -echo password | pw usermod user$i -h 0 +-L russian -m -d /home/$users ;\ +echo password | pw usermod $users -h 0 done < /tmp/name |
#./while1
+ read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + echo password + pw usermod -h 0 pw: user name or id required + read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + echo password ... + echo password + pw usermod -h 0 pw: user name or id required + read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + echo password + pw usermod -h 0 pw: user name or id required + read |
#vim while1
--- /tmp/l3-saved-58102.28453.32694 2008-07-09 12:41:19.000000000 +0300 +++ while1 2008-07-09 12:42:39.000000000 +0300 @@ -1,8 +1,8 @@ #!/usr/local/bin/bash set -x -while read $users +cat /tmp/name | while read $users do pw user add $users -s /usr/local/bin/bash \ -L russian -m -d /home/$users ;\ echo password | pw usermod $users -h 0 -done < /tmp/name +done |
#./while1
+ read + cat /tmp/name + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + echo password + pw usermod -h 0 pw: user name or id required + read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required ... + pw usermod -h 0 + echo password pw: user name or id required + read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + pw usermod -h 0 + echo password pw: user name or id required + read |
#vim while1
--- /tmp/l3-saved-58102.29240.17502 2008-07-09 12:43:22.000000000 +0300 +++ while1 2008-07-09 12:43:55.000000000 +0300 @@ -1,6 +1,6 @@ #!/usr/local/bin/bash set -x -cat /tmp/name | while read $users +while read $users in /tmp/names do pw user add $users -s /usr/local/bin/bash \ -L russian -m -d /home/$users ;\ |
#./while1
+ read in /tmp/names ./while1: line 3: read: `/tmp/names': not a valid identifier |
#vim while1
--- /tmp/l3-saved-58102.2648.11350 2008-07-09 12:44:00.000000000 +0300 +++ while1 2008-07-09 12:44:15.000000000 +0300 @@ -1,6 +1,6 @@ #!/usr/local/bin/bash set -x -while read $users in /tmp/names +while read $users in `cat /tmp/names` do pw user add $users -s /usr/local/bin/bash \ -L russian -m -d /home/$users ;\ |
#./while1
++ cat /tmp/names cat: /tmp/names: No such file or directory + read in ^C |
#vim while1
--- /tmp/l3-saved-58102.15263.5251 2008-07-09 12:44:22.000000000 +0300 +++ while1 2008-07-09 12:44:27.000000000 +0300 @@ -1,6 +1,6 @@ #!/usr/local/bin/bash set -x -while read $users in `cat /tmp/names` +while read $users in `cat /tmp/name` do pw user add $users -s /usr/local/bin/bash \ -L russian -m -d /home/$users ;\ |
#./while1
++ cat /tmp/name + read in administrator admin domainadmin director secretary + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + echo password + pw usermod -h 0 pw: user name or id required ++ cat /tmp/name + read in administrator admin domainadmin director secretary ^C |
#vim while1
--- /tmp/l3-saved-58102.11163.6020 2008-07-09 12:44:52.000000000 +0300 +++ while1 2008-07-09 12:45:31.000000000 +0300 @@ -1,8 +1,7 @@ #!/usr/local/bin/bash set -x -while read $users in `cat /tmp/name` +while read $users do -pw user add $users -s /usr/local/bin/bash \ --L russian -m -d /home/$users ;\ -echo password | pw usermod $users -h 0 -done +pw user add $users -s /usr/local/bin/bash -L russian -m -d /home/$users ; +echo password | pw usermod $users -h 0; +done < /tmp/name |
#./while1
+ read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + echo password + pw usermod -h 0 pw: user name or id required + read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + pw usermod -h 0 ... + pw usermod -h 0 pw: user name or id required + echo password + read + pw user add -s /usr/local/bin/bash -L russian -m -d /home/ pw: user name or id required + echo password + pw usermod -h 0 pw: user name or id required + read |
administrator admin domainadmin director secretary
#!/usr/local/bin/bash set -x for i in `jot 100 0` do pw user add user$i -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i done
#!/usr/local/bin/bash set -x for i in `jot 100 0` do pw user add user$i -s /usr/local/bin/bash \ -L russian -m -d /home/user$i ;\ chpass -p "\$1\$gi4.dgMH\$Ifm9bzNLOTcLwJ8SAGEtV." user$i done
#!/usr/local/bin/bash FILES=" /usr/local/bin/bash /bin/sergey /bin/sh" for i in $FILES do if [ ! -e "$i" ] then echo "File $i not found"; continue fi ls -lh $i | awk '{print$9 " size: " $5}' whatis `basename $i` done
administrator admin domainadmin director secretary
Время первой команды журнала | 12:02:17 2008- 7- 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 12:45:31 2008- 7- 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 13.86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 0.72 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 2.34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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