-1

I'm pulling my hair out over this and can't find a solution anywhere.

After a reboot I started getting "Connection refused" through port 22000 which was the one I had configured and SSH was still listening to(I double checked). I'm connecting from a PC on the same LAN.

I could connect to port 22 suddenly after that but there I got "Access denied" after entering my password. After troubleshooting this I got tired and reinstalled openssh, with that I got a clean config and everything including the firewall and selinux is now configured to use port 22 with these commands:

sudo semanage port -a -t ssh_port_t -p tcp 22
sudo firewall-cmd --permanent --zone=public --add-port=22/tcp
sudo firewall-cmd --reload

Still access denied even though it's the correct password, I know since I can use the exact same directly on the server.

I have tried:

  • Putting "PermitRootLogin yes" in the sshd_config and login with root but that is also denied, same with a new test account I made. I removed "AllowUsers [username]" from the config before this.

  • Restarted the SSH service and rebooted as well several times.

  • The solution here to no avail: Centos 7 Remote SSH access denied

  • Setting selinux to "Permissive"

  • Disabling the firewall
  • Changing password to one without special characters
  • Triple checking that the SSH service is running

Neither "/var/log/secure" nor "/var/log/messages" log anything regarding my attempts to login.

I must have missed something, anyone have any ideas what?

2 Answers2

1

use: ssh -vvv username@host to check the issue.

Try creating a pem file and see if it works.

ArnavRay
  • 321
  • 1
  • 9
  • So I tried `ssh -vvv username@host` from my router since it runs on linux and Puttys logs weren't helpful at all and.....it works...it just works.... Which mean the problem is between my PC and the server not SSH in general. Tried deleting all previously accepted hostkeys in Windows but that didn't help. – Erik Andersson Sep 05 '18 at 21:01
  • 1
    Glad to hear you have isolated the problem. This could be firewall issue on your windows system. Disable firewall and any antivirus running. This link has a similar problem. https://superuser.com/questions/748297/unable-to-connect-to-server-using-putty. Hope it helps. – ArnavRay Sep 05 '18 at 21:10
  • So it's not the firewall or AV, tried turning those off now. I also tried to SSH from another VM which also runs Win 10 and it works there too so it's definitely something with my PC, checked Wireshark but couldn't see anything funny. Host file is nothing but comments as well. Also tried another SSH client but it's the same there so putty is not to blame.... – Erik Andersson Sep 05 '18 at 21:41
0

I solved it and I really don't want to post the answer since it was embarrassingly easy, but I refuse to leave the question unsolved for the poor souls with similar problems.

I rebooted my PC.... facedesk