Which command should I use to remove a user from a group in Debian?

Which command should I use to remove a user from a group in Debian?

When adding a user to a group, it can be done with:

# usermod -a -G group user

However, I could not find a similar command (accepting a group and user as arguments) for removing the user from the group. The closest I could get is:

usermod -G all,existing,groups,except,for,group user
Is there a command like usermod OPTION group user with OPTION an option to make usermod (or a similar program) remove the user from group?

# gpasswd -d user group

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s