Editing Usermod

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{lowercase}}
 
<code>[[usermod]]</code> command included in <code>[[Passwd (package)|passwd]]</code> package: https://linux.die.net/man/8/usermod
 
  
Add an additional secondary group:
 
* <code>sudo usermod -aG sudo YOUR_USERNAME</code>
 
* <code>usermod -a -G YOUR_GROUP YOUR_USERNAME</code>
 
  
Change primary group for user:
+
sudo usermod -aG sudo <username>
  [[usermod -g]] yournewprimarygroupname yourusername
+
 
 +
  usermod -a -G YOUR_GROUP YOUR_USERNAME
  
 
  usermod -s /usr/sbin/nologin myuser
 
  usermod -s /usr/sbin/nologin myuser
 
  [[ssh]] and [[scp]] will fail
 
  [[ssh]] and [[scp]] will fail
  
* <code>[[groups]]</code>
 
* <code>[[groups]] USERNAME</code>
 
  
You may need to start a new login shell after adding user: <code>su - USERNAME</code>
+
[[groups]] USERNAME
  
<code>sudo [[usermod -l]] newusername oldusername</code> change user name
 
  
 
== Related commands ==
 
== Related commands ==
Line 23: Line 16:
 
* <code>[[groups]]</code>
 
* <code>[[groups]]</code>
 
* [[Passwordless sudo]]
 
* [[Passwordless sudo]]
* <code>[[visudo]]</code>, <code>[[sudoers]]</code>
 
* [[macOS]]: <code>sudo [[dseditgroup]] -o edit -a $username_to_add -t user admin</code>
 
  
 
== See also ==
 
== See also ==
* {{usermod}}
 
 
* {{Linux Commands privileges}}
 
* {{Linux Commands privileges}}
 
[[Category:Linux]]
 

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: