Enable SSH root login on Debian Linux Server - LinuxConfig.org


#1
After fresh system installation the root login on the Debian Linux is disabled by default. When you attempt to login as root user to your Debian Jessie Linux server the access will be denied eg.:
This is a companion discussion topic for the original entry at https://linuxconfig.org/enable-ssh-root-login-on-debian-linux-server

#2

Roger Crist

I’m installing Debian v9.3 on a beaglebone black and I can’t ssh in as root. When I modify /etc/ssh/ssh_config in pico and try to save changes, I get an error “Error writing /etc/ssh/sshd_config: Permission denied”… so the fix on this page doesn’t help me. Any ideas would be very much appreciated.

OK, NM, figured it out: sudo su (enter: temppwd) . . . THEN edit the file and reboot. Done. BTW, I’m ssh’d in as ‘debian’.


#3

Грабовой Вадим

Hi! I have same problem, but in my ‘/etc/ssh/ssh_config’ i found this line ‘#PermitRootLogin prohibit-password’, and after changing it to ‘#PermitRootLogin yes’ and restarting ssh server - still have ‘Permission denied, please try again.’ Any ideas ? I’m using Debian 8.7.1


#4

Lubos Rendek Mod -> Грабовой Вадим

Hi, make sure that you have also remove a “#” sign. Thus change #PermitRootLogin yes’ to ‘PermitRootLogin yes’ :slight_smile:


#5

Isytha roof -> Lubos Rendek

i’ve tried to remove # but its still denied.


#6

Jeff Howard

I am using Debian 8 compiled for arm/beaglebone and my /etc/ssh/ssh_config doesn’t have the line ‘PermitRootLogin without-password’ and adding the line ‘PermitRootLogin yes’ followed by a ‘/etc/init.d/ssh restart’ still doesn’t allow a root login. Any ideas here?


#7

lordtyr85 -> Jeff Howard

you opened the ssh client config, the ssh server config is sshd_config.


#8

Vitalii Korshak -> lordtyr85

I registered an account here especially to say thank you!


#9

Polakete -> lordtyr85

I registered an account here especially to say thank you!


#10

AndreaS

thanks!!! it works


#11

Term-X

It should be noted that this practice is highly discouraged and the default behavior is that way for a reason. A large number of compromised *nix servers are compromised because the root password was brute forced or guessed. One of the first things I do when setting up a server is to disable SSH password authentication completely and only rely on SSH keys which is much more secure. There are no SSH passwords to compromise or brute force then.


#12

Jasper Kasper

Thaaank youuu!!! After 30 minutes I had find this and it works directly!!