[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [TEKNIK] WTF: Rettigheder



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Jørgen Heesche wrote:
> Torben Andersen wrote:
>> ...
>>

Steve Bourne har da ikke lvet forgæves, så jf  hans bog  The UNIX Sytem
V Environment, kan det dokumenteres:

#! vi opretter et testmiljø
~/tmp $ mkdir test1
 ~/tmp $ echo abc > test1/fil1
 ~/tmp $ echo abc > test1/fil2
 ~/tmp $ ls -lR
.:
total 4
drwxr-xr-x 2 xonefivd xonefivd 4096 Jun  3 10:05 test1

./test1:
total 8
- -rw-r--r-- 1 xonefivd xonefivd 4 Jun  3 10:05 fil1
- -rw-r--r-- 1 xonefivd xonefivd 4 Jun  3 10:05 fil2


#! Lad os fjerne alle rettigheder fra test directory
 ~/tmp $ chmod 000 test1
 ~/tmp $ ls test1
ls: cannot open directory test1: Permission denied
 ~/tmp $ cd test1
- -bash: cd: test1: Permission denied
 ~/tmp $ rm test1/fil2
rm: cannot remove `test1/fil2': Permission denied

#! dvs INTET kan lade sig gøre nu
#! vi sætter nu LÆSE-retten på
 ~/tmp $ chmod 400 test1
 ~/tmp $ ls test1
ls: cannot access test1/fil2: Permission denied
ls: cannot access test1/fil1: Permission denied
fil1  fil2
 ~/tmp $ cd test1
- -bash: cd: test1: Permission denied
 ~/tmp $ rm test1/fil2
rm: cannot remove `test1/fil2': Permission denied
#! ls fungerer delvist, cd og rm ikke

#! vi sætter nu r og x, læse og execute
 ~/tmp $ chmod 500 test1
 ~/tmp $ ls test1
fil1  fil2
 ~/tmp $ cd test1
 ~/tmp/test1 $ cd ..
 ~/tmp $ rm test1/fil2
rm: remove regular file `test1/fil2'? y
rm: cannot remove `test1/fil2': Permission denied
#! ls og cd fungerer nu, men ikke skrive (rm)

#! alle rettigheder sættes på
 ~/tmp $ chmod 700 test1
 ~/tmp $ ls test1
fil1  fil2
 ~/tmp $ cd test1
 ~/tmp/test1 $ cd ..
 ~/tmp $ rm test1/fil2
rm: remove regular file `test1/fil2'? y
 ~/tmp $

Med andre ord, som Bourne også skriver
ls kræver både r og x, idet den foretager en cd for iterere gennem filerne.
cd kræver execute-ret på directory. det er det x-retten betyder på et
directory
rm kræver skriveret (w) i directoryet.

Keep it simple ;-)

- --
Niels Muller Larsen, MSc

Programmer, Teacher

Mob: +45 2040 5740
Web: http://x15.dk
Mail: sslug@sslug
Public key: 0xD4DB4A5E
(http://keyserver.veridis.com:11371/search?q=0xD4DB4A5E)

When all else fails, try Kate Smith.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKJjNdbiU629TbSl4RAtK6AJ92ffowHTXn5dQ/+ReWqT7hRUl19wCfSDq2
wp5fWqVjduDYJVuz11LT1D0=
=bkoY
-----END PGP SIGNATURE-----


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2009-07-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *