10

Is SSH enabled by default on the Raspbian Wheezy 7 install image? And if it is, which IP address is used so I can access Pi via PuTTY and Filezila?


Important!

As per Philippe Lhardy's answer current (post ~2016) versions of Raspbian do not have SSH enabled by default.

Aurora0001
  • 6,198
  • 3
  • 21
  • 37
zsn
  • 431
  • 2
  • 6
  • 13

5 Answers5

14

SSH is enabled by default only for Raspbian releases before November 2016 but the boot protocol for the ethernet interface is set to DHCP by default so the IP address will be assigned by your router. You can find the open SSH ports on your network using the nmap utility:

nmap -p 22 --open -sV 192.168.1.0/24

You should find your pi listed in the output along with the IP assigned to the pi.

You can change the boot protocol to static and define a static IP address for the pi by editing the ifcfg-eth0 file:

vi /etc/sysconfig/network-scripts/ifcfg-eth0 

Then edit the file to suit your needs

DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
NETWORK=192.168.1.0
NETMASK=255.255.255.0
IPADDR=192.168.1.200
GATEWAY=192.168.1.1
Aurora0001
  • 6,198
  • 3
  • 21
  • 37
Maux
  • 336
  • 1
  • 7
  • 4
    192.167.0.0/16 belongs to the "Italian national computer network for universities and research" — you probably meant 192.168.0.0/16 instead. Also, there's no guarantee that the router will use 192.168.1.0/24 (or even 192.168.0.0/16), so you should determine the local network prefix first (e.g. using `ifconfig`). – n.st Apr 29 '14 at 18:11
4

In Windows Command line, or any OS that has ping command you can type in:

ping raspberrypi

enter image description here

It will resolve the DNS entry and show you the IP address. In the image as 192.168.1.233

But of course, you might just connect using the host name raspberrypi instead of IP.

This all assumes that you are using a router with DHCP and DNS running on it. Most internet ISP will provide you with a router that does this out of the box. But if you got custom DHCP or DNS, then you should really know how to find/set the IP yourself.

Aurora0001
  • 6,198
  • 3
  • 21
  • 37
Piotr Kula
  • 17,168
  • 6
  • 63
  • 103
  • trying to ping or connect as rasperrypi doesn't work..i found out address by scanning ip's... – zsn Apr 30 '14 at 07:01
  • It seems like you have a network problem. You should be able to connect to raspberrypi, but I understand all networks have their issues. The fact that you can connect using IP, and its still slow, means its not DNS problem on the Pi (even though you have a DNS issue any way) - You should try get a new SD card, burn a new image and give it a go. I bet it will back as normal – Piotr Kula Apr 30 '14 at 08:15
  • What do you think is an issue there? – bot47 May 02 '14 at 08:47
  • 1
    On OSX, raspberrypi.local would be better. – Tim Wu Oct 16 '16 at 13:43
  • so, this pretty much would mean netbios naming is enabled on raspbian by default – ZJR Dec 07 '16 at 14:30
  • I am not entirely sure about that. It does have more to do with DNS (or more specifically ReverseDNS) lookup on your local. Not all routers do this by default, sometimes it does not work straight away.. but as a first thing try it is worth trying – Piotr Kula Dec 07 '16 at 14:32
  • mDNS/bonjour/rendezvous, not DNS. Windows, MacOS systems have discovery for this service running by default. Look at avahi for linux. – user2497 Mar 31 '18 at 22:16
2

I don't know whether it is installed by default, but if it isn't, setting it up is pretty straightforward: in your shell, enter the following command

   sudo apt-get install ssh

after the installation is over, you can start the service via

   sudo /etc/init.d/ssh start

To find the IP address of your RPi, use

  /sbin/ifconfig

and look for the inet line, you'll fing your IP there.

Sir Celsius
  • 121
  • 2
  • Careful though, you'll need to be on your local network to connect via `ssh` that way. If you want to connect from a remote network, consider looking into port forwarding [as explained in this article](http://www.everydaylinuxuser.com/2013/06/connecting-to-raspberry-pi-from-outside.html). Be careful though, it is a bit more complicated. – Sir Celsius Apr 29 '14 at 14:37
  • Well I was looking for a way which doesn't include connecting my pi to monitor or tv... – zsn Apr 29 '14 at 14:38
  • 1
    That will be complicated. If you have another computer, you can try using [nmap](http://linuxmanpages.com/man1/nmap.1.php) to get your Pi's IP but if the `ssh` service isn't running you won't get very far.. – Sir Celsius Apr 29 '14 at 14:42
2

I know this question was for Raspbian Wheezy, just to warn that in Stretch you have to create an empty file called ssh file in boot filesystem to activate SSH at startup.

See also: Enabling SSH by default on Raspbian Stretch and Raspbian Stretch Headless Setup Procedure on the Raspberry Pi Forums for more information on how to set up SSH with Stretch.

Aurora0001
  • 6,198
  • 3
  • 21
  • 37
0

SSH is enabled by default and my rpi assigned address was 192.168.1.117. I downloaded IP scanner for my local network which helped me to find the IP address.

zsn
  • 431
  • 2
  • 6
  • 13
  • 3
    Hi, Can you provide a link to the scanner. Also please try and create grammatical sentences, with capitals, and full stops, so that your answer is easier to read and understand. :) – Piotr Kula Apr 29 '14 at 15:11
  • @ppumkin why you do need url? `apt-get install nmap` would do perfectly. – lenik Apr 30 '14 at 03:31
  • 1
    Sorry I was in a hurry yesterday and english isn't my native language..http://www.advanced-ip-scanner.com/ and there's a link for scanner.. – zsn Apr 30 '14 at 07:04
  • the op said he downloaded a scanner.. where can I download mine. :) @lenik I don't use Linux daily so nmap is not something I fire up daily - any way using it is a whole other answer. – Piotr Kula Apr 30 '14 at 08:19
  • @ppumkin - u can [get nmap](http://nmap.org/download.html) for windows and mac anyway... – Wilf Jun 12 '14 at 15:19