1

I update my :

  • /etc/ssh/sshd_config, update port from 22 to 558
  • /etc/fail2ban/jail.local, update port from 22 to 558
  • add a new record in iptables

    iptables -A INPUT -p tcp -m multiport --dports 558 -j fail2ban-ssh

I restarted all 3 services

As you can see, I checked if I did connectly :

iptables -L  --line-numbers | grep 558
cat /etc/fail2ban/jail.local | grep 558
cat /etc/ssh/sshd_config | grep 558

I seem to did it

enter image description here

I also check

netstat -tnpl , I see 558 there.

tcp 0 0 0.0.0.0:558 0.0.0.0:* LISTEN 21015/sshd

Why I still can't SSH into my VM with a port 558 ?

I kept getting

enter image description here

Any suggestions?


5
  • What happens when you try to ssh into the VM? What host are you doing it from? What error message do you get? – Kenster Jan 5 '20 at 16:25
  • @Kenster I added what I see. It stuck like that repeat. – cyb3rZ Jan 5 '20 at 17:03
  • 1
    You seem to have appended the iptables rule to the INPUT chain. Do you have a default "drop everything" rule in the chain before it? – Bass Jan 5 '20 at 21:37
  • Yes. Is the order of rules matters ? I think I have the drop rules before it. – cyb3rZ Jan 6 '20 at 0:34
  • Sure, only the first rule in the chain that matches will matter. That's why the "drop everything" rule is always the last one. – Bass Jan 6 '20 at 2:29
1

The most frequent occurrence of this for me is firewall issue.

  • check outbound ports from your work station (router)
  • does your server have limited port access?
  • if you white listed your IP address check to see if your ip address has changed
3
  • try to ping the box you are looking to access [ping theUpAddress] – Nelles Jan 5 '20 at 16:51
  • Please share command to check outbound ports from your work station (router) ? – cyb3rZ Jan 5 '20 at 17:03
  • does your server have limited port access? - how do I check that ? – cyb3rZ Jan 5 '20 at 17:04

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.