Tag Info

Hot answers tagged

59

You can use gpasswd: # gpasswd -d user group then the new group config will be assigned at the next login, at least on debian. If the user is logged in, the effects of the command aren't seen immediately.


52

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 ...


37

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


30

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 ...


23

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 ...


17

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).


15

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


14

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: ...


13

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 ...


13

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 ...


13

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 Western eyes. These characters connote a missing value, or an exception case, or a warning. You could put boogabooga here and have ...


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

I too have never ever seen this feature used, not even one time. Most SA's aren't even aware that this facility exists. In looking at the man page for gpasswd there was this note: Notes about group passwords Group passwords are an inherent security problem since more than one person is permitted to know the password. However, groups are a useful ...


11

This question is a good fit for linux acl. Since you don't state your OS, I'll assume Linux in what follows. Here is an example session. I don't know of a really good acl tutorial, but you could do worse than http://www.vanemery.com/Linux/ACL/linux-acl.html Note that the default acl behaves like a local umask. Since at least in Linux, umasks are applied ...


11

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 ...


11

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.


10

Your options are to set the setgid bit (chmod g+s) on the directory to make files created within it match its group ID, or to use the newgrp command to open a shell with the desired group ID before editing the file.


9

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, ...


9

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 ...


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- ...


9

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 ...


8

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. ...


8

You might need to have user2 log out and back in (or just try ssh'ing in to create a new login session). Check the output of id --groups to show the numeric group ids for a user.


8

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 ...


8

You can only chgroup to a group you are a member of: $ groups terdon sudo netdev fuse vboxsf vboxusers $ chgrp fuse file $ ls -l file -rw-r--r-- 1 terdon fuse 531 Apr 15 19:17 file $ chgrp mysql file chgrp: changing group of ‘file’: Operation not permitted This behavior is mentioned in the POSIX specs: Only the owner of a file or the user with ...


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

There is no such thing as a group being a member of a group. A group, by definition, has a set of user members. I've never heard of a feature that would let you specify “subgroups” where members of subgroups are automatically granted membership into the supergroup on login. If /etc/group lists group1 as a member of group2, it designates the user called ...


7

When you use chown in a manner that changes only the group, then it acts the same as chgrp. The owner of a file or directory can change the group to any group he is a member of. It works like that because both the chown and chgrp commands use the same underlying chown syscall, which allows changing both owner and group. The syscall is what applies the ...


7

It sounds like you're describing the setgid bit functionality where when a directory that has it set, will force any new files created within it to have their group set to the same group that's set on the parent directory. Example $ whoami saml $ groups saml wheel wireshark setup a directory with perms + ownerships $ sudo mkdir ...



Only top voted, non community-wiki answers of a minimum length are eligible