# Removing user from group



## jkuiper (Jan 16, 2014)

A user is a member of wheel to make some changes as root. Now I have installed sudo. I think it's a more proper way to do root jobs. Now I want to set the user as non member of wheel.

I tried this option: `pw groupdel wheel <username>`. Nothing happens in /etc/group. Editing /etc/group and deleting the user from group wheel doesn't help. I noticed because I logged in as the user and I still can log in as root with `'su -'`.

What is the right way?

I'm working with FreeBSD 9.2.


----------



## usdmatt (Jan 16, 2014)

I believe the `groupdel` option is for actually deleting groups, not removing users from them. Hopefully it didn't actually remove the wheel group.

Is it possible that you've set the primary group for this user to wheel? What does the output of `pw usershow <user>` show?


----------



## SirDice (Jan 16, 2014)

Keep in mind that you have to log off and back on again for the changes to go in effect.


----------



## Saeediranzad (Feb 3, 2014)

I have a similar problem.
I removed my username to renew it. (because I thought Mate desktop confused users with root, according to similar problems I had searched on Google)
Now when I log in as multiuser the only thing I get is a blinking screen and no login frame.
I can login as single user, but when I use "adduser" command, it fails to add user and says:
"pw: gr_tmp (): Read-only file system."
Any suggestion?


----------



## SirDice (Feb 3, 2014)

The correct command is: `pw groupmod wheel -d <username>`


----------



## SirDice (Feb 3, 2014)

Saeediranzad said:
			
		

> I can login as single user, but when I use "adduser" command, it fails to add user and says:
> "pw: gr_tmp (): Read-only file system."


When you boot into single user mode the root filesystem is mounted read-only.


----------



## SirDice (Feb 3, 2014)

jkuiper said:
			
		

> Editing /etc/group and deleting the user from group wheel doesn't help. I noticed because I logged in as the user and I still can log in as root with `'su -'`.


The user needs to log out and back in again for the new group membership to load. It's not something that's done dynamically, it's only set when the user logs in.


----------

