[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

verbose^2 example



# we have two users, marla and tyler:
/etc/passwd
marla:x:1006:1006:Marla Singer,,,:/home/marla:/bin/bash
tyler:x:1007:1007:Tyler Durden,,,:/home/tyler:/bin/bash

# they're default group is coresponding to their username, furthermore they
# are both member of the group slide
/etc/group
slide:x:183:marla,tyler
marla:x:1006:
tyler:x:1007:

# and here we go...

root@server:/ # mkdir folder
root@server:/ # ls -lah | grep folder
drwxr-xr-x    2 root root 4.0K Jul 22 12:41 folder
root@server:/ # chgrp slide folder
root@server:/ # chmod -R 0774 folder
root@server:/ # cd folder
root@server:/folder # touch still.default.umask.022
root@server:/folder # ls -lah
total 8.0K
drwxrwxr--   2 root slide 4.0K Jul 22 12:45 .
drwxr-xr-x  25 root root  4.0K Jul 22 12:41 ..
-rw-r--r--   1 root root     0 Jul 22 12:45 still.default.umask.022
root@server:/folder # umask 002
root@server:/folder # touch now.umask.002
root@server:/folder # ls -lah
total 8.0K
drwxrwxr--   2 root slide 4.0K Jul 22 12:46 .
drwxr-xr-x  25 root root  4.0K Jul 22 12:41 ..
-rw-rw-r--   1 root root     0 Jul 22 12:46 now.umask.002
-rw-r--r--   1 root root     0 Jul 22 12:45 still.default.umask.022
root@server:/folder # su marla
marla@server:/folder$ id
uid=1006(marla) gid=1006(marla) groups=183(slide),1006(marla)
marla@server:/folder$ mkdir ballcancer
marla@server:/folder$ ls -lah
total 12K
drwxrwxr--   3 root  slide 4.0K Jul 22 12:47 .
drwxr-xr-x  25 root  root  4.0K Jul 22 12:41 ..
drwxrwxr-x   2 marla marla 4.0K Jul 22 12:47 ballcancer
-rw-rw-r--   1 root  root     0 Jul 22 12:46 now.umask.002
-rw-r--r--   1 root  root     0 Jul 22 12:45 still.default.umask.022

# bingo!
# root@server:/ # chmod -R 6774 folder
# would have set the folder sticky
# then the just created directory ballcancer would look like this:
# drwsrwsr-x   2 marla marla 4.0K Jul 22 12:47 ballcancer
# so
# drwxrwxr-x   2 marla marla 4.0K Jul 22 12:47 ballcancer
# is just the premission/group setting you're looking for...

marla@server:/folder$ echo "you're a monster" >> ballcancer/textfile
marla@server:/folder$ exit
exit
root@server:/folder # su tyler
tyler@server:/folder$ id
uid=1007(tyler) gid=1007(tyler) groups=183(slide),1007(tyler)
tyler@server:/folder$ cd ballcancer/
tyler@server:/folder/ballcancer$ cat textfile
you're a monster
tyler@server:/folder/ballcancer$ echo "ymmaavstiml" >> cognition
bash: cognition: Permission denied

# (I gues) this is it...

# Hope I've conjured a smile on your face ;)

# Marco Weber

# PS: I'm canceling debian-user-ml membership for mw@linuxdesktop.ch
# and resignon with 2501@kabelsalat.ch - cu around...



Reply to: