Linux - add user to new group, Remove user from group

Linux Add user to new group

usermod -aG    <groupname>  <username>
[root@itstorage ~]#id m.bahmani
uid=1298200020(m.bahmani) gid=1298200020(m.bahmani) groups=1298200020(m.bahmani),501(oinstall),1298200035(allsshusers)
[root@itstorage ~]#usermod -aG  wheel m.bahmani
[root@itstorage ~]#id m.bahmani
uid=1298200020(m.bahmani) gid=1298200020(m.bahmani) groups=1298200020(m.bahmani),10(wheel),501(oinstall),1298200035(allsshusers)

Remove user from group

gpasswd -d <username> <groupname>
[root@itstorage ~]#id m.bahmani
uid=1298200020(m.bahmani) gid=1298200020(m.bahmani) groups=1298200020(m.bahmani),10(wheel),501(oinstall),1298200035(allsshusers)
[root@itstorage ~]#sudo gpasswd -d m.bahmani wheel
Removing user m.bahmani from group wheel
[root@itstorage ~]#id m.bahmani
uid=1298200020(m.bahmani) gid=1298200020(m.bahmani) groups=1298200020(m.bahmani),501(oinstall),1298200035(allsshusers)
مطالب و دوره های آموزشی مرتبط
مطالب و دوره های آموزشی مرتبط

Linux - add user to new group, Remove user from group

Linux Add user to new group

usermod -aG    <groupname>  <username>
[root@itstorage ~]#id m.bahmani
uid=1298200020(m.bahmani) gid=1298200020(m.bahmani) groups=1298200020(m.bahmani),501(oinstall),1298200035(allsshusers)
[root@itstorage ~]#usermod -aG  wheel m.bahmani
[root@itstorage ~]#id m.bahmani
uid=1298200020(m.bahmani) gid=1298200020(m.bahmani) groups=1298200020(m.bahmani),10(wheel),501(oinstall),1298200035(allsshusers)

Remove user from group

gpasswd -d <username> <groupname>
[root@itstorage ~]#id m.bahmani
uid=1298200020(m.bahmani) gid=1298200020(m.bahmani) groups=1298200020(m.bahmani),10(wheel),501(oinstall),1298200035(allsshusers)
[root@itstorage ~]#sudo gpasswd -d m.bahmani wheel
Removing user m.bahmani from group wheel
[root@itstorage ~]#id m.bahmani
uid=1298200020(m.bahmani) gid=1298200020(m.bahmani) groups=1298200020(m.bahmani),501(oinstall),1298200035(allsshusers)
مطالب و دوره های آموزشی مرتبط
مطالب و دوره های آموزشی مرتبط