How to create user with different home directory

Create Directory

#mkdir /data

Create user
Syntax:
# useradd -d /data/userdir  username

Example:
# useradd -d /data/shahzad shahzad

Login in to user

#su - shahzad
$ pwd
/data/shahzad