Flippin Sweet Dude

January 1, 2008

Add User

Filed under: Linux — aaron @ 9:22 pm

Options:

  • -d home directory
  • -s starting program (shell)
  • -p password
  • -g (primary group assigned to the users)
  • -G (Other groups the user belongs to)
  • -m (Create the user’s home directory

Example: To add a new user with:

  • a primary group of users
  • a second group mgmt
  • starting shell /bin/bash
  • password of xxxx
  • home directory of roger
  • create home directory
  • a login name of roger

You would:

sudo useradd -g users -G mgmt -s /bin/bash -p xxxx -d /home/roger -m roger

To add to sudo users:

sudo usermod -a -G admin username

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress