问题
I installed Centos7, all fine, till I want to access via SSH, I get always Access Denied.
- I get it with the root user, and another new created user
- I tested SSH within the LAN, so no firewall issue
- For the root user "PermitRootLogin yes" is set.
- 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:
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
来源:https://stackoverflow.com/questions/26649712/centos-7-remote-ssh-access-denied