0

I want to enable root login via ssh. So I add the ligne 'PermitRootLogin yes' to ssh config file '/etc/ssh/sshd_config' :


Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 1024
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
RhostsRSAAuthentication
PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes


But the access is denied.
thanks in advance

  • did you restart the service? – Jakuje Mar 23 '17 at 20:49
1

It could be a couple of things:

1)If you are trying to log in using a password you will need to add:

PasswordAuthentication yes

in the config file. (Should only use this method for setting up ssh keys initially)

2)You have not properly set up your SSH keys.

3)The ssh port is being blocked by the firewall.

  • add "PasswordAuthentication yes" doesn't work the port is open because I can login with simple user but not with the root – Ridae Mar 23 '17 at 19:40
  • 1
    Have you restarted the ssh server after modifying the config? – diametralpitch Mar 23 '17 at 19:43
  • yes I did but it's not working – Ridae Mar 23 '17 at 20:20
  • On the client side, are you using an ssh config file? What does your ssh command look like? – diametralpitch Mar 24 '17 at 7:05
  • In the root users' ~/.ssh/authorized_keys is the key you are attempting to use there? – linuxdev2013 Mar 25 '17 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.