Перейти к содержимому

Как включить root ssh

  • автор:

Sorry, you have been blocked

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

Cloudflare Ray ID: 7a255fd6adff24aa • Your IP: Click to reveal 88.135.219.175 • Performance & security by Cloudflare

Как включить SSH доступ для пользователя root на Debian

По-умолчанию, и это правильно, подключение по SSH для пользователя root в операционной системе Debian запрещено. Логика такова, что сначала нужно зайти в систему обычным пользователем, а потом при необходимости повысить себе права до root. В этой статье расскажу как разрешить пользователю root сразу подключаться по SSH.

Решение

Найдите файл /etc/ssh/sshd_config. И отредактируйте в нем следующую строку:

How to Enable root user for SSH Authentication on Ubuntu 20.04 LTS

In this article, I will take you through the steps to enable root user for ssh authentication on Ubuntu 20.04 LTS. If you are Linux user or professional then you might be aware that by default on Ubuntu based systems, root user will not be enabled for ssh authentication due to security purposes. You always need to login with non-root user account and then if you need you can switch to root user after providing correct credentials.

While in most of the cases this works really well but some times you might get a situation when you need to have direct root user access to perform some important task. In those situations, you need to enable root user for SSH authentication. This can be easily done using steps shown in below section. More about SSH Protocol.

How to Enable root user for SSH Authentication on Ubuntu 20.04 LTS

How to Enable root user for SSH Authentication on Ubuntu 20.04 LTS

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 LTS System.

b) You should have sudo or root access to run privileged commands.

c) You should have OpenSSH Server installed in your System.

Step 2: Edit /etc/ssh/sshd_config File

By default if you have check PermitRootLogin parameter using grep -i permitrootlogin /etc/ssh/sshd_config command then you will see it is set as prohibit-password . You need to change this parameter to yes to enable root user authentication.

For that you need to open /etc/ssh/sshd_config file using our favorite nano editor and then set the parameter value to yes . Then Press Ctrl+X and give Y to save and close the file.

After changing the parameter, you can verify it by again by using the same grep -i permitrootlogin /etc/ssh/sshd_config command. This time as you can see the value is set as yes . It means allow root user for remote SSH authentication.

Step 3: Restart SSH service

After setting the parameter, you need to restart ssh service by using systemctl restart ssh command as shown below.

Then check the service status by using systemctl status ssh command. It should show as active and running as you can see below.

Step 4: Login with root

Now you can try login with root user account using putty or any other SSH tools you are using. Here we are using putty application so we will connect our Server by providing its IP Address 192.168.29.113 . It will then ask for login user which will be root and then provide the root password to authenticate. It should login successfully as shown below.

How to Enable root user for SSH Authentication on Ubuntu 20.04 LTS 2

Step 5: Reset root password(Optional)

Sometimes you might face Access Denied error even after changing PermitRootLogin parameter to yes and restarting the ssh service. In that situation, you can reset root user password once by using passwd command and then try with the new password.

Enable Root Login via SSH in Ubuntu 20.04

Enable Root Login via SSH in Ubuntu 20.04

In this tutorial, You will learn enabling root login via SSH in Ubuntu 20.04. And we will show you how to set a password for the Root user and how to enable it. Since the Secure shell helps you to handle your network service when you may face an unsecure network, it is a logical reason to learn about it. Stay with us to verify this secure connection of client and a server. But if you have not get your own VPS, contact us to be a virtual private server owner. You can visit the packages available in Eldernode if you wish to purchase an Linux VPS server.

To let this tutorial work better, please consider the below Prerequisites:

a non-root user with sudo privileges
To set up, follow our Initial server set up on Ubuntu 20.04 LTS.

Table of Contents

Enable Root Login via SSH in Ubuntu 20.04

By default, SSH on Ubuntu comes configured in a way that disables the root users log in. This was originally enabled as a security precaution which means that you cannot directly log in as the root user over SSH. However, you can usually get around the need for root ssh login by using the sudo command.

Set Root password

After login to Ubuntu 20.04, Now type following command for reset/set root password.

After type the command, maybe Ubuntu 20.04 check your password username. first, you put your username’s password and when you see a prompt for a new password, type a new password for root and confirm that.

you succeed to change the root password, now you need to change some configuration on /etc/ssh/ssh_config for the permit root login.

Configure SSH config to permit root login

Edit /etc/ssh/sshd_config file with following command.

permit root login display

As you see, the PermitRootLogin is set to No. It means that the root login via SSH has been disabled. So, to enable root login change the No to Yes . Find PermitRootLogin and delete No or without-password and type yes .

After edit the SSH config file, press Ctrl + x and press Enter button twice for save and exit.

Restart SSH service for loading new configuration on SSH_config file.

Now you can check SSH via Root user.

conclusion

At this point, you learned how to Enable Root Login via SSH in Ubuntu. From now on you will be able to connect to your system remotely and perform administrative tasks. So, log in to Ubuntu 20.04 via ssh with root user and enjoy it. In case you feel interested in reading more about SSH articles, have a look at Install SSH Server on Linux and allow root user login.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Luxury Car Rental in Miami | Reserve a Premium Vehicle with RealCar