Copied to clipboard


The `usermod` command line tool can be used to modify properties, permissions, and group membership of existing users.


  • Add user jdoe to group sales: sudo usermod -a -G sales jdoe
  • Change the home directory of user jdoe to /home/jdoe-new: sudo usermod -d /home/jdoe-new jdoe
  • Change the comment information for user jdoe to "John Doe, Engineering": sudo usermod -c "John Doe, Engineering" jdoe
  • Change the default shell for user jdoe to zsh: sudo usermod -s /bin/zsh jdoe
  • Change the UID for user jdoe to 1001: sudo usermod -u 1001 jdoe