Jump to content
Sign in to follow this  
Odyssey

Problem including new user in my group

Recommended Posts

I'm running Ubuntu 5.04 and I'm probably missing something obvious. I have added a user (call it user 2) and want this user to be part of my group so we can share common interest work files. I have:

 

home/odyssey

and

home/user2

 

so it appears to me that user2 is not in my group. No?

 

When user2 signs in, they cannot see the folder on my desktop that we both need to be able to access and I want it to show on the desktop of user2. Try as I might I cannot "re-assign" user2 to my group.

 

Ubuntu is the only distro I have tried to do anything with, so groups maybe are not something that is common to all distros?

 

 

What should I do? TIA

Share this post


Link to post
Share on other sites

What you need to do is ensure that both users are in the same group that you will share under, then you need to have the directory available for write permissions.

 

Here is a simple example:

 

# ls -d ~user1
drwxr-x--- 6 user1 users 8192 Aug 14 21:00 /home/user1
# ls -ld ~user2
drwxr-xr-x 6 user2 users 4096 Aug 14 21:00 /home/user2

 

This shows us both user1 and user2 are in the default group "users".

 

# mkdir /home/user-share
# chown root:users /home/user-share
# chmod 770 /home/user-share

 

Now the directory has been made both users can access and write files into that directory. They of course need to make sure that the files they make have the permissions to allow other users to then edit them.

 

Here is an example showing how to make a group for the users:

 

# groupadd users
# gpasswd -a user1 users
# gpasswd -a user2 users

 

This makes a new group called "users" and adds both user1 and user2 to the group. Again you can make the new share directory and continue from there.

 

A user should always make sure that they make files with valid permissions for other users .. for instance:

# cd /home/usershare
# touch file
# ls -l file
-rw------- 1 user1 user1 0 Aug 14 21:30 file

 

You can see the default file made by this user doesn't give the permissions needed. Therefore:

 

# chgrp users file
# chmod 660 file

 

That would give the permissions needed. Unfortunately its a tough job managing permissions but hopefully you will grow to get used to it.

 

Thanks and good luck! :D

Share this post


Link to post
Share on other sites

Wow, what a great reply! I think I understand some of it and by the time I work my way through it, doubtless will understand it better.

 

Currently I am the sysadm (aren't we in trouble?) and user 2 is one of my employees. By way of clearing the fog, does this leave each of us with our own "private" areas or rather will be both be in the same pot for all files?

Share this post


Link to post
Share on other sites
.. does this leave each of us with our own "private" areas or rather will be both be in the same pot for all files?

 

Indeed, the shared space will be /home/user-share and whilst that is open to the group that you make, the home space /home/user? is still personal and does not require to be opened up to let this work.

 

:lol: thanks!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...