Add an SSH User in Linux

Expand / Collapse

Summary

This article provides the steps to add an SSH user to a Linux server.

    Steps

    1. Log into the Linux server via SSH as the root or as an administrative user.
    2. To add the user, type in the following at the command prompt (where <username> is the user you are adding):
    3. root@server [/]# useradd <username>
    4. To set the password for the user, type in the following at the command prompt:
    5. passwd <username>
    6. Enter the secure password for the user twice.  The user is now configured with the specified password.  If the user needs root access to the server, edit /etc/sudoers and add the user into the file as follows:
    7. ## Allow root to run any commands anywhere  
      <username> ALL=(ALL)       ALL
              
    8. Save the file and the user now has root access to the server.


    Rate this Article:


    Details
    Category: Linux

    Last Modified:Thursday, December 13, 2018 12:42 PM

    Type: HOWTO

    Level: Beginner

    Article not rated yet.

    Article has been viewed 2,281 times.

    Options
    Email Article Email Article


    Social Bookmarks Social Bookmarks