rp108
Posts: 9
Joined: Fri Jan 27, 2017 7:15 pm

Getting SSH working at new install

Fri Jan 27, 2017 7:36 pm

I have a RPi 2.
I have created boot image on 8 gig card, Raspbian Jessie, 1-11-2017.

RPi boots fine and I can ping the Pi (192.168.0.104) from my Win7 machine.

I have used Putty many times in the past, so I believe that I know how to connect, but I cannot connect. I get:
Network Error: Connection refused.

I am guessing that the SSH Server is not running by default in the Jessie distro.

So I figured that I cannot access headless initially, and therefore have to connect KB and Mon.
I purchased a HDMI to VGA adapter so that I could do this with a VGA monitor that I have, but I do not get any video.

Any help is much appreciated.
Any product suggestions on a HDMI-to-VGA adapter that actually works would be great, or alternately, a cheap HDMI monitor that works, is much appreciated.

My goal is to operate the Pi headless with Putty and Windows Remote Desktop (with xrdp server running on Pi).

Thanks,
rp108

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Getting SSH working at new install

Fri Jan 27, 2017 9:12 pm

A change was made a few months back to improve security by not enabling ssh by default. You can probably find the details on the blog if you're interested.

With a keyboard and screen you can use raspi-config to enable ssh. For a fully headless setup you can create a file called ssh on the boot (small fat partition), If the pi sees that file during bootup it'll enable ssh for you.

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

Re: Getting SSH working at new install

Fri Jan 27, 2017 10:03 pm

I am guessing that the SSH Server is not running by default in the Jessie distro
No guessing needed.

The Raspberry Pi blog, the Raspbian Release Notes, and discussion in these forums all confirm it.

With the most recent (Nov 2016) release of Raspbian SSH is no longer enabled by default.

https://www.raspberrypi.org/blog/a-secu ... ian-pixel/
http://downloads.raspberrypi.org/raspbi ... _notes.txt
viewtopic.php?f=66&t=166984

rp108
Posts: 9
Joined: Fri Jan 27, 2017 7:15 pm

Re: Getting SSH working at new install

Sat Jan 28, 2017 7:25 pm

Thank-you so much to all.
Have it working now.
The ability to add the SSH file to the boot partition within Windows, is a brilliant idea.
Thanks-again.

Killertechno
Posts: 197
Joined: Wed Jan 02, 2013 8:28 am

Re: Getting SSH working at new install

Thu May 11, 2017 12:55 pm

Hi guys,
I'm using latest image for Pi Zero.

My router is configured as follows:
WAN = public IP
WLAN = 192.168.100.1/24 acting as DHCP server
NAT: TCP on port 5755 re-directed on port 22 of 192.168.100.212 (my Raspberry)

Raspberry Pi:
DHCP client using as gateway 192.168.100.1, DNS 8.8.8.8

I try to SSH on Raspberry from my laptop (192.168.100.211) connected to WLAN, all ok.
I try to SSH on Raspberry from outside, no answer from TCP requests on port 22 (I see this using wireshark), at same time on Pi I can see requests on port 22 from my laptop but no answers from Pi.

I add new NAT rule on my router: masquerade all outgoing packets from WLAN interface.
Now it correctly works.
It looks such SSH doesn't allow requests from different network, maybe some "strange" setting on SSH?
Thanks.

robothunter
Posts: 3
Joined: Fri May 26, 2017 4:05 pm

Re: Getting SSH working at new install

Fri May 26, 2017 4:17 pm

I had this problem using raspbian lite. After using Win32DiskImager to create my SD card I created a file called "SSH" with no extension on the card with notepad. Then I log into my router and check attached devices to find the assigned ip address. Then I use putty on my PC or the Terminal on my Mac to log in. Username is "pi" password is "raspberry". Next step is to run the "sudo raspi-config" command to set it up. You can officially turn on ssh under option 5 "Interfacing Options".

I hope that helps.

Return to “Troubleshooting”