/l3/users/09-03-2011/NT-Ladm/debian4.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 |
|
#ls /etc/file1||touch /etc/file1
ls: невозможно получить доступ к /etc/file1: Нет такого файла или каталога |
#screen -x
|
#screen -x
|
#ls /etc/file1||touch /etc/file1
/etc/file1 |
#ls /dev/hd*
![]() ls: невозможно получить доступ к /dev/hd*: Нет такого файла или каталога |
#ls /dev/
block loop2 ram11 tty1 tty3 tty5 ttyS3 char loop3 ram12 tty10 tty30 tty50 urandom console loop4 ram13 tty11 tty31 tty51 usbmon0 core loop5 ram14 tty12 tty32 tty52 vcs cpu_dma_latency loop6 ram15 tty13 tty33 tty53 vcs1 disk loop7 ram2 tty14 tty34 tty54 vcs2 fd MAKEDEV ram3 tty15 tty35 tty55 vcs3 full mapper ram4 tty16 tty36 tty56 vcs4 hvc0 mem ram5 tty17 tty37 tty57 vcs5 hvc1 net ram6 tty18 tty38 tty58 vcs6 ... hvc4 null ram9 tty20 tty40 tty60 vcsa2 hvc5 nvram random tty21 tty41 tty61 vcsa3 hvc6 oldmem raw tty22 tty42 tty62 vcsa4 hvc7 port root tty23 tty43 tty63 vcsa5 initctl ppp shm tty24 tty44 tty7 vcsa6 input ptmx stderr tty25 tty45 tty8 vga_arbiter kmsg pts stdin tty26 tty46 tty9 xconsole log ram0 stdout tty27 tty47 ttyS0 xen loop0 ram1 tty tty28 tty48 ttyS1 xvda1 loop1 ram10 tty0 tty29 tty49 ttyS2 zero |
#ls /dev/xvd*
/dev/xvda1 |
#dd if=/dev/zero of=file1 bs=1024 count=2048
2048+0 записей считано 2048+0 записей написано скопировано 2097152 байта (2,1 MB), 0,10117 c, 20,7 MB/c |
#dd if=/dev/zero of=file1 bs=1024 count=204800
204800+0 записей считано 204800+0 записей написано скопировано 209715200 байт (210 MB), 25,6905 c, 8,2 MB/c |
#mkfs.ext4 file
![]() file file1 |
#mkfs.ext4 file1
mke2fs 1.41.12 (17-May-2010) file1 is not a block special device. Proceed anyway? (y,n) y Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) Stride=0 blocks, Stripe width=0 blocks 51200 inodes, 204800 blocks 10240 blocks (5.00%) reserved for the super user ... 25 block groups 8192 blocks per group, 8192 fragments per group 2048 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 30 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. |
#mount file1 /mnt
![]() mount: /root/file1 is not a block device (maybe try `-o loop'?) |
#mount -o loop file1 /mnt
|
#mount
/dev/xvda1 on / type ext4 (rw,errors=remount-ro) tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) none on /selinux type selinuxfs (rw,relatime) /dev/loop0 on /mnt type ext4 (rw) |
#umount
![]() Usage: umount -h | -V umount -a [-d] [-f] [-r] [-n] [-v] [-t vfstypes] [-O opts] umount [-d] [-f] [-r] [-n] [-v] special | node... |
#umount /mnt
|
#cd
|
#cat /etc/samba/smb.conf | egrep -v "^#|^;|^$"
[global] workgroup = WORKGROUP server string = %h server dns proxy = no log file = /var/log/samba/log.%m max log size = 1000 syslog = 0 panic action = /usr/share/samba/panic-action %d encrypt passwords = true passdb backend = tdbsam ... printable = yes guest ok = no read only = yes create mask = 0700 [print$] comment = Printer Drivers path = /var/lib/samba/printers browseable = yes read only = yes guest ok = no |
#cat /etc/samba/smb.conf | egrep -v "^#|^;|^$"|less
|
# passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\
[global] workgroup = WORKGROUP server string = %h server dns proxy = no log file = /var/log/samba/log.%m max log size = 1000 syslog = 0 panic action = /usr/share/samba/panic-action %d encrypt passwords = true passdb backend = tdbsam ... passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes [homes] comment = Home Directories browseable = no read only = yes create mask = 0700 directory mask = 0700 valid users = %S |
#cat /etc/samba/smb.conf | egrep -v `^#|^;|^$`|less
|
#cat /etc/samba/smb.conf | egrep '^#..b'|less
|
#cat /etc/samba/smb.conf | egrep '^#..a'|less
|
#man grep
|
#man pgrep
|
#egrep '^#..b' /etc/samba/smb.conf
![]() |
#grep '^#' /etc/samba/smb.conf
# # Sample configuration file for the Samba suite for Debian GNU/Linux. # # # This is the main Samba configuration file. You should read the # smb.conf(5) manual page in order to understand the options listed # here. Samba has a huge number of configurable options most of which # are not shown in this example # # Some options that are often worth tuning have been included as ... # cdrom share is accesed. For this to work /etc/fstab must contain # an entry like this: # # /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0 # # The CD-ROM gets unmounted automatically after the connection to the # # If you don't want to use auto-mounting/unmounting make sure the CD # is mounted on /cdrom # |
#grep -v '^#' /etc/samba/smb.conf
[global] workgroup = WORKGROUP server string = %h server ; wins server = w.x.y.z dns proxy = no ; name resolve order = lmhosts host wins bcast ; interfaces = 127.0.0.0/8 eth0 ; bind interfaces only = yes log file = /var/log/samba/log.%m max log size = 1000 ... guest ok = no ; write list = root, @lpadmin ;[cdrom] ; comment = Samba server's CD-ROM ; read only = yes ; locking = no ; path = /cdrom ; guest ok = yes ; preexec = /bin/mount /cdrom ; postexec = /bin/umount /cdrom |
#man grep
|
#grep -R samba /etc|less
|
#grep -R 'nado nayti' /etc|less
|
#cat /etc/passwd|sed s/root/sid/g
sid:x:0:0:sid:/sid:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh ... www-data:x:33:33:www-data:/var/www:/bin/sh backup:x:34:34:backup:/var/backups:/bin/sh list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh sshd:x:101:65534::/var/run/sshd:/usr/sbin/nologin user:x:1000:1000::/home/user:/bin/bash messagebus:x:102:104::/var/run/dbus:/bin/false |
#cat /etc/passwd|sed s/root/sid/g|sort
backup:x:34:34:backup:/var/backups:/bin/sh bin:x:2:2:bin:/bin:/bin/sh daemon:x:1:1:daemon:/usr/sbin:/bin/sh games:x:5:60:games:/usr/games:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh list:x:38:38:Mailing List Manager:/var/list:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh ... news:x:9:9:news:/var/spool/news:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh proxy:x:13:13:proxy:/bin:/bin/sh sid:x:0:0:sid:/sid:/bin/bash sshd:x:101:65534::/var/run/sshd:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync sys:x:3:3:sys:/dev:/bin/sh user:x:1000:1000::/home/user:/bin/bash uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh www-data:x:33:33:www-data:/var/www:/bin/sh |
#cat /etc/passwd|sed s/root/sid/g|sort > sort_file
|
#vim sort_file
|
#~
1 deb http://ftp.ua.debian.org/debian squeeze main "/etc/apt/sources.list" 1L, 49C |
#~
&& apt-get update install vim && sed -i -e s/sid/squeeze/g /etc/apt/sources.list Получено:1 http://ftp.ua.debian.org sid Release.gpg [835 B] Игн http://ftp.ua.debian.org/debian/ sid/main Translation-en Игн http://ftp.ua.debian.org/debian/ sid/main Translation-ru Получено:2 http://ftp.ua.debian.org sid Release [146 kB] Получено:3 http://ftp.ua.debian.org sid/main i386 Packages [9 169 kB] Получено 9 316 kБ за 26с (354 kБ/c) Чтение списков пакетов... Готово Чтение списков пакетов... Готово Построение дерева зависимостей ... Настраивается пакет vim (2:7.3.035+hg~8fdc12103333-1) ... Настраивается пакет vim-tiny (2:7.3.035+hg~8fdc12103333-1) ... Устанавливается новая версия файла настройки /etc/vim/vimrc.tiny ... Получено:1 http://ftp.ua.debian.org squeeze Release.gpg [1 671 B] Игн http://ftp.ua.debian.org/debian/ squeeze/main Translation-en Игн http://ftp.ua.debian.org/debian/ squeeze/main Translation-ru Получено:2 http://ftp.ua.debian.org squeeze Release [69,3 kB] Получено:3 http://ftp.ua.debian.org squeeze/main i386 Packages [8 631 kB] Получено 8 702 kБ за 17с (508 kБ/c) Чтение списков пакетов... Готово |
#vim
![]() |
#~
![]() #sed -i -e s/squeeze/sid/g && sleep |
#sleep 5
|
#c&& cat /etc/apt/sources.list &&
|
#cat /etc/passwd|tr -c abc xyz
|
#cat /etc/passwd|trd-c a
root:x:0:0:root:/root:/in/sh demon:x:1:1:demon:/usr/sin:/in/sh in:x:2:2:in:/in:/in/sh sys:x:3:3:sys:/dev:/in/sh syn:x:4:65534:syn:/in:/in/syn gmes:x:5:60:gmes:/usr/gmes:/in/sh mn:x:6:12:mn:/vr/he/mn:/in/sh lp:x:7:7:lp:/vr/spool/lpd:/in/sh mil:x:8:8:mil:/vr/mil:/in/sh news:x:9:9:news:/vr/spool/news:/in/sh ... www-dt:x:33:33:www-dt:/vr/www:/in/sh kup:x:34:34:kup:/vr/kups:/in/sh list:x:38:38:Miling List Mnger:/vr/list:/in/sh ir:x:39:39:ird:/vr/run/ird:/in/sh gnts:x:41:41:Gnts Bug-Reporting System (dmin):/vr/li/gnts:/in/sh noody:x:65534:65534:noody:/nonexistent:/in/sh liuuid:x:100:101::/vr/li/liuuid:/in/sh sshd:x:101:65534::/vr/run/sshd:/usr/sin/nologin user:x:1000:1000::/home/user:/in/sh messgeus:x:102:104::/vr/run/dus:/in/flse |
#cat /etc/passwd|tr -d rot
:x:0:0::/:/bin/bash daemn:x:1:1:daemn:/us/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/us/games:/bin/sh man:x:6:12:man:/va/cache/man:/bin/sh lp:x:7:7:lp:/va/spl/lpd:/bin/sh mail:x:8:8:mail:/va/mail:/bin/sh news:x:9:9:news:/va/spl/news:/bin/sh ... www-daa:x:33:33:www-daa:/va/www:/bin/sh backup:x:34:34:backup:/va/backups:/bin/sh lis:x:38:38:Mailing Lis Manage:/va/lis:/bin/sh ic:x:39:39:icd:/va/un/icd:/bin/sh gnas:x:41:41:Gnas Bug-Reping Sysem (admin):/va/lib/gnas:/bin/sh nbdy:x:65534:65534:nbdy:/nnexisen:/bin/sh libuuid:x:100:101::/va/lib/libuuid:/bin/sh sshd:x:101:65534::/va/un/sshd:/us/sbin/nlgin use:x:1000:1000::/hme/use:/bin/bash messagebus:x:102:104::/va/un/dbus:/bin/false |
|