Centos 7 Remote SSH access denied [closed]

2019-09-16 23:03发布

I installed Centos7, all fine, till I want to access via SSH, I get always Access Denied.

  1. I get it with the root user, and another new created user
  2. I tested SSH within the LAN, so no firewall issue
  3. For the root user "PermitRootLogin yes" is set.
  4. SSH service is started

... till now, I have no clue what I ignored to set it right to have it working.

I got a look into the secure log. When I try to login with the root user on the LAN, I do like:

ssh root@192.168.2.11

in log I get: invalid user root@localhost from 192.168.2.108

When I try through VPN-tunnel:

ssh root@192.168.2.11

in log I get: invalid user kristoxxxxxxxx

this is my username on my OSX device. why is this one passed?

1条回答
甜甜的少女心
2楼-- · 2019-09-16 23:39

This may be due to RSA or DSA keys, os please delete or backup following files from /etc/ssh director to another one.

ssh_host_dsa_key, ssh_host_dsa_key.pub, ssh_host_key, ssh_host_key.pub, ssh_host_rsa_key , ssh_host_rsa_key.pub etc

Now restart your sshd service

service sshd restart
查看更多
登录 后发表回答