Click Here

a href="https://ref.adbtc.top/3604752" target="_blank" border="0">

How to enable root user for SSH ?

 






For enabling root user in ubuntu you need to run only 2 cmd .... 



1st CMD- 

  1. $ sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
    

2nd CMD- 

  1. $ sudo systemctl restart ssh
    
  1. Open a terminal window and log in as the root user using the su command.

  2. Edit the /etc/ssh/sshd_config file using a text editor such as vi or nano.

  3. Locate the PermitRootLogin directive in the sshd_config file and set it to yes. This directive controls whether the root user is allowed to log in via SSH.

  4. Save the changes to the sshd_config file and exit the text editor.

  5. Restart the SSH daemon to apply the changes by running the service ssh restart command or the equivalent command for your operating system.

  6. Test the root login by connecting to the server via SSH using the root user's login credentials.

It is important to note that allowing the root user to log in via SSH can be a security risk, as it allows anyone with the root user's login credentials to have full access to the system. It is generally recommended to use a non-root user account with sudo privileges for SSH access instead.



Thanks for visiting our blog.



Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.