Skip to content Skip to sidebar Skip to footer

Adding user ROOT SSH with password authentication on Ubuntu VPS

Adding a new SSH user on Ubuntu VPS

There have been several discussions about what SSH is and how to use it, so I think it doesn’t need to be explained again in this article. What is certain is that using SSH is not used to tunnel, just like a VPS is used to open it Firewall from the ISP, but SSH is also used to manage everything on the virtual server if the user has been given ROOT access. Users who have owned a VPS must have known about it.

All VPS services must have 2 options in the initial formation or process insert Servers that are asked whether to use a password to enter SSH or use a public certificate file instead, of course, many people prefer a password because it is very convenient and does not have to carry the certificate file with them. But there are also VPS services that require users to use the certificate file and not be able to use a password, namely Amazon AWS.

In addition, there are still many VPS service providers that requires the use of a certificate file instead of a password, but behind that, users can also change it as a password and that is a very simple thing and this time I will share the procedure on Linux operating systems only. Even if the user uses a password can still get ROOT access, this method is also almost identical to adding an FTP user. Here is the procedure.


  1. First, go to the terminal and type ROOT and ENTER.

    sudo -s
  2. Next, you need to add a user first. Type the following command and press ENTER.

    adduser namauser

    Please change Username with the new username. A dialog then appears in which you can enter a lot of information such as name, date of birth, etc. Just leave it blank and hit Enter.

  3. Before this, the user must have seen a dialog asking for a password, ie the password that will later be used for entering SSH. If you want to replace it, enter this command.

    passwd namauser
  4. Now ROOT access is added. Enter this and press ENTER.

    visudo

    Then add this under the words “ROOT ALL = (ALL) ALL”.

    namauser	ALL=(ALL) ALL
  5. Not done yet, it’s time to add something to the SSH configuration so that it can use passwords. So enter this command.

    nano /etc/ssh/sshd_config

    The user is taken to the text editor and searches for text Pubkey authentication yes and add this below

    PasswordAuthentication yes
  6. Now it’s time to reload the SSH process with this command.

    sudo /etc/init.d/ssh reload
  7. Now try to log in to SSH with the new user. You should be able to use the password.


This method doesn’t change the main SSH user, but at least it does with a new user you can still do like the main user B. install something and others because the new user has ROOT permissions. It’s the same as adding an FTP user, except that it only applies to SSH. The user may be asked for a duplicate password, that is, when they log in for the first time and enter the ROOT command. If you have any questions please comment.

Hopefully useful and good luck