Linux添加用戶(user)到用戶組(group)
將一個用戶添加到用戶組中,千萬不能直接用:
usermod -G groupA
這樣做會使你離開其他用戶組,僅僅做爲 這個用戶組 groupA 的成員。
應該用 加上 -a 選項:
usermod -a -G groupA user
(FC4: usermod -G groupA,groupB,groupC user)
-a 代表 append, 也就是 將自己添加到 用戶組groupA 中,而不必離開 其他用戶組。
從用戶組中刪除某用戶
從wheel組中刪除 test用戶
gpasswd wheel -d test