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

Is it possible?

closed as off-topic by Iain, mdpc, Dave M, Cristian Ciupitu, Ward Oct 29 '15 at 1:43

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Cristian Ciupitu, Ward
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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.