gastonkilo
Posts: 14
Joined: Fri May 30, 2014 7:01 pm

SSH Connection refused

Mon Oct 20, 2014 8:05 pm

Hi all,

I'm the happy owner of a raspberry pi with raspbmc on it for a year know and so far so good...
Lately I wanted to copy some files so I ssh like I used to do from my Mac terminal using

Code: Select all

ssh pi@192.168.0.XX
with the correct IP (IP is fixed on my dhcp router).
Surprisingly enough, I got a connection refused on port 22 !

My constraints :
I have no keyboard / mouse attached to my pi.
I have only a laptop to connect to it.
I have raspbmc (13.2 stable) install on it.
I cannot read the sd card (although I've try with a software that should enable my mac to read ext3 partition)

I can use the raspbmc extension to check the settings.
It says that ssh is on and firewall is off.
My mac firewall is off.
I can connect to my raspberry web interface with my browser as well as software runinng on it that have a web interface...

I know you cannot give me the magic answer, I'm more looking for ideas to troubleshoot...

Thanks a lot to anyone who take the time for me.
Much appreciated :)
Ben

User avatar
default_user8
Posts: 680
Joined: Mon Nov 18, 2013 3:11 am

Re: SSH Connection refused

Mon Oct 20, 2014 9:14 pm

Are you using keys or passwords to log in? Maybe your key was deleted, are you logging into the right account? Maybe root login has been disabled.
Two heads are better than one, unless one's a goat head.

gastonkilo
Posts: 14
Joined: Fri May 30, 2014 7:01 pm

Re: SSH Connection refused

Mon Oct 20, 2014 9:18 pm

I'm using the pi user with password.
So I assume it has not been deleted, also all my software (transmission, sickbeard, etc...) are running with it and they run fine.
Just in case, on my mac, I've deleted my known hosts but it doesn't even asks me to add the key it just refuse...

User avatar
default_user8
Posts: 680
Joined: Mon Nov 18, 2013 3:11 am

Re: SSH Connection refused

Mon Oct 20, 2014 10:49 pm

And you can successfully ping your raspi?
Two heads are better than one, unless one's a goat head.

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: SSH Connection refused

Mon Oct 20, 2014 11:04 pm

A while ago there was a problem with ssh on Raspbmc being restricted to ipv6. I'm not sure if that was automatically changed / solved in later updates.
Can you can check the contents of '/etc/xinetd.d/ssh'. Could be problematic without keyboard or ssh access...

Gr.
Dirk.

gastonkilo
Posts: 14
Joined: Fri May 30, 2014 7:01 pm

Re: SSH Connection refused

Tue Oct 21, 2014 9:41 am

I'm not on IPV6 on my local network.
But I can try checking the file using XBMC gui.

Nolaan
Posts: 57
Joined: Thu Jul 10, 2014 6:35 pm
Contact: Website

Re: SSH Connection refused

Tue Oct 21, 2014 9:44 am

Hi,
I would suggest 2 problems :

1) Is sshd started?
service ssh start

2) If it doesnt work, could you post the output of :
ssh -vvv pi@192.168...
http://www.jetsonblog.com
twitter : @nolaan_boy

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: SSH Connection refused

Tue Oct 21, 2014 9:47 am

so you have xbmc on the raspberry - I dont think that uses the user pi
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: SSH Connection refused

Tue Oct 21, 2014 9:49 am

RaTTuS wrote:so you have xbmc on the raspberry - I dont think that uses the user pi

You're wrong ;)
Raspbmc does use 'pi'

Nolaan
Posts: 57
Joined: Thu Jul 10, 2014 6:35 pm
Contact: Website

Re: SSH Connection refused

Tue Oct 21, 2014 9:55 am

I just thought about a 3rd way
if you have nmap installed on your mac can you do an : nmap -sn 192.168.0.0/24

You should be able to see all devices actually having a IP address assigned. If you don't see "Raspberry Pi" it simply means that it's not connected to the network.
http://www.jetsonblog.com
twitter : @nolaan_boy

gastonkilo
Posts: 14
Joined: Fri May 30, 2014 7:01 pm

Re: SSH Connection refused

Tue Oct 21, 2014 9:57 am

Thanks !
But it is connected has it download file to the internet and I can connect to it on port 80 through web browser :)

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: SSH Connection refused

Tue Oct 21, 2014 9:59 am

Nolaan wrote:I just thought about a 3rd way
if you have nmap installed on your mac can you do an : nmap -sn 192.168.0.0/24

You should be able to see all devices actually having a IP address assigned. If you don't see "Raspberry Pi" it simply means that it's not connected to the network.
Please read the OPs first post. The Pi is connected and working. He just cannot connect with SSH...

gastonkilo
Posts: 14
Joined: Fri May 30, 2014 7:01 pm

Re: SSH Connection refused

Tue Oct 21, 2014 10:01 am

DirkS wrote:A while ago there was a problem with ssh on Raspbmc being restricted to ipv6. I'm not sure if that was automatically changed / solved in later updates.
Can you can check the contents of '/etc/xinetd.d/ssh'. Could be problematic without keyboard or ssh access...

Gr.
Dirk.
I can try with xbmc gui.

gastonkilo
Posts: 14
Joined: Fri May 30, 2014 7:01 pm

Re: SSH Connection refused

Tue Oct 21, 2014 10:02 am

Nolaan wrote:Hi,
I would suggest 2 problems :

1) Is sshd started?
service ssh start

2) If it doesnt work, could you post the output of :
ssh -vvv pi@192.168...
I cannot do a service ssh start without keyboard and without... ssh :)

For the second thanks, i'll try as soon as I'm back home :)

Nolaan
Posts: 57
Joined: Thu Jul 10, 2014 6:35 pm
Contact: Website

Re: SSH Connection refused

Tue Oct 21, 2014 10:43 am

DirkS wrote:
Nolaan wrote:I just thought about a 3rd way
if you have nmap installed on your mac can you do an : nmap -sn 192.168.0.0/24

You should be able to see all devices actually having a IP address assigned. If you don't see "Raspberry Pi" it simply means that it's not connected to the network.
Please read the OPs first post. The Pi is connected and working. He just cannot connect with SSH...
Yeah yeah, it's just to be sure that we're talking the same language...

Then you could nmap --open 192.168.0.X , with the rpi address. If the port is closed, then I would recommend you to find a way to read its SD card.
http://www.jetsonblog.com
twitter : @nolaan_boy

gastonkilo
Posts: 14
Joined: Fri May 30, 2014 7:01 pm

Re: SSH Connection refused

Tue Oct 21, 2014 11:15 am

Ok thanks I'm going to do that ! :)

gastonkilo
Posts: 14
Joined: Fri May 30, 2014 7:01 pm

Re: SSH Connection refused

Thu Oct 23, 2014 9:11 am

Nolaan wrote:
Then you could nmap --open 192.168.0.X , with the rpi address. If the port is closed, then I would recommend you to find a way to read its SD card.
Hi,

Result of the nmap :
Starting Nmap 6.47 ( http://nmap.org ) at 2014-10-23 11:10 CEST
Nmap scan report for 192.168.0.14
Host is up (0.019s latency).
Not shown: 991 closed ports
PORT STATE SERVICE
1044/tcp open dcutility
1503/tcp open imtc-mcs
5050/tcp open mmcc
5900/tcp open vnc
8080/tcp open http-proxy
8081/tcp open blackice-icecap
8181/tcp open unknown
9090/tcp open zeus-admin
9091/tcp open xmltec-xmlmail

Nmap done: 1 IP address (1 host up) scanned in 0.61 seconds
Any lead ?

Jeremy Davis
Posts: 43
Joined: Tue Oct 21, 2014 12:55 am

Re: SSH Connection refused

Thu Oct 23, 2014 9:46 am

SSH uses port 22 so your nmap results suggest that perhaps SSH server not running...

gastonkilo
Posts: 14
Joined: Fri May 30, 2014 7:01 pm

Re: SSH Connection refused

Thu Oct 23, 2014 9:48 am

Yep. But when looking at my settings using xbmc setting add-on it's says it's on...
:(

Thanks a lot :)

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

Re: SSH Connection refused

Thu Oct 23, 2014 10:39 am

If the GUI on the host says the service is running but an nmap scan does not find it then I would suspect one of the following possibilities:

. you have scanned the wrong host (Have you checked the network mac address associated with that IP address?)

. the service on the RPi has become hung/wedged/confused (Have you tried rebooting the RPi?)

I admit I have never run or scanned an RPi running xbmc software, so can anyone who has confirm that the list of open ports is what would normally be seen?

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: SSH Connection refused

Thu Oct 23, 2014 11:06 am

B.Goode wrote:I admit I have never run or scanned an RPi running xbmc software, so can anyone who has confirm that the list of open ports is what would normally be seen?
Yes, my raspbmc shows some of the same ports open (zeus-admin for example).

Gr.
Dirk.

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: SSH Connection refused

Thu Oct 23, 2014 11:09 am

gastonkilo wrote:Result of the nmap :
Starting Nmap 6.47 ( http://nmap.org ) at 2014-10-23 11:10 CEST
Nmap scan report for 192.168.0.14
Host is up (0.019s latency).
Not shown: 991 closed ports
PORT STATE SERVICE
1044/tcp open dcutility
1503/tcp open imtc-mcs
5050/tcp open mmcc
5900/tcp open vnc
8080/tcp open http-proxy
8081/tcp open blackice-icecap
8181/tcp open unknown
9090/tcp open zeus-admin
9091/tcp open xmltec-xmlmail

Nmap done: 1 IP address (1 host up) scanned in 0.61 seconds
Any lead ?
I see that vnc port (5900) is open. Have you tried using that for logging into your Pi?

Gr.
Dirk.

gastonkilo
Posts: 14
Joined: Fri May 30, 2014 7:01 pm

Re: SSH Connection refused

Thu Oct 23, 2014 12:58 pm

It's logging me to the xbmc GUI which I can already access so not helpful :(

Thanks

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: SSH Connection refused

Thu Oct 23, 2014 1:14 pm

Well... I would say it's time to plug in a USB keyboard.

gastonkilo
Posts: 14
Joined: Fri May 30, 2014 7:01 pm

Re: SSH Connection refused

Thu Oct 23, 2014 1:16 pm

Yes, I'll see if I can borrow one at work or something...

Do you a key that can prevent xbmc to load at startup by any chance ?

Return to “Troubleshooting”