Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

SSH not working

Mon Sep 03, 2012 6:30 pm

Hi. FINALLY got my ethernet working after heaps of help from the troubleshooting forum - thanks guys!

So I thought this was the end of my Pi set up woes. Alas not. I checked my "Attached Devices" page on my router and the Pi has been assigned the ip of "192.168.0.3".

So I loaded up putty, entered that IP and got the error

"Network error: Software caused connection abort"

so then I tried the same IP in WinSCP, using username: "pi" and pw: "raspberry" and I got the exact same error.


Next I plugged the Pi DIRECTLY into my laptop via ethernet. I did the exact same as the above, but this time got the error (in both putty and winscp):

"Network error: connection refused"


This would suggest that SSH is not running. I tried SSHing using Raspbian and Raspbmc, both of which have SSH enabled by default.

My FDX light is solid green. My LINK light is green, flashing frequently but in no pattern. My 10M light is stable yellow.

Any ideas on a fix?

Thanks!

drgeoff
Posts: 8363
Joined: Wed Jan 25, 2012 6:39 pm

Re: SSH not working

Mon Sep 03, 2012 6:37 pm

1. Why is ethernet working now? What has changed?

2. Can you ping the RPi from your PC?

Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

Re: SSH not working

Mon Sep 03, 2012 7:23 pm

drgeoff wrote:1. Why is ethernet working now? What has changed?

2. Can you ping the RPi from your PC?
1) I ordered yet another power supply from eBay. According to my multimeter, it delivers same voltage as my last 2 power supplies (4.9V ish), except this new one decides to give me ethernet lights (seeming ethernet connectivity), but perhaps even this one didn't go the full way to enabling SSH. It's really stupid. Each new power supply I get seems to fix one thing, but not everything. I also feel like an idiot for leading everyone on a wild goose chase, with suggestions that maybe my Crystal was bad, or oscillation and other complicated stuff. Sorry.

2) I've been using a program called "Ping" to identify my Pi's IP when connected to my laptop. When I connect it directly to my laptop, I seem to get a ping for something like 169.254.x.x (can't remember exactly). When connected to my router, it doesshow the address shown in my router's set up page, 192.168.0.3 or 192.168.0.5.

With the Pi connected to my router, I pinged 192.168.0.5 in the command line and I got a response. I then tried plugging the Pi directly into my laptop. The Pi's LEDs did light up. I pinged the 169.254.x.x I had and I got a response. The gigabit adapter only shows up in the program "Ping" when the Pi is connected. Since I'm on a wireless connection, it's my wireless card that shows up when I'm looking for IPs from the router.

I've tried doing "ssh [email protected]" in command line (not Putty) but apparently "SSH isnt a valid internal or external command...".

So the Pi seems to connect. I just can't SSH into it...

Perhaps I need to change my SSH keys or something?

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: SSH not working

Mon Sep 03, 2012 8:39 pm

Perhaps sshd is not running?

From the console, what does the output of ps -ef say when you are root?
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

broo0ose
Posts: 316
Joined: Wed Dec 14, 2011 3:59 pm
Location: Wirral, UK

Re: SSH not working

Mon Sep 03, 2012 8:50 pm

Are you using the latest Raspbian “wheezy” image.

I know some of the older Debian images did not have SSH turned on by default.

Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

Re: SSH not working

Mon Sep 03, 2012 8:51 pm

Dweeber wrote:Perhaps sshd is not running?

From the console, what does the output of ps -ef say when you are root?
Sorry I'm a noob. So do I login to my pi and type "ps -ef" ? Or do I do this on my pc?

Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

Re: SSH not working

Mon Sep 03, 2012 8:56 pm

broo0ose wrote:Are you using the latest Raspbian “wheezy” image.

I know some of the older Debian images did not have SSH turned on by default.

Yeah and I get the same errors with raspbmc (also runs ssh as default)

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: SSH not working

Mon Sep 03, 2012 9:06 pm

Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: SSH not working

Mon Sep 03, 2012 9:07 pm

Alesbi wrote:
Dweeber wrote:Perhaps sshd is not running?

From the console, what does the output of ps -ef say when you are root?
Sorry I'm a noob. So do I login to my pi and type "ps -ef" ? Or do I do this on my pc?
Log into the RPi...
then issue the command

Code: Select all

sudo ps -ef
However....
Alesbi wrote:Yeah and I get the same errors with raspbmc (also runs ssh as default)
If it wasn't running, you would be getting Connection Refused.

This would seem to indicate the problem is with your workstation (Windows) or the network connection to the RPi.

Can you use some other device to SSH to it with?
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

broo0ose
Posts: 316
Joined: Wed Dec 14, 2011 3:59 pm
Location: Wirral, UK

Re: SSH not working

Mon Sep 03, 2012 9:26 pm

Dweeber wrote: However....
Alesbi wrote:Yeah and I get the same errors with raspbmc (also runs ssh as default)
If it wasn't running, you would be getting Connection Refused.

This would seem to indicate the problem is with your workstation (Windows) or the network connection to the RPi.

Can you use some other device to SSH to it with?
Good point ..

try this from Windows

Code: Select all

telnet 192.168.0.3 22
if you get a black screen with an SSH message on it then SSH is definitely running on the pi.

Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

Re: SSH not working

Mon Sep 03, 2012 9:33 pm

I've read most official guides/tutorials. And I did look at your link. I don't want to sound ungrateful for your help, but as my topic says (I realise it is a bit of a long read), it's not that I don't KNOW how to SSH into my Pi, it's that I CAN'T. Therefore that link doesn't really help. If you don't mind re-reading the topic, perhaps you have a different suggestion that will contribute towards fixing my problem.

--------------------------------------------
@Dweeber

You say the following:
Dweeber wrote:However....
Alesbi wrote:Yeah and I get the same errors with raspbmc (also runs ssh as default)
If it wasn't running, you would be getting Connection Refused.
Do you mean: "If it wasn't running, you **WOULDN'T** be getting Connection Refused" ? or is what you wrote there what you intended? The reason I ask, is I HAVE been getting "Connection Refused" with both images, so I'm just a bit confused on that...

I've tried SSHing into the Pi using my family PC as well (my laptop is my primary workstation) and that gave me Connection Refused aswell. I have SSH'd into my Iphone previously, so I don't think the SSH on the laptop is "broken".

I will run that command tomorrow when I get my USB->PS/2 adapter (yeah, my USB keyboard doesn't work) so I can use my family PC's keyboard to enter the command.

--------------------------------

BTW, does anyone think my problem might have something to do with SSH keys? I've heard terms like that being thrown around sometimes...

Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

Re: SSH not working

Mon Sep 03, 2012 9:42 pm

broo0ose wrote:
Dweeber wrote: However....
Alesbi wrote:Yeah and I get the same errors with raspbmc (also runs ssh as default)
If it wasn't running, you would be getting Connection Refused.

This would seem to indicate the problem is with your workstation (Windows) or the network connection to the RPi.

Can you use some other device to SSH to it with?
Good point ..

try this from Windows

Code: Select all

telnet 192.168.0.3 22
if you get a black screen with an SSH message on it then SSH is definitely running on the pi.
(The router gave the Pi the IP 192.168.0.5 in this case, which is what it normally is)

I tried SSHing again, then I tried telnet. They both give essentially the same error.

This commands gave me the following error:

Image
if the above image is too small, click here: http://i.imgur.com/n2wt4.png

(Alex is the name of my PC. Hi!)

EDIT: "Looked around since this problem obviously seems to be with my PC. I enabled Telnet, but I don't think SSH is enable-able in Windows 7 directly. Anyway, ran the telnet command again and got this:

Image
if the above image is too small, click here: http://i.imgur.com/5hazm.png


so it seems SSH is running, amirite?
Last edited by Alesbi on Mon Sep 03, 2012 9:52 pm, edited 1 time in total.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: SSH not working

Mon Sep 03, 2012 9:48 pm

Re: Running those commands in DOS/Windows (from CMD.EXE prompt):

'ssh' is not normally installed as a command line tool in DOS/Windows, so it is not surprising that that failed. But 'telnet' should definitely have worked ("worked" at least in the sense of found and ran the executable, rather than giving a "not found" error message). Are you sure you're using Windows?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

W. H. Heydt
Posts: 8656
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: SSH not working

Mon Sep 03, 2012 9:51 pm

Alesbi wrote:[
2) I've been using a program called "Ping" to identify my Pi's IP when connected to my laptop. When I connect it directly to my laptop, I seem to get a ping for something like 169.254.x.x (can't remember exactly). When connected to my router, it doesshow the address shown in my router's set up page, 192.168.0.3 or 192.168.0.5.
Any time you get an IP address starting "169..." it means that the device hasn't had it's IP address configured. If you are connected directly to your laptop, that just means (no surprise!) that your laptop isn't running a DHCP server, so when the Pi asks for an IP address...none is supplied.

Also, when connecting to the laptop...what kind of cable are you using? It is very likely that you need a "crossover" cable, because both devices you're connecting together both the same sort of device (kind of like hooking up two modems back to back) and they need a cable takes the output from one device to the input to the other, and not connecting output to output and input to input.

Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

Re: SSH not working

Mon Sep 03, 2012 9:54 pm

Joe Schmoe wrote:Re: Running those commands in DOS/Windows (from CMD.EXE prompt):

'ssh' is not normally installed as a command line tool in DOS/Windows, so it is not surprising that that failed. But 'telnet' should definitely have worked ("worked" at least in the sense of found and ran the executable, rather than giving a "not found" error message). Are you sure you're using Windows?
Yeah, was my bad as regards to telnet. Telnet isnt installed by default in windows so just had to fix that. Now I get this response in command prompt:

Image
(larger picture: http://i.imgur.com/5hazm.png)

W. H. Heydt wrote:
Alesbi wrote:[
2) I've been using a program called "Ping" to identify my Pi's IP when connected to my laptop. When I connect it directly to my laptop, I seem to get a ping for something like 169.254.x.x (can't remember exactly). When connected to my router, it doesshow the address shown in my router's set up page, 192.168.0.3 or 192.168.0.5.
Any time you get an IP address starting "169..." it means that the device hasn't had it's IP address configured. If you are connected directly to your laptop, that just means (no surprise!) that your laptop isn't running a DHCP server, so when the Pi asks for an IP address...none is supplied.

Also, when connecting to the laptop...what kind of cable are you using? It is very likely that you need a "crossover" cable, because both devices you're connecting together both the same sort of device (kind of like hooking up two modems back to back) and they need a cable takes the output from one device to the input to the other, and not connecting output to output and input to input.
This makes very good sense. Thank you for clearing up something i've wondered for ages (not just as regards to the Pi, but all computers). Any idea where I can get my mitts on a crossover cable, if I need one?

W. H. Heydt
Posts: 8656
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: SSH not working

Mon Sep 03, 2012 10:01 pm

Alesbi wrote: (The router gave the Pi the IP 192.168.0.5 in this case, which is what it normally is)

I tried SSHing again, then I tried telnet. They both give essentially the same error.

This commands gave me the following error:

Image
if the above image is too small, click here: http://i.imgur.com/n2wt4.png

(Alex is the name of my PC. Hi!)
"Ssh" is a protocol. On Linux, the ssh protocol is supported by a program called..ssh. Same thing with telnet. The message show that your PC does not have programs called "ssh" or "telnet". This is not surprising.

Probably the easiest way to fix this part of the issue is to go out on the web with your PC and get a copy of PuTTY, which is a "terminal emulator" program that can use the ssh protocol. It's free, by the way. While you're getting PuTTY, you should also get pscp, which does the same sort of things that ftp (file transfer protocol) does only using a secured shell (ssh) connection.

In PuTTY, enter the IP address in the "Host name (or IP address)" box, select "ssh" (this will default the port to 22). Initially, that's all you need and you can click the "Open" button. You should get a screen with a login prompt.

You can also give your setup a name and save it (so you don't have to enter the parameters next time). You can change a whole bunch of things to suit yourself, like color choices, fonts and font sizes, keyboard behavior (what do you want function keys to send?) and so on. It's all in the tree menu on the left.

Hope that helps...

itimpi
Posts: 1081
Joined: Sun Sep 25, 2011 11:44 am
Location: Potters Bar, United Kingdom
Contact: Website

Re: SSH not working

Mon Sep 03, 2012 10:06 pm

Alesbi wrote: This makes very good sense. Thank you for clearing up something i've wondered for ages (not just as regards to the Pi, but all computers). Any idea where I can get my mitts on a crossover cable, if I need one?
You do not need a cross-over cable with the Pi. The Ethernet port (like on most modern machines) auto-senses whether it needs to work in straight-through or crossover mode.

BTW: That screenshot you showed where it displayed an SSL message shows that ssh IS running on the Pi. Using Putty should get you connected using a ssh session.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: SSH not working

Mon Sep 03, 2012 10:17 pm

In what strange, bizarre version of Windows, is "telnet" not installed by default?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

Re: SSH not working

Mon Sep 03, 2012 10:33 pm

W. H. Heydt wrote: Probably the easiest way to fix this part of the issue is to go out on the web with your PC and get a copy of PuTTY, which is a "terminal emulator" program that can use the ssh protocol. It's free, by the way. While you're getting PuTTY, you should also get pscp, which does the same sort of things that ftp (file transfer protocol) does only using a secured shell (ssh) connection.

In PuTTY, enter the IP address in the "Host name (or IP address)" box, select "ssh" (this will default the port to 22). Initially, that's all you need and you can click the "Open" button. You should get a screen with a login prompt.

You can also give your setup a name and save it (so you don't have to enter the parameters next time). You can change a whole bunch of things to suit yourself, like color choices, fonts and font sizes, keyboard behavior (what do you want function keys to send?) and so on. It's all in the tree menu on the left.

Hope that helps...
I've got Putty. Done all this, but get the errors in the original post. I KNOW how to SSH, I just CAN'T.
------------------------------------------------------------------------------------
itimpi wrote:
Alesbi wrote: This makes very good sense. Thank you for clearing up something i've wondered for ages (not just as regards to the Pi, but all computers). Any idea where I can get my mitts on a crossover cable, if I need one?
You do not need a cross-over cable with the Pi. The Ethernet port (like on most modern machines) auto-senses whether it needs to work in straight-through or crossover mode.

BTW: That screenshot you showed where it displayed an SSL message shows that ssh IS running on the Pi. Using Putty should get you connected using a ssh session.
If I don't need the crossover, how come I still got that 619.xx.xx.xx IP (which means the Pi doesn't have an IP, right?)

But putty just doesn't work! I'll post screenies of my errors
---------------------------------------------------------------------------------------------------------------------
Joe Schmoe wrote:In what strange, bizarre version of Windows, is "telnet" not installed by default?
Windows 7 :D (and maybe vista, dunno)

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: SSH not working

Mon Sep 03, 2012 10:46 pm

Windows 7

This may sound stupid on my part you are running Putty as administrator?
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

Re: SSH not working

Mon Sep 03, 2012 10:50 pm

Jim JKla wrote:Windows 7

This may sound stupid on my part you are running Putty as administrator?
Yeah, it asks me for admin privelleges at startup.

Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

Re: SSH not working

Mon Sep 03, 2012 10:51 pm

I made a bunch of screenshots showing my thought process. The Pi is connected to my router. Putty is running as admin.

---------------------------------------------------------------------------------------------------------------------------------
1) Let's find my Pi's IP from my router's page.

Image

2) My Pi's IP is 192.168.0.5. Next I'm going to telnet it to check SSH is working.

Image

3) I get an OpenSSH response. It seems SSH is working.

Image

4) Now I'm going to try using SSH in command line. Let's see if this works. Oh no! It didn't work because SSH isn't installed on Windows systems.

Image

5) Don't worry though, I can try an SSH client, like Putty:

Image

6) Oh no, I got an error!

Image

7) After fiddling around, I now sometimes get a different error!

Image

Both these errors still come up. I'm not sure which set up causes each (eg. If I plug Pi into router or directly into laptop, idk what causes each one as opposed to the other). The first error (Software caused connection abort) seems to occur more often than the second one (connection refused).

Oh crikey! I'm stuck, I better ask the guys on RaspberryPi.org forums!
---------------------------------------------------------------------------------------------------------------------------------

And here we are today :D


(see full picture album + bigger pictures at http://imgur.com/a/t78wl)
Last edited by Alesbi on Mon Sep 03, 2012 11:09 pm, edited 2 times in total.

drgeoff
Posts: 8363
Joined: Wed Jan 25, 2012 6:39 pm

Re: SSH not working

Mon Sep 03, 2012 11:04 pm

Alesbi, you are not going to get anywhere easily with the RPi plugged into a PC. Keep the RPi plugged into your router.

I can ssh into my RPi (Raspian Wheezy hard float) but when I try to telnet to it I get

"telnet: can't connect to remote host (192.168.1.70): Connection refused".

which is not what you are seeing.

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: SSH not working

Mon Sep 03, 2012 11:06 pm

Connection refused does look like it's blocking you.

I am concerned when you say
Yeah, it asks me for admin privelleges at startup.
Because to run a program as administrator you right click and change the settings for the programm it does not usually ask you at startup.

Connection refused is a message you would receive if Putty was Not running as admin. Because the admin blocks the communication and this would be the same for telnet. ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

Alesbi
Posts: 109
Joined: Wed Aug 22, 2012 3:18 pm

Re: SSH not working

Mon Sep 03, 2012 11:07 pm

drgeoff wrote:Alesbi, you are not going to get anywhere easily with the RPi plugged into a PC. Keep the RPi plugged into your router.

I can ssh into my RPi (Raspian Wheezy hard float) but when I try to telnet to it I get

"telnet: can't connect to remote host (192.168.1.70): Connection refused".

which is not what you are seeing.
Ok, i'll leave it plugged into my router. In the above pictures, it is plugged into my router.

And that's odd you got a different response. Is your response the correct one? Mine looks like it makes sense, because it says something about Open SSH and Debian...

Jim JKla wrote:Connection refused does look like it's blocking you.

I am concerned when you say
Yeah, it asks me for admin privelleges at startup.
Because to run a program as administrator you right click and change the settings for the programm it does not usually ask you at startup.

Connection refused is a message you would receive if Putty was Not running as admin. Because the admin blocks the communication and this would be the same for telnet. ;)
I've set it to run as admin on start up automatically. Besides, it seems that the Pi is closing the connection, rather than the PC.

Return to “Troubleshooting”

Who is online

Users browsing this forum: Google [Bot] and 31 guests