LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-08-2006, 04:25 PM   #1
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 214

Rep: Reputation: 30
Problem assigning new user to my group


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. What should I do? TIA

I'm running Ubuntu 5.04
 
Old 08-08-2006, 04:43 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
A user will have their own home directory, but this has nothing to do with what groups they are a member of. If you run "id -a" as that user and you'll see all groups that they are a member.
 
Old 08-12-2006, 05:20 PM   #3
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 214

Original Poster
Rep: Reputation: 30
Apologies for my limited abilities here, but I had tried to figure out how to do as Chris suggests, but was not able, so just thought that I would wait for the next reboot, then sign on as that user. But have had so many things going on this computer that I have not wanted to reboot.

Since I have admin privileges, and was the one who set up this user, is there not a way that I can see the group of this user without having to log in as that user? Even when I know what group they belong to, I still will not know how to move them to my group (which is the original purpose of the thread.) Any guidance on how to accomplish this will be greatly appreciated
 
Old 08-12-2006, 05:48 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,132

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You can run "id -a <username>" as any user to see <username>'s groups. To add them to your group, open up /etc/group in your favorite editor (running as root). Find the line with your group name in it -- it will look something likw:

groupname:x:500:myuser

change it to:

groupname:x:500:myuser,otheruser

where otheruser is the user you want to add to the group. The change will take place rthe next time otheruser logs in.
 
Old 08-13-2006, 11:27 AM   #5
doronunu
Member
 
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69

Rep: Reputation: 15
if you put him in the same group as your main group it will be a security warning couz he will have some privileges on all of your file because all the file you make/download and so on, r getting by default your main group.
so what u need to do is to use one shared group that is not ur main lets call it share.
then u need to change your desktop group to share. and finally u need to change the privileges to SGID. what will append is that all the file youll write in this directory will get the share group as group and not your main group so he will only have privileges to this files and for your others files hell get the privileges for "others".

this is how u should do it :

first make the group
Quote:
groupadd share
then add the user in the /etc/group as the post before show u.
then change ur directory group :
Quote:
chgrp share ~odyssey/Desktop
now put the SGID privillage :
Quote:
chmod g+s ~odyssey/Desktop

Last edited by doronunu; 08-13-2006 at 11:54 AM.
 
Old 08-13-2006, 11:40 AM   #6
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 214

Original Poster
Rep: Reputation: 30
Great. When I get to the office, will try these and post back the results. Many thanks.
 
Old 08-13-2006, 04:58 PM   #7
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 214

Original Poster
Rep: Reputation: 30
first tried id -a officeuse (where officeuse is the real user2)
and got:

uid=1001(officeuse) gid=1000(odyssey) groups=1000(odyssey),21(fax),24(cdrom),29(audio),30(dip),44(video),46
(plugdev),107(lpadmin),108(scanner)

So I read this that I am group id 1000 and officeuse is group id 1001 (and therefore not a part of my group), so

next is vi /etc/group


where it appears to me that the target line is

odyssey:x:1000:

above and it should be modified to read:

odyssey:x:1000fficeuse

Do I have this right?

also very important. I did not know how to use vi and have futzed around and made many changes which I did not mean to make and now need to exit without saving any changes and then start over. I type in :q! but I get an error code and it doesn't quit. How do I accomplish this please?
TIA
 
Old 08-13-2006, 05:22 PM   #8
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 214

Original Poster
Rep: Reputation: 30
Have managed to undo the changes that I had made and have compared to the original text of the file which I had copied and pasted into a text editor immediately upon opening it.

Am now trying to close the file using :x but am being requested to enter an encryption key, when all I want to do is close the file. Help!
 
Old 08-13-2006, 05:29 PM   #9
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 214

Original Poster
Rep: Reputation: 30
If I just click on the " X " at the top right hand corner and close the editor, will it close without saving any changes or will it record the changes. How do I get out of this?
 
Old 08-14-2006, 05:57 AM   #10
doronunu
Member
 
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69

Rep: Reputation: 15
press esc 2 times.
then :wq.
this write the changes and quit.

:q!
out from vi without saving

by the way as is aid before do anew group. dont put him on yours or it will be a security risk.
 
Old 08-14-2006, 12:15 PM   #11
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 214

Original Poster
Rep: Reputation: 30
doronunu, thanks for this and will try to rescue myself as soon as I can get to that computer.

My plan is to figure out how to get the group thing right, then explore your suggestions. This is the "general" computer in our office and I do not have any files or docs that our General Manager cannot have access to. I have my own computer in my office (and this is the one that ideally I should have installed Ubuntu to, but the other one had crashed and needed reinstalling. I just thought, "What the hell?" and plunged right in.)

Slowly, slowly, linux is penetrating my thick skull, thanks to the invaluable help of all of those like you who hold our hand through this process. You are all much appreciated.
 
Old 08-14-2006, 12:46 PM   #12
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 214

Original Poster
Rep: Reputation: 30
tried the

press esc 2 times, then :wq.

First it gave me a "read-only error, add " ! " to override"

so I added the ! and got the error message:

" /etc/group " E212 Can't open file for writing"

Have I done something wrong?
 
Old 08-14-2006, 01:55 PM   #13
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 214

Original Poster
Rep: Reputation: 30
Decided to try to sign in as root and rerun the vi and it worked. I think! At least it saved the file with the change.

Now I want to log in as user2 and see if I can see the files. If I just change user to user2, havalook, and return to myself (i.e., Odyssey), will all my program states and open folders: email client, browsers, etc still be as they were when I changed to user2?
 
Old 08-14-2006, 04:00 PM   #14
doronunu
Member
 
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69

Rep: Reputation: 15
yes every thing will be in is rihgt place.

what vi ment is that u have only read premissins on the file.
you need to change him as root.

and for the error he ment that u dont have write premissions for the file so u cant do :wq (write&quit).
so u need to press :q! (quit without saving).
 
Old 08-17-2006, 02:17 PM   #15
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 214

Original Poster
Rep: Reputation: 30
It took me a little time to feel like I understood the previous post. However if I do, it makes me wonder. Since I created the files (albeit on a Windows computer) and after transferring it to Ubuntu, had modified the permissions (which already included me as read, write, and execute) to include my group for read, write, and execute, why did the shell think I was not authorized?
 
  


Reply

Tags
group, permission, permissions, user


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to list user in Linux box, add an user to a group! steady_lfcfan Linux - Newbie 12 01-27-2013 01:14 PM
problem with a user group and apache javier_ccs Linux - Software 7 07-28-2011 03:53 AM
Assigning a hub to a user with udev arclyte Linux - Hardware 0 03-20-2006 05:44 PM
User and Group Admin: How to tell Who is in What group? Akhran Linux - Newbie 1 11-12-2005 11:16 PM
Problem with user group naza Linux - Security 1 02-05-2004 06:11 PM


All times are GMT -5. The time now is 09:47 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration