• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved [Solved] sshd operation timed out

uzsolt

Well-Known Member

Thanks: 46
Messages: 251

#1
I have a problem with sshd: when I try to connect to my VPS, it displays the following:
Code:
$ ssh -vv vps
OpenSSH_6.4, OpenSSL 1.0.1e-freebsd 11 Feb 2013
debug1: Reading configuration data /home/zsolt/.ssh/config
debug1: /home/zsolt/.ssh/config line 51: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to vps [CORRECT_IP] port 22.
debug1: connect to address CORRECT_IP port 22: Operation timed out
ssh: connect to host vps port 22: Operation timed out
The ssh worked yesterday well and as I remember I didn't make any change. From my laptop I can ssh to another machines (on the local network and on the internet too).
But when I log in my VPS (via vncviewer) I can ssh localhost.

Where is the problem and what is the solution?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,508
Messages: 25,692

#2
Re: sshd operation timed out

This looks like a firewall issue. Traffic to/from localhost is usually always allowed, that's probably why ssh localhost works.
 

uzsolt

Well-Known Member

Thanks: 46
Messages: 251

#3
Re: sshd operation timed out

Understand. But after service ipfw stop can't ssh either. Or ipfw stop is not enough? What should I do? (I'm a beginner with network issues)
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,508
Messages: 25,692

#4
Re: sshd operation timed out

That should work, unless you're actually using PF instead of IPFW.
 

uzsolt

Well-Known Member

Thanks: 46
Messages: 251

#5
Re: sshd operation timed out

Hm. I think I'm using IPFW ( service stop pf displays a message about set pf_enable to YES in /etc/rc.conf - and service pf onestop: "pfctl: /dev/pf: No such file or directory"). So stopped IPFW but I can't ssh.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,508
Messages: 25,692

#6
Re: sshd operation timed out

It's possible IPFW defaults to a "block all" rule, try setting sysctl net.inet.ip.fw.default_to_accept=1, that should set the default to "allow all".
 

uzsolt

Well-Known Member

Thanks: 46
Messages: 251

#7
Re: sshd operation timed out

SirDice said:
It's possible IPFW defaults to a "block all" rule, try setting sysctl net.inet.ip.fw.default_to_accept=1, that should set the default to "allow all".
Ah, it worked! Thanks!