Tech Junkie Blog - Real World Tutorials, Happy Coding!: Linux CentOS In-Depth: Adding A New User With useradd and usermod Command

Wednesday, August 15, 2018

Linux CentOS In-Depth: Adding A New User With useradd and usermod Command

One of the most common task you have to do as a Linux administrator is to add a new user.  Especially developers who always wants root access.  To accomplish this task you can use the useradd command in the Terminal session.  Follow the steps below to add a new user to CentOS.



1.  Switch into the root user using su - command





 2. Type the following command useradd -s  /bin/bash -d /home/john -m john then press "Enter"






useradd is the command to add a new user to CentOS, below is an explaination of what each switch means in the command above

-s --shell SHELL - the login shell of the new account, which is the/bin/bash shell
-d --home-dir HOME_DIR - home directory of the new account, which is /home/john

3.  Type ls /home to list the content of the /home directory and you will see the john directory has been created for the user john





4.  We've created a new user name john, but he has no password, to set a password for john we can use the passwd command.  Type the following command to assign john a password passwd john  type in john's password when prompted with New Password:   and confirm the password when prompted with Retype new password:









5.  Even though john has a login, we still don't know what John's full name is to assign a real name to the login john we can use the usermod -c command to assign the login name john a real name





the command above usermod -c "John Wallace" john assigns the name John Wallace to the user name john

Similar Posts:



28 comments:

  1. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.

    SELENIUM TRAINING IN BANGALORE

    ReplyDelete
  2. good and thanks for your post for various blog for users intention. those who are looking to choose their carrer in cloud. they can prefer azure online training hyderabad this you can on azure training

    ReplyDelete
  3. I learned World's Trending Technology from certified experts for free of cost. I Got a job in decent Top MNC Company with handsome 14 LPA salary, I have learned the World's Trending Technology from Python training in pune experts who know advanced concepts which can help to solve any type of Real-time issues in the field of Python. Really worth trying instant approval blog commenting sites

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. I learned World's Trending Technology from certified experts for free of cost. I Got a job in decent Top MNC Company with handsome 14 LPA salary, I have learned the World's Trending Technology from hadoop training in btm experts who know advanced concepts which can help to solve any type of Real-time issues in the field of Hadoop. Really worth trying

    ReplyDelete
  6. You have provided a nice article, Thank you very much for this one. And I hope this will be useful for many people. And I am waiting for your next post keep on updating these kinds of knowledgeable things
    Android App Development Course in Chennai
    Android Development Course in Bangalore
    App Development Course in Coimbatore
    Mobile Application Development Course in Coimbatore

    ReplyDelete
  7. I really appreciate for your blog post. we can get educated from your blog posts. this will be helpful to us hadoop online training hyderabad

    ReplyDelete
  8. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful .web designing training in bangalore



    ReplyDelete
  9. Such a great information for blogger i am a professional blogger thanks…

    Looking for Best Training Institute in Bangalore , India. Softgen Infotech is the best one to offers 85+ computer training courses including IT Software Course in Bangalore , India. Also it provides placement assistance service in Bangalore for IT.

    ReplyDelete
  10. An internship arrangement will be offered by different progressions.internship in chennai for civil readiness can be useful for higher examinations of school understudies, school and polytechnic understudies. Internship training will improve future livelihood advancement.

    ReplyDelete
  11. Thanks for sharing.I appreciate your efforts for producing such high quality content.Visit big data certification bangalore if you are looking for any big data related certification courses

    ReplyDelete
  12. This blog is really helpful for me and got a basic knowledge in this topic. Waiting for more updates, kindly keep continuing.

    Machine Learning Training in Hyderabad

    ReplyDelete
  13. Hi, Thanks for sharing wonderful articles...

    <a href="https://www.dnaglobal.in”> CA in Rohini</a>

    ReplyDelete

  14. A popular solution for creating cross-platform mobile apps is PhoneGap.An open-source framework for developing mobile applications was produced by Nitobi Software. It enables the creation of apps utilising HTML, JavaScript, and CSS by the developers. To learn more about PhoneGap, join phonegap course in chennai at FITA Academy.
    phonegap course in chennai

    ReplyDelete

Search This Blog