Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an OpenVZ VPS server with Debian. I just setup IPTables to allow the SSH port rebooted it. (Also set the rules to auto load on startup). Now I can't login to the server! How to fix this?

Note : The SSH port is set to 325

Here are the rules :

    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination         
    ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:325 
    DROP       all  --  anywhere             anywhere            

    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination         

    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination  
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Well, looks like you didn't get that SSH allow rule in there correctly, did you?

At this point, you really only have two options:

  1. Employ your VPS provider's OOB console to sign into your VPS. This would bypass the network stack. The problem here is that not all VPS providers give you access to the actual console of your server.
  2. Boot some sort of recovery distro, mount your filesystem, and fix your iptables rules. Being that this is an OpenVZ "VPS", though, it's unlikely that this is even possible.

So - contact your provider. They may unfortunately be the only ones that can dig you out of this hole.

share|improve this answer
    
Unless by some weird chance you set your ssh server to run on port 325, in which case you could ssh in using the port option: ssh foobar.com -p 325 –  jpgeek Nov 8 '12 at 5:20
    
Yes, the SSH port is set to 325. But still can't login :( –  EApubs Nov 8 '12 at 6:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.