0

I changed the Port in sshd_config file and restart the service (Using Linux Debian 8). Logged out from SSH (Putty) and I tried to login later but I can't connect through Putty anymore.. I tried to login by FTP with FileZilla and that still works..

What is the problem?

1
  • 1
    You forgot: to open the port in the firewall and/or your password and to test things before things like this happen + FTP's port has nothing to do with SSH's
    – sysfiend
    Dec 19, 2016 at 11:57

1 Answer 1

4

I assume iptables are not running and blocking it. It could be SE Linux. Try running:

sestatus

If it is enabled, then run:

semanage port -l | grep ssh

And if the output says tcp 22

then run the following to add the new port (e.g. 2222)

semanage port -a -t ssh_port_t -p tcp 2222

then finally run

semanage port -l | grep ssh

which should then show 22 and 2222

and then it should work. If not then look into iptables:

iptables -nvL

will give you a list of what you have

iptables -A INPUT -p tcp --dport 2222 -j ACCEPT

would add a rule allowing traffic into port 2222, but this may not help depending on what other rules are present.

If iptables doesn't fix it then it could be a firewall between you and the server.

3
  • He does not have access to the server, executing commands on it it's going to be hard
    – sysfiend
    Dec 19, 2016 at 12:03
  • 2
    he might have console access. I am hoping he does and helping on that basis. If not, then when he speaks to his provider and somehow gets the access back, then my answer should be useful if he wants to try again.
    – bao7uo
    Dec 19, 2016 at 12:10
  • 1
    Most Debian users never enable SELinux. Dec 19, 2016 at 18:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .