Hot answers tagged group
36
The Jargon File has an answer which seems to agree with JanC.
wheel: n.
[from slang ‘big wheel’ for a powerful person] A person who has an
active wheel bit...The traditional name of security group zero in BSD (to which the major system-internal users like root belong) is ‘wheel’...
A wheel bit is also helpfully defined:
A privilege bit that ...
16
On Debian, the adduser package contains a deluser program which removes a user from a group if you pass both as arguments:
deluser user group
If your distribution doesn't have adduser, you can edit /etc/group and /etc/gshadow manually.
vigr
vigr -s
15
root is a user (the super user) and wheel is a group (of super users I guess).
chown root:wheel myfile
means making myfile belong to the user root and the group wheel (read man chown for more information).
13
/etc/passwd shows each user's primary group. /etc/group shows users who have a given group as one of their supplementary groups. For example, my username dan has the group dan as its primary group, so that is what appears in the group field in /etc/passwd. The user dan is also in the groups wheel, mailadmin and svn, so the entries for those groups in ...
12
You are thinking that the !, * or x has a special meaning here, and are therefore worrying that there might be some distinction among them.
The fact is that these characters are chosen simply because they stand out, at least to the eyes of those who developed Unix and its descendants. To Western eyes, these characters all have a connotation of "missing" or ...
11
Why do I need to use newgrp or su (or logout and login again) to have new group memberships applied?
When a child process is created, process user id and group ids are inherited from his parent process.
So when you change your user's groups (actually change config files somewhere on the disk) processes won't automatically notice it and change their group ids (non-root processes don't have rights for that anyway).
And when you start bash... well, you just ...
10
Deleting a file means you are making changes to the directory it resides in, not the file itself. Your group needs rw on the directory to be able to remove a file. The permissions on a file are only for making changes to the file itself.
This might come off as confusing at first until you think about how the filesystem works. A file is just an inode, and ...
10
It comes to us from BSD. This is verifiable. But where did it begin?
Here is a non-verifiable explanation- BSD got it from the TOPS-20 O/S.
http://lists.freebsd.org/pipermail/freebsd-chat/2003-December/001725.html
10
If at all possible, use access control lists (ACL).
Under Linux, make sure that the filesystem you're using supports ACLs (most unix filesystems do). You may need to change the mount options to enable ACLs: with ext2/ext3/ext4, you need to specify the acl mount option explicitly, so the entry in /etc/fstab should look like /dev/sda1 / ext4 ...
9
Local solution: use su yourself to login again. In the new session you'll be considered as a member of the group.
Man pages for newgrp and sg might also be of interest to change your current group id (and login into a new group):
To use webdev's group id (and privileges) in your current shell use:
newgrp webdev
To start a command with some group id ...
9
Some unix systems allow only members of the wheel group to use su. Others allow anyone to use su if they know the password of the target user. There are even systems where being in the wheel group grants passwordless root access; Ubuntu does this, except that the group is called sudo (and doesn't have id 0).
I think wheel is mostly a BSD thing. Linux is a ...
9
It is a backup of the previous copy of the file that is version of the file before the last change. It is kept because it is very important file. You can delete it, but backups are a "good thing".
You can easily verify it. Try
# groupadd test
# diff /etc/group /etc/group-
There are other files also that are backed up the same way viz. /etc/passwd- ...
8
See the source code, specifically libmisc/chkname.c. Shadow is pretty conservative: names must match the regexp [_a-z][-0-9_a-z]*\$? and may be at most GROUP_NAME_MAX_LENGTH characters long (configure option, default 16; user names can usually go up to 32 characters, subject to compile-time determination).
Debian relaxes the check a lot. As of squeeze, ...
7
You can control the assigned permission bits with umask, and the group by making the directory setgid to G.
$ umask 002 # allow group write; everyone must do this
$ chgrp G . # set directory group to G
$ chmod g+s . # files created in directory will be in group G
Note that you have to do the chgrp/chmod for every ...
7
Using grep's -q option is much more efficient than command substitution.
if ! grep -q -e "^$2:" /etc/group; then
echo "Error: $2 not a valid group" >&2
fi
The issue is single quotes (') prevent shell variable expansion ($). You need to use double quotes (").
7
The gid is the primary identifier of the group. As far as the system is concerned, a different gid is a different group. So to change the gid, you're going to have to modify all the places where that gid is used. You should avoid treating the gid as significant and use group names instead; you can change the name of a group with a single command (on Linux: ...
6
Because wheel is a tool of oppression! From info su:
Why GNU 'su' does not support the 'wheel' group
(This section is by Richard
Stallman.)
Sometimes a few of the users try to
hold total power over all the rest.
For example, in 1984, a few users at
the MIT AI lab decided to seize power
by changing the operator password on
the ...
6
user2 needs to log out and back in. Group permissions work this way:
When you log in, your processes get to have group membership in in your main group mentioned in /etc/passwd, plus all the groups where your user is mentioned in /etc/group. (More precisely, the pw_gid field in getpw(your_uid), plus all the groups of which your user is an explicit member. ...
6
The usermod command will allow you to change a user's primary group, supplementary group or a number of other attributes. The -g switch controls the primary group.
For your other questions...
1 - If you specify a group, groupname, that does not exist during the useradd stage, you will receive an error - useradd: unknown group groupname
2 - The groupadd ...
6
The easiest way is to use groupmod -g <NEW_GID> <groupname>
Another way is to edit /etc/group directly. The third field in each column is the gid.
If the changed group is the main group of a user, /etc/passwd need to be adapted, too: usermod -g <NEW_GID> <username>. See here for more information.
6
Every process in a UNIX-like system, just like every file, has an owner (the user, either real or a system "pseudo-user", such as daemon, bin, man, etc) and a group owner. The group owner for a user's files is typically that user's primary group, and in a similar fashion, any processes you start are typically owned by your user ID and by your primary group ...
5
As others have said, it comes from the term "Big Wheel". I think many of us are not familiar with this term because, according to at least one site, it became a popular expression after World War Two:
Big wheel is another way to describe
an important person. A big wheel may
be head of a company, a political
leader, a famous doctor. They are big
...
5
newgrp starts a subshell with the group you specified. So that line in your script will not finish until that subshell is done.
The handling of newgrp is also different if you're using bash or ksh. ksh implements it as a built-in command that is equivalent to exec /usr/bin/newgrp [group]. So, like exec, newgrp never returns. (See some documentation here.)
...
5
To list all available groups with users in them you can use
getent group
or just look the content of /etc/group file.
By the way, on ubuntu there is only one superuser too. It is root. All others just are allowed to use it privilleges via sudo. You can modify rules in /etc/sudoers via visudo as mentioned above, if sudo is installed. This is true for any ...
5
Did the file originate on a different machine? You often see this happening, for example, with unpacked tar archives that were created elsewhere. The user/group pair existed on the remote site, but possibly aren't defined locally. Therefore, utilities that try to resolve user/group numbers to names fail, and fall back to displaying the numerical ID instead.
5
The usernames in /etc/group only contain users who are in the group as a supplementary group, not a primary group. Primary group information is stored in /etc/passwd. The initgroups(3) manpage was the only documentation I could find to indicate this:
NAME
initgroups - initialize the supplementary group access list
FILES
/etc/group ...
4
You mix two different distinctions here:
Between real and effective group ids
Between primary and supplementary users' groups
The first distinction refers to how processes are being run. Normally, when you run a command/program, it is run with the privileges of your user. It has the real group id same as your user's primary group. This can be changed by ...
4
You didn't mention what platform you are on, but a Linux system from within the last 5 years (or more, probably) supports ACLs, in addition to the traditional Unix file system permissions. By using ACLs, you can add the 2nd group to the directory with write access:
$ setfacl -m group:2ndtomcatdeploy:rwx target_directory
You can use getfacl to display the ...
4
If I understand your question correctly, you can use find's -gid condition:
find /media/extdrive -gid 100 | sudo xargs chown myself:myself
or if you prefer find's -exec:
sudo find /media/extdrive -gid 100 -exec chown myself:myself '{}' ';'
or, looking at chown's manpage, it has a --from option you may find useful:
sudo chown -R myself:myself ...
4
The practice is not to create one user and group per application, but per service. That is, programs that are executed by a local user don't need to be installed as a user other than root. It's daemons, programs running in the background and that execute requests coming through the network or other communication means, that should run as a dedicated user.
...
Only top voted, non community-wiki answers of a minimum length are eligible