Search our database

How to enable password authentication and login as root user


By default, all Linux instances will use private key for access authentication. This tutorial will guide you through to disable key authentication and use the root password to login.





Step 1: Login to your Linux instance via PuTTY.


Step 2: In the terminal, enter “sudo su –” to switch to your root user in order to make changes to the system.


Step 3: Edit “/etc/ssh/sshd_config” with your favorite editor. We will use vi for this tutorial.


Step 4: Change “PasswordAuthentication” to yes and save your changes.


Step 5: Restart sshd.


Step 6: Set a password for the root user.


Step 7: Login as root user without ssh key and enter the password for root.


IMPORTANT: Please take note that enabling password authentication and using root user for login might impose brute-force attack towards your server. You are also advised to change the default SSH port.