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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
08-08-2006, 04:25 PM
|
#1
|
|
Member
Registered: Jul 2006
Posts: 214
Rep:
|
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
|
|
|
|
08-08-2006, 04:43 PM
|
#2
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,676
|
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.
|
|
|
|
08-12-2006, 05:20 PM
|
#3
|
|
Member
Registered: Jul 2006
Posts: 214
Original Poster
Rep:
|
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
|
|
|
|
08-12-2006, 05:48 PM
|
#4
|
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 3,816
Rep: 
|
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.
|
|
|
|
08-13-2006, 11:27 AM
|
#5
|
|
Member
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69
Rep:
|
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
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.
|
|
|
|
08-13-2006, 11:40 AM
|
#6
|
|
Member
Registered: Jul 2006
Posts: 214
Original Poster
Rep:
|
Great. When I get to the office, will try these and post back the results. Many thanks.
|
|
|
|
08-13-2006, 04:58 PM
|
#7
|
|
Member
Registered: Jul 2006
Posts: 214
Original Poster
Rep:
|
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:1000  fficeuse
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
|
|
|
|
08-13-2006, 05:22 PM
|
#8
|
|
Member
Registered: Jul 2006
Posts: 214
Original Poster
Rep:
|
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!
|
|
|
|
08-13-2006, 05:29 PM
|
#9
|
|
Member
Registered: Jul 2006
Posts: 214
Original Poster
Rep:
|
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?
|
|
|
|
08-14-2006, 05:57 AM
|
#10
|
|
Member
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69
Rep:
|
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.
|
|
|
|
08-14-2006, 12:15 PM
|
#11
|
|
Member
Registered: Jul 2006
Posts: 214
Original Poster
Rep:
|
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.
|
|
|
|
08-14-2006, 12:46 PM
|
#12
|
|
Member
Registered: Jul 2006
Posts: 214
Original Poster
Rep:
|
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?
|
|
|
|
08-14-2006, 01:55 PM
|
#13
|
|
Member
Registered: Jul 2006
Posts: 214
Original Poster
Rep:
|
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?
|
|
|
|
08-14-2006, 04:00 PM
|
#14
|
|
Member
Registered: Dec 2005
Location: Israel
Distribution: used : Ubuntu, Debian, Arch. current : Centos.
Posts: 69
Rep:
|
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).
|
|
|
|
08-17-2006, 02:17 PM
|
#15
|
|
Member
Registered: Jul 2006
Posts: 214
Original Poster
Rep:
|
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?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:59 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|