Gentoo Archives: gentoo-amd64

From: Gavin Seddon <gavin.m.seddon@×××××××××××××.uk>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] vmware
Date: Tue, 06 Dec 2005 10:02:17
Message-Id: 1133863133.9858.3.camel@linuxstation
In Reply to: Re: [gentoo-amd64] vmware by Brett Johnson
1 Hi,
2 Thanks. I usually edit '/etc/group' but the extra info is v. useful.
3 Gavin.
4
5
6 On Mon, 2005-12-05 at 08:20 -0600, Brett Johnson wrote:
7 > There are a couple ways of modifying groups;
8 >
9 > First you can use "vigr", this will load /etc/groups in your default
10 > editor and allow you to change the file. Upon exiting, it will check
11 > your changes for proper formatting and let you know if the file is
12 > not formatted properly. This is the method I use.
13 >
14 > To add yourself to vmware group, find the line:
15 > vmware:x:449:
16 > and add the login name of the users after the last colon, using a
17 > comma to separate multiple names:
18 > vmware:x:449:user1,user2
19 >
20 > A second method is "usermod". This requires a bit more work, since you
21 > have to specify all the groups you want access to with the -G option. If
22 > you omit a group that you were previously a member of, you will be removed
23 > from that group. So you would type something like:
24 > usermod -G wheel,audio,video,
25 >
26 > A simple wrapper shell script like this could be used to add additional
27 > groups without having to retype all groups:
28 >
29 > #!/bin/bash
30 > #
31 > # Script to add a user to a group using the usermod tool.
32 > #
33 > # TODO: Verify awk and usermod exist and can execute.
34 > ME="`/usr/bin/basename ${0}`"
35 > AWK="/bin/awk"
36 > USERMOD="/usr/sbin/usermod"
37 >
38 > # Check to make sure we have 2 arguments.
39 > if [ $# -ne 2 ]; then
40 > echo "Usage: ${ME} group[,group ...] user"
41 > exit -99
42 > fi
43 >
44 > # TODO: Additional checking of args, make sure user and groups exist, but
45 > # for now the usermod tool will throw an error if they do not exist.
46 >
47 > # Get list of groups user belongs to.
48 > GRPS=`${AWK} -F: '/(:|,)'${2}'(,|$)/{grps=$1 "," grps} END{print grps}'
49 > /etc/group`
50 >
51 > # TODO: Check to see if user is already in group(s) specified.
52 >
53 > # Call usermod tool.
54 > ${USERMOD} -G ${GRPS}${1} ${2}
55 >
56 > Brett
57 >
58 >
59 > theboywho wrote:
60 >
61 > >On Monday 05 December 2005 11:10, Gavin Seddon wrote:
62 > >
63 > >
64 > >>Hithanks for all the responses.
65 > >>If I chgrp to vmware will I be able to use su?
66 > >>
67 > >>
68 > >
69 > >I think to be able to 'su' you need to be in the wheel group as well. I added
70 > >myself to the vmware group by editing the /etc/group file and adding my user
71 > >name to the line for vmware. I'm not sure if this the 'Right Way' to do it,
72 > >but it worked for me.
73 > >
74 > >
75 > >
76 --
77 Dr Gavin Seddon
78 School of Pharmacy and Pharmaceutical Sciences
79 University of Manchester
80 Oxford Road, Manchester
81 M13 9PL, U.K.
82
83 --
84 gentoo-amd64@g.o mailing list