I want to specify the home directory when creating a user, currently i'm using centos 6.7

Is it possible?

  • 3
    Please learn how to find out this stuff yourself. man pages exist, including man useradd. – Sven Oct 26 '15 at 2:47
  • 1
    Sorry for the bad question. – Jonathan Solorzano Oct 26 '15 at 2:50

You can do this to simply add a user:

useradd -m -d /home/newuser newuser

Or this to add a user by asking you some questions

adduser --home /home/newuser2 newuser2

  • FYI, those commands were tested on Ubuntu. – Ryan Babchishin Oct 26 '15 at 6:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.