
You can add multiple users by specifying their usernames using a space between them. Go to the bottom of the SSH configuration file and add AllowUsers on a new line. The first option is to allow a specific user to have remote access to your server via SSH. There are several options used which will allow or deny access to your server via SSH. Open the SSH configuration file /etc/ssh/sshd_config sudo nano /etc/ssh/sshd_config If your system has a large number of user accounts, then you can use this section and see how you can limit the remote access to your server. Individual files in /usr/share/doc/*/copyright.ĭebian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent The exact distribution terms for each program are described in the
#OPENSSH DEBIAN SOFTWARE#
The programs included with the Debian GNU/Linux system are free software Now when you try to log in as a root user, you should receive an output like this: login as: root

You can do that by running the following command: sudo systemctl restart ssh.service When you finish editing the SSH configuration file, save it and restart the SSH service for the changes to take effect. In the second step, simply change the ‘prohibit-password’ to ‘yes’ like in the example shown below: PermitRootLogin yes In the first step, uncomment the line by removing the # character at the beginning of the line, like the following example: PermitRootLogin prohibit-password There are two steps to enable the root login. sudo nano /etc/ssh/sshd_configįind the following line in the file. In this tutorial, we will use nano as our text editor, but you can freely use any editor you want. We need to edit the main SSH configuration file ‘ sshd_config‘ so we can enable logging directly as root. Log in to your Debian VPS via SSH as a user with ‘sudo’ privileges: ssh Server_IP_Address -p Port_Number Enable SSH Root Login

We can also configure SSH to allow specific users or groups, as well as blacklisting certain users or groups from having access which can make server management a lot easier. Let’s get started. If you are constantly working on your server and you need root access, it’s more comfortable to log in directly as a root user instead of using the ‘sudo’ command all the time. However, you will be able to run commands with the same authority as the root user when using the ‘sudo’ prefix on your commands. While SSH is turned on, we also know that a fresh installation of Debian 9 comes with root access disabled, which means you will not be able to log in directly to your server via SSH as the root user. Luckily, SSH is turned on by default on a Debian 9 Server install. SSH stands for Secure Shell and it is a UNIX-based command interface and protocol which usually is used to gain secure access to a remote machine.
#OPENSSH DEBIAN HOW TO#
In this article, we will show you how to enable root access for SSH on a Debian 9 server.īefore we start with setting up our SSH service, we need to know what SSH actually is.
