What does `usermod -G` without `-a` do?
IntermediateConceptPermissions, Users & sudo
Answer
It replaces the user's supplementary group list with exactly the groups given. Running usermod -G docker alice removes alice from sudo/wheel and every other group. Always use usermod -aG, or gpasswd -a alice docker, which only adds.
More on Permissions, Users & sudo
Explain the rwx permission model for files and directories.BeginnerHow does octal notation work in chmod?BeginnerWhat does chown do and who can run it?IntermediateWhat is umask and how is the final permission calculated?IntermediateWhat is SUID and give a real example?IntermediateWhat does SGID do on files versus directories?Intermediate