| /l3/users/07-09-2009/nt-ladm/debian1.net.nt/user :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 |
|
|
#[user@fbsd5:~]$ vim /etc/group
user590:*:1092: user591:*:1093: user592:*:1094: user593:*:1095: user594:*:1096: user595:*:1097: user596:*:1098: user597:*:1099: user598:*:1100: user599:*:1101: user600:*:1102: |
|
#[user@fbsd5:~]$
|
|
#[user@fbsd5:~]$
|
|
#[user@fbsd5:~]$
|
|
#[user@fbsd5:~]$
|
|
#[user@fbsd5:~]$ exit
exit Connection to 192.168.16.25 closed. |
|
$ls -ld /tmp
drwxrwxrwt 9 root root 2360 2009-09-10 12:13 /tmp |
|
$ls -l /etc/shadow
-rw-r----- 1 root shadow 13572 2009-09-10 12:12 /etc/shadow |
|
$vim /etc/shadow
|
|
$ls -l /etc/shadow
-rw-r----- 1 root shadow 13572 2009-09-10 12:12 /etc/shadow |
|
$ls -l /etc/shadow
-rw-r----- 1 root shadow 13572 2009-09-10 12:12 /etc/shadow |
|
$sudo
[user@debian1:scripts]$ vim /etc/shadow Password: |
|
$ls -l /etc/shadow
-rw-r----- 1 root shadow 13572 2009-09-10 12:12 /etc/shadow |
|
$cp /etc/shadow /tmp
cp: невозможно открыть `/etc/shadow' для чтения: Permission denied |
|
$sudo
|
|
$sudo chmod 0000 /tmp/shadow
|
|
$sudo ls -l /tmp/shadow
---------- 1 root root 13572 2009-09-10 12:55 /tmp/shadow |
|
$sudo vim /tmp/shadow
|
|
$ls /root/
[user@debian1:scripts]$ sudo vim /tmp/shadow 1234 |
|
$sudo
1234 |
|
$ls -l
итого 40 -rwxr-xr-x 1 user user 327 2009-09-09 16:12 case1 -rwxr-xr-x 1 user user 277 2009-09-09 16:21 case2 -rwxr-xr-x 1 user user 85 2009-09-09 15:16 for1 -rwxr-xr-x 1 user user 129 2009-09-09 15:20 for2 -rwxr-xr-x 1 root root 172 2009-09-09 15:30 for3 -rwxr-xr-x 1 user user 254 2009-09-09 15:38 for4 -rwxr-xr-x 1 user user 145 2009-09-09 15:57 select1 -rwxr-xr-x 1 user user 188 2009-09-10 10:58 ssh-port-forwarding -rwxr-xr-x 1 user user 64 2009-09-09 16:02 while1 -rwxr-xr-x 1 user user 176 2009-09-09 16:07 while2 |
|
$touch testfile
|
|
$ls -l testfile
-rw-r--r-- 1 user user 0 2009-09-10 14:06 testfile |
|
$w3m http://xgu.ru/wiki/Chmod
Chmod
ÐаÑеÑиал из Xgu.ru
ÐеÑейÑи к: навигаÑиÑ, поиÑк
ÑообÑениеÑ[1]Ñи оÑвеÑÑÑе наÐнегов ÑпиÑокÐÑаÑÑÑлки xen-devel пиÑÑмом вида "I'm
using (no using) Kemari and I want it to be integrated (but I would if it was
integrated)".ÑХоÑоÑаÑeвеÑÑ.=ÐоддеÑжим.--½-rwx 01) |Ðbc; }
# ls -l /etc/passwd | awk '{print $1}' | rwx2dig
ÐÑа ÑÑаÑÑÑ Ð½Ð°Ñ
одиÑÑÑ Ð² пÑоÑеÑÑе напиÑаниÑ.
ЧÑÐ¾Ð±Ñ Ð¿ÐµÑедаÑÑ Ð¿Ñава в ÑоÑмаÑе\ls -l (rwxrwxrwx) в каÑеÑÑве аÑгÑменÑа chmod иÑ
ÐÑлиpвÑ"ÑÑиÑаеÑе, ÑÑо ÐµÑ ÑÑоило Ð±Ñ Ð´Ð¾ÑабоÑаÑÑ ÐºÐ°Ðº можно бÑÑÑÑее, пожалÑйÑÑа,
можно пÑеобÑазоваÑÑ Ð¿Ñи помоÑи пÑоÑÑой ÑÑнкÑии:
ÑкажиÑе об ÑÑом. | bc; }
rwx2dig() { ( echoÐibase=2;ÐechoÐobase=8;sedÑs/^.//»|trÐ--²-rwxÑ01Ð)ак аÑгÑÐ¼ÐµÐ½Ñ Ð´Ð»Ñ chmod:
echo|"trm-- -rwxsStTo01b)|bc`; \"$var2\"e1>> /tmp/log.perm 2>>/tmp/log.err.
⪠â â Viewing <Chmod â Xgu.ru>
|
|
$rwx2dig() { ( echo ibase=2; echo obase=8; sed s/^.// |
|
|
$rwx2dig() { ( echo ibase=2; echo obase=8; sed s/^.// |
|
|
$#
|
|
$ls -l
итого 40 -rwxr-xr-x 1 user user 327 2009-09-09 16:12 case1 -rwxr-xr-x 1 user user 277 2009-09-09 16:21 case2 -rwxr-xr-x 1 user user 85 2009-09-09 15:16 for1 -rwxr-xr-x 1 user user 129 2009-09-09 15:20 for2 -rwxr-xr-x 1 root root 172 2009-09-09 15:30 for3 -rwxr-xr-x 1 user user 254 2009-09-09 15:38 for4 -rwxr-xr-x 1 user user 145 2009-09-09 15:57 select1 -rwxr-xr-x 1 user user 188 2009-09-10 10:58 ssh-port-forwarding -rw-r--r-- 1 user user 0 2009-09-10 14:06 testfile -rwxr-xr-x 1 user user 64 2009-09-09 16:02 while1 -rwxr-xr-x 1 user user 176 2009-09-09 16:07 while2 |
|
$ls -l
|
|
$ls -l
|
|
$#rwx2dig() { ( echo ibase=2; echo obase=8; sed s/^.// |
|
|
$ls -l testfile | rwx2dig
[user@debian1:scripts]$ rwx2dig testfile (standard_in) 3: parse error (standard_in) 3: illegal character: : |
|
$ls -l
итого 40 -rwxr-xr-x 1 user user 327 2009-09-09 16:12 case1 -rwxr-xr-x 1 user user 277 2009-09-09 16:21 case2 -rwxr-xr-x 1 user user 85 2009-09-09 15:16 for1 -rwxr-xr-x 1 user user 129 2009-09-09 15:20 for2 -rwxr-xr-x 1 root root 172 2009-09-09 15:30 for3 -rwxr-xr-x 1 user user 254 2009-09-09 15:38 for4 -rwxr-xr-x 1 user user 145 2009-09-09 15:57 select1 -rwxr-xr-x 1 user user 188 2009-09-10 10:58 ssh-port-forwarding -rw-r--r-- 1 user user 0 2009-09-10 14:06 testfile -rwxr-xr-x 1 user user 64 2009-09-09 16:02 while1 -rwxr-xr-x 1 user user 176 2009-09-09 16:07 while2 |
|
$ls -l | cut -d 1
cut: вы должны задать список байт, символов или полей Попробуйте `cut --help' для получения более подробного описания. |
|
$ls -l | awk '{print$1}'
итого -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rw-r--r-- -rwxr-xr-x -rwxr-xr-x |
|
$ls -l | awk '{print$1 $8
> |
|
$ls -l | awk '{print$1 $8}'
итого -rwxr-xr-xcase1 -rwxr-xr-xcase2 -rwxr-xr-xfor1 -rwxr-xr-xfor2 -rwxr-xr-xfor3 -rwxr-xr-xfor4 -rwxr-xr-xselect1 -rwxr-xr-xssh-port-forwarding -rw-r--r--testfile -rwxr-xr-xwhile1 -rwxr-xr-xwhile2 |
|
$ls -l | awk '{print$1" "
итого -rwxr-xr-x case1 -rwxr-xr-x case2 -rwxr-xr-x for1 -rwxr-xr-x for2 -rwxr-xr-x for3 -rwxr-xr-x for4 -rwxr-xr-x select1 -rwxr-xr-x ssh-port-forwarding -rw-r--r-- testfile -rwxr-xr-x while1 -rwxr-xr-x while2 |
|
$ls -l | awk '{print$1" " $8}' | rwx2dig
(standard_in) 3: illegal character: \321 (standard_in) 3: illegal character: \202 (standard_in) 3: illegal character: \320 (standard_in) 3: illegal character: \276 (standard_in) 3: illegal character: \320 (standard_in) 3: illegal character: \263 (standard_in) 3: illegal character: \320 (standard_in) 3: illegal character: \276 (standard_in) 4: parse error (standard_in) 5: parse error (standard_in) 6: parse error (standard_in) 7: parse error (standard_in) 8: parse error (standard_in) 9: parse error (standard_in) 10: parse error (standard_in) 11: parse error (standard_in) 12: parse error (standard_in) 13: parse error (standard_in) 14: parse error |
|
$ls -l | awk '{print$1
(standard_in) 3: illegal character: \321 (standard_in) 3: illegal character: \202 (standard_in) 3: illegal character: \320 (standard_in) 3: illegal character: \276 (standard_in) 3: illegal character: \320 (standard_in) 3: illegal character: \263 (standard_in) 3: illegal character: \320 (standard_in) 3: illegal character: \276 755 755 755 755 755 755 755 755 644 755 755 |
|
$ls -l | awk '{print$1}' | rwx2dig
(standard_in) 3: illegal character: \321 (standard_in) 3: illegal character: \202 (standard_in) 3: illegal character: \320 (standard_in) 3: illegal character: \276 (standard_in) 3: illegal character: \320 (standard_in) 3: illegal character: \263 (standard_in) 3: illegal character: \320 (standard_in) 3: illegal character: \276 755 755 755 755 755 755 755 755 644 755 755 |
|
$ls -l | awk '{print$1}'
итого -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rwxr-xr-x -rw-r--r-- -rwxr-xr-x -rwxr-xr-x |
|
$ls -l
|
|
$w3m http://xgu.ru/wiki/Chmod
|
|
$ls -l testfile
-rw-r--r-- 1 user user 0 2009-09-10 14:06 testfile |
|
$ls -l testfile | awk '{print$1}'
-rw-r--r-- |
|
$ls -l testfile | awk '{print$1}' | rwx2dig
644 |
|
$ls -l ../
итого 5223 -rw-r--r-- 1 user user 0 2009-09-10 10:52 1234 -rw-r--r-- 1 user user 0 2009-09-09 13:07 5 6 -rw-r--r-- 1 user user 2803 2009-09-07 14:26 adduser.conf -rw-r--r-- 1 user user 44 2009-09-07 14:26 adjtime -rw-r--r-- 1 user user 1071 2009-09-07 14:26 bash.bashrc -rw-r--r-- 1 user user 215907 2009-09-07 14:26 bash_completion -rw-r--r-- 1 user user 525 2009-09-07 14:26 console-cyrillic -rw-r--r-- 1 user user 31 2009-09-08 12:59 copied_stream -rw-r--r-- 1 user user 724 2009-09-07 14:26 crontab ... -rw-r--r-- 1 user user 777 2009-09-07 14:26 sysctl.conf -rw-r--r-- 1 user user 1664 2009-09-07 14:26 syslog.conf drwxr-xr-x 7 user user 408 2009-09-07 14:38 test -rw-r--r-- 1 user user 12 2009-09-07 14:26 timezone -rw-r--r-- 1 user user 1260 2009-09-07 14:26 ucf.conf -rw-r--r-- 1 user user 805 2009-09-07 14:26 updatedb.conf -rw-r--r-- 1 user user 1076 2009-09-10 12:10 usermod-help -rw-r--r-- 1 user user 18545 2009-09-07 16:43 vim-file -rw-r--r-- 1 user user 4622 2009-09-07 14:26 vnc.conf -rw-r--r-- 1 user user 4221 2009-09-07 14:26 wgetrc |
|
$ls -ld
drwxrwxrwt 9 root root 2384 2009-09-10 14:06 ../ |
|
$umask
0022 |
|
$ls -l testfile | awk '{print$1}' | rwx2dig
644 |
|
$cd
|
|
$touch testfile
|
|
$umask
[user@debian1:~]$ ls -l testfile | awk '{print$1}' | rwx2dig
644
0022
|
|
$ls -l testfile
-rw-r--r-- 1 user user 0 2009-09-10 14:16 testfile |
|
$mkdir testdit
|
|
$ls -l testfile
^?-rw-r--r-- 1 user user 0 2009-09-10 14:16 testfile |
|
$ls -l test
testdit/ testfile |
|
$ls -ld
drwxr-xr-x 2 user user 48 2009-09-10 14:17 testdit/ |
|
$ssh 192.168.16.25
[user@debian1:~]$
Password:
Last login: Thu Sep 10 12:14:14 2009 from 192.168.16.1
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
...
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.
l3-agent is already running: pid=20393; pidfile=/home/user/.lilalo/l3-agent.pid
|
|
#[user@fbsd5:~]$
|
|
#[user@fbsd5:~]$
|
|
#[user@fbsd5:~]$
|
|
#[user@fbsd5:~]$ sudo pw useradd help | less
|
|
#[user@fbsd5:~]$ sudo pw useradd help &>/tmp/pw
|
|
#[user@fbsd5:~]$
usage: pw useradd [name] [switches]
-V etcdir alternate /etc location
-C config configuration file
-q quiet operation
Adding users:
-n name login name
-u uid user id
-c comment user name/comment
-d directory home directory
-e date account expiry date
...
-g group default group
-G grp1,grp2 additional groups
-L class default user class
-k dir default home skeleton
-M mode home directory permissions
-u min,max set min,max uids
-i min,max set min,max gids
-w method set default password method
-s shell default shell
-y path set NIS passwd file path
|
|
#[user@fbsd5:~]$
|
|
#[user@fbsd5:~]$
|
|
$cd /tmp
|
|
$ls -ld 123
drwxr-xr-x 2 user user 72 2009-09-07 15:54 123 |
|
$chown root 123
chown: изменение владельца `123': Operation not permitted |
|
$cd /tmp
|
|
$mkdir 345
|
|
$chown root 345
chown: изменение владельца `345': Operation not permitted |
|
$whereis chown
chown: /bin/chown /usr/share/man/man1/chown.1.gz |
|
$man 2 chown
|
|
$ls -l /bin/chown
[user@debian1:tmp]$ man -a chown
Переформатирование chown(1), подождите...
Change the owner of /u and subfiles to "root".
AUTHOR
Written by David MacKenzie and Jim Meyering.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.E...
chown [OPTION]... --reference=RFILE FILE...
COPYRIGHT
Copyright © 2006 Free Software Foundation, Inc.
...
--help display this help and exit
--version
output version information and exit
Owner is unchanged if missing. Group is unchanged if missing, but changed to login group if implied by a ‘:’ following a symbolic OWNER. OWNER and GROUP may be numeric as well as symbolic.
EXAMPLES
chown root /u
Change the owner of /u to "root".
chown root:staff /u
Likewise, but also change its group to "staff".
chown -hR root /u
|
|
$sudo chmod 4755 /bin/chown
Password: |
|
$ls -l /bin/chown
-rwsr-xr-x 1 root root 35356 2007-01-30 20:51 /bin/chown |
|
$ls
1234 bash_completion debian_version host.conf inittab ld.so.hwcappkgs magic modules networks protocols ru.utf-8.sug shells test vnc.conf 345 console-cyrillic deluser.conf hostname inputrc locale.gen mailcap motd nsswitch.conf rc.local screenrc squid.conf timezone wgetrc 5 6 copied_stream etc hosts issue localtime mailcap.order motd.tail pam.conf resolv.conf scripts ssh-iiKsE20268 ucf.conf adduser.conf crontab file hosts.allow issue.net login.defs manpath.config mtab passwd rmt securetty sudoers updatedb.conf adjtime day2 fstab hosts.deny ld.so.cache logrotate.conf mime.types nanorc passwd- rpc services sysctl.conf usermod-help bash.bashrc debconf.conf group inetd.conf ld.so.conf lynx.cfg mke2fs.conf Net profile ru.utf-8.spl shadow syslog.conf vim-file |
|
$chown root 345
|
|
$ls
1234 hosts mime.types ru.utf-8.sug 345 hosts.allow mke2fs.conf screenrc 5 6 hosts.deny modules scripts adduser.conf inetd.conf motd securetty adjtime inittab motd.tail services bash.bashrc inputrc mtab shadow bash_completion issue nanorc shells console-cyrillic issue.net Net squid.conf copied_stream ld.so.cache networks ssh-iiKsE20268 crontab ld.so.conf nsswitch.conf sudoers day2 ld.so.hwcappkgs pam.conf sysctl.conf debconf.conf locale.gen passwd syslog.conf debian_version localtime passwd- test deluser.conf login.defs profile timezone etc logrotate.conf protocols ucf.conf file lynx.cfg rc.local updatedb.conf fstab magic resolv.conf usermod-help group mailcap rmt vim-file host.conf mailcap.order rpc vnc.conf hostname manpath.config ru.utf-8.spl wgetrc |
|
$mkdir permissions
|