Regn0
Posts: 10
Joined: Mon Apr 13, 2015 12:52 pm

[SOLVED]Strange SSH problem

Mon Apr 13, 2015 12:54 pm

Hey there,

I just installed Raspbian on my Raspberry Pi and really want to get SSH working. I already forwarded port 22 in my router and gave the pi a static IP.

Whenever I SSH the pi via its local IP on either Windows or Linux I get a connection and I can start using SSH.
The problems start at using SSH from outside my home network. I can't get connected on my linux laptop via SSH when I'm at university. I simply get an error which tells me the connection timed out.

The even stranger thing is: When my classmate connects to my pi via SSH in either his Windows or Linux system it works... When other classmates try to SSH they get the same problem as I do.
So I thought the problem might be in my SSH settings on my laptop. But when I try to SSH into my classmates ArchLinux server I simply connect.

I have no idea what the problem could be, since the SSH server(my pi) seems to work for one of my classmates, which tells me the portforwarding etc works. It can't really be the client side(my laptop) since I can SSH into my classmates ArchLinux server.

Does anyone has tips or needs config files to see what's wrong?
Last edited by Regn0 on Mon Apr 13, 2015 8:02 pm, edited 1 time in total.

cpc464
Posts: 239
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: Strange SSH problem

Mon Apr 13, 2015 4:11 pm

Sorry Regan0 I don't know why some people can connect and others can't.

Just a warning though. Hackers are probably trying to guess your password right now. I would advise you to install SSH keys, using a very long passphrase, and take other security measures (an easy one is to run sshd on a high obscure port - simple but it filters out nearly all password guessing attacks).

Jim
Unix engineer since 1989

Regn0
Posts: 10
Joined: Mon Apr 13, 2015 12:52 pm

Re: Strange SSH problem

Mon Apr 13, 2015 4:33 pm

I know about that issue! I already put my sshd on another port. I also disabled the functionality to login as root, so no harm could be done. When I tail -f my /var/log/auth.log I dont see as many login attempts anymore as when sshd was on port 22.

This still doesn't fix the problem tho. Still thanks for the security heads up!

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Strange SSH problem

Mon Apr 13, 2015 5:45 pm

Educational networks are notorious for blocking stuff, may be something to consider.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Regn0
Posts: 10
Joined: Mon Apr 13, 2015 12:52 pm

Re: Strange SSH problem

Mon Apr 13, 2015 6:27 pm

It doesn't just only not work on my university's network. It doesn't work from anywhere...

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Strange SSH problem

Mon Apr 13, 2015 6:34 pm

Regn0 wrote:It doesn't just only not work on my university's network. It doesn't work from anywhere...
So one of us - at least - is confused!

I thought you had said:
When my classmate connects to my pi via SSH in either his Windows or Linux system it works...
and
the SSH server(my pi) seems to work for one of my classmates, which tells me the portforwarding etc works.
So if you have two machines on the same network, one able to connect and one not, it is just a question of enough deliberate inspection of their configurations to work out what the difference is...

Are all your potential users entering the same target ip address and port combination?

Regn0
Posts: 10
Joined: Mon Apr 13, 2015 12:52 pm

Re: Strange SSH problem

Mon Apr 13, 2015 8:01 pm

For some reason the problem solved itself. For the first time in like 2 years I've gotten a new IP from my ISP. And since I got that new IP the ssh works from all systems I use/own. I haven't changed anything in my ssh settings on both my client and server. I think it had something to do with my ISP, since it started working after I got a new IP.

cpc464
Posts: 239
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: [SOLVED]Strange SSH problem

Tue Apr 14, 2015 3:26 pm

Interesting. Sometimes places block outgoing SSH altogether, and sometimes they block high port numbers too. My workplace blocks both. So I can't ssh into my home server from work, but I can from anywhere else (friends houses, coffee shops...)
Unix engineer since 1989

Return to “Troubleshooting”