When I'm connected to my school network, I am able to ssh into my desktop computer at home just fine from my laptop. But when I'm home, trying to ssh into the same desktop from the same laptop always gives me time out error:
ssh: connect to host <my IP address> port 22: Connection timed out
I enabled port forwarding on port 22 in my router, installed openssh and everything is set up so that I'm able to ssh when I'm at school.
On my home desktop, the command
sudo netstat grep | grep sshd
tcp 0 0 0.0.0:22 0.0.0.0:* LISTEN sshd
I do not understand why this won't work outside my school network. Currently when I ssh into my home desktop computer from my laptop connected to my school network, I'm using the IP address of my desktop.
when I run
ssh -vv <myusername>@<my-ip-address>
OpenSSH_6.6.1, OpenSSL 1.01f 6 Jan 2014 debug1: Reading configuration data etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying for options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to <IP address> [<IP address>] port 22. debug1: connect to address <IP address> port 22: Connection timed out