I have an ubuntu Server in Digitalocean. Normally, I can connect this machine with SSH but while I'm connected to my school network, when I wrote ssh root@IP , it freezes and never even ask my password. I tried it from another computers which connected to some another network, it works. Moreover, I can connect other servers with same configuration. How I can detect ,if it causes because of my Internet connection and how I can solve this problem ?

Edit: I tried to connect server with ssh root@IP -vvv and it returned me this

OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to IP [IP] port 22.
debug1: connect to address IP port 22: Operation timed out
ssh: connect to host IP port 22: Operation timed out
  • welcome to the Unix Stackexchange! Glad you made it here, I'm sure you'll get lots of great answers! May 17, 2016 at 23:54

2 Answers 2

ssh: connect to host IP port 22: Operation timed out

This message is indicating that the secure shell client is not able to establish a connection to the server to which you are attempting to connect. As you mention this only happens from within a school network (and that you are able to connect from elsewhere), it's exceedingly likely that the campus network administrator has decided for whatever reason not to allow outbound secure shell connections, or has blocked traffic directed to the hosting provider where your server happens to be.

As an aside, it's exceedingly bad practice to have the root account accessible for remote logins of any kind. I'd strongly urge you to disallow that in your secure shell daemon configuration, and log in as a regular user, from which you can use su or sudo when you specifically need superuser privileges.


Outcoing connections to port 22 seems to be blocked in your school network. You can try to make your ssh server to listen some other port where you don't have any services listening on like e.g. 443 which might not be blocked.

Just add..

Port <alternative_portnumber>

..to/etc/ssh/sshd_config in your server and restart ssh service. Then try again inside your school network.

Of course if you have good reason to connect your server from school you can try to talk to your school's network admin about it.

You must log in to answer this question.

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