Author Topic: Quick permissions/chmod/chgrp question  (Read 750 times)

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Quick permissions/chmod/chgrp question
« on: 14 January 2003, 21:38 »
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 ]

visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
Quick permissions/chmod/chgrp question
« Reply #1 on: 14 January 2003, 22:20 »
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.)
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Quick permissions/chmod/chgrp question
« Reply #2 on: 14 January 2003, 22:36 »
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 ]

Someone please remove this account. Thanks...

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Quick permissions/chmod/chgrp question
« Reply #3 on: 15 January 2003, 02:30 »
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.



subtle  ;)

sorry, i forgot how unusual it is to have a girlfriend around here!  :D
thanks for the answers, flap and void main.  
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

TheQuirk

  • VIP
  • Member
  • ***
  • Posts: 2,154
  • Kudos: 315
Quick permissions/chmod/chgrp question
« Reply #4 on: 16 January 2003, 03:28 »
quote:
Originally posted by Calum:
sorry, i forgot how unusual it is to have a girlfriend around here!   :D


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?

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Quick permissions/chmod/chgrp question
« Reply #5 on: 16 January 2003, 03:36 »
Well most of us are married and we don't want our wives getting into our stuff. Primary reason for having Linux and this higher level of security.  
Someone please remove this account. Thanks...

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Quick permissions/chmod/chgrp question
« Reply #6 on: 16 January 2003, 13:50 »
hmm, i have heard a lot about how all that stuff changes when you get married. well, my girlfriend and i have been together 3 years now (so i am not too qualified to comment on what a really long term relationship might bring regarding trust et c) and i don't think either of us are all that interested in poking through each other's files to be honest. we both use the computer for work stuff and studying and so on, and it's more of a chore to have to go through the other person's stuff reading it for errors and grammar and so on and all that crap.

Nevertheless i do need to learn about all that privacy stuff in case i ever need to administrate a computer other than our home PC!  
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism