Operating Systems > Linux and UNIX

Quick permissions/chmod/chgrp question

(1/2) > >>

Calum:
hello.
My girlfriend and i each have an account on our computer (linux) and in our home directories we each have a symlink to a folder in the other's home folder. so she has a folder in her home directory called 'From Calum' and i have a symlink to it in my home directory called 'To ****' (yes i'm paranoid, i'm sure she wouldn't mind me putting her name in here but you know how it is in this information age et c). Hope you follow me so far.

Now when i drop a file in there and it whisks itself off to her home folder the group and owner of the file is still me. This isn't so good. in fact when i send a file to her in this manner i want it to change ownership to her and vice versa.

How can this be done? at the moment i need to su to root and run "chmod -R" and "chgrp -R" which is obviously not the best solution.

thanks in advance.

oh yeah and on a related note how do i create a group with both of us in it, i know basic stuff... sorry...

[ January 14, 2003: Message edited by: Calum ]

flap:
to create a group with both of you in, just do `groupadd nameofgroup', then
edit /etc/group and add your usernames (separated by commas) to the
`nameofgroup' entry after the last colon.
You'll then both be able to chgrp a file to nameofgroup (so changing the owner isn't necessary - only root can do that.)

voidmain:
And the best thing to do is to not do it under your home directories. Create a common directory that is not under your home directories that you can both place files in.

For example. Create a group called "lovers" that both you and your better half are members of. Create a directory called /home/lovers then:

# chown root:shared /home/lovers
# chmod 770 /home/lovers
# chmod g+s /home/lovers

(you'll need to log off then back on in order for the system to recognize you are a member of the new group). If you want you can put a link to that directory in each of your home directories. It's best to keep your home directories exclusive to each ID, no matter how much you are head over heals for the other user.

Or if you must, you could just add your user ID to her group and her userID to your group. Your primary group is usually named the same as your logon name. And again, after adding the IDs to the groups you will need to log off and back on.

[ January 14, 2003: Message edited by: void main ]

Calum:

quote:Originally posted by void main:
For example. Create a group called "lovers" that both you and your better half are members of. Create a directory called /home/lovers then:

# chown root:shared /home/lovers
# chmod 770 /home/lovers
# chmod g+s /home/lovers

(you'll need to log off then back on in order for the system to recognize you are a member of the new group). If you want you can put a link to that directory in each of your home directories. It's best to keep your home directories exclusive to each ID, no matter how much you are head over heals for the other user.
--- End quote ---


subtle  ;)

sorry, i forgot how unusual it is to have a girlfriend around here!  :D
thanks for the answers, flap and void main.  

TheQuirk:

quote:Originally posted by Calum:
sorry, i forgot how unusual it is to have a girlfriend around here!   :D
--- End quote ---


Hey, that's bull!

Come on, someone show him that he's wrong! I'd say something, but my hand is a wee bit too unwil...

Oh, wait, did I say that out-loud?

Navigation

[0] Message Index

[#] Next page

Go to full version