First login with your root account..

1.User add:-

    Syntax: useradd -m <userName>

    Example: useradd -m xyz

    We have created a user xyz along with creating a home directory using(-m).


2.Password change:-

Syntax: passwd <User_Name>

Example: passwd xyz

if you want to change yourself password just enter only "passwd",


3.Change username:-

    Syntax: usermod -l <New_Username> <Old_Username>

    Example: usermod -l newxyz xyz


4.Change user home directory name:-

    Syntax: usermod -d /home/<New_Directoryname> -m <Username>

    Example: usermod -d /home/newxyz -m xyz


5.User delete:-

    Syntax: userdel -r <userName>

    By using userdel -r option, you can delete home directory along with user account.


6.User shell change:-

Syntax: usermod -s <New_Shell> <userName>

Example: usermod -s /bin/bash xyz

Post a Comment

Previous Post Next Post