Shashikant shah

Wednesday, 12 September 2012

CHANGE USER HOME DIRECTORY

     We are changing home directory of shashi user


1. shashi (user name)

2. data (directory)

Create User

# useradd shashi

Check  default home directory path

# cat /etc/passwd | grep shashi

 shashi:x:501:501: :/home/shashi:/bin/bash

Create a directory

# mkdir /data

 Change user home directory path

# usermod -d /data shashi
 
 # cp -i /etc/skell/.* /data

Give to owner ship directory

# chown -R shashi:shashi /data

Check user dicectory path

# cat /etc/passwd | grep shashi

 shashi:x:501:501: :/data:/bin/bash

No comments:

Post a Comment