Autotel

How to SSH to a raspberry pi from windows 7

Raspberry Pi connected directly to a windows 7 machine

I have spent a really long time so far, trying different options on how to SSH to a raspberry pi from my windows 7 machine. None seemed to work until now. I've been bound to carry a router with me when I wanted to work in the raspberry, as it seemed to be the only option to get an IP assigned to it. I have tried to configure windows internet sharing, which seemingly would never work. I also installed a linux virtual machine, but that is a lot of disk space just to be able to SSH to the raspberry, and I also tried some shareware DHCP server that didn't work either. There is also the possibility of using windows 10, but I am currently very happy with my older OS, and I know that I will not like the newer one.

Assuming that you want to use the raspberry headlessly, and that you have a fresh install of the operative system, you must first put the raspberry's SD card in a computer that you can actuall use. In the root folder of the first (smallest) partition of the card, place an empty file called "ssh". This will tell the raspberry to enable SSH access on next boot. The ssh file gets removed upon each power cycle.

The solution I got working at the end, was to use TFTPD64. This software is designed to create TFTP servers, but it also allows to create DHCP's and other kind of servers. A DHCP is basically a server that will give an IP to any client device that is connected to the network. It is the same thing that a router uses to add a different address to each computer that connects to it.

I configured it as follows:

  • IP pool start address: 192.168.0.2 (It is a non-conflicting IP, since my internet router has the 192.168.11.0 starting address)
  • size of pool: I chose 255, but I actually would be OK with 2.
  • lease: default value
  • boot file: empty
  • Def. router (opt3) 192.168.0.1
  • Mask (Opt 1): 255.255.255.0

I left the rest unchanged. After setting it, I plugged the raspberry, turned it on, and switched to the DHCP tab in the Tftpd program window. It displayed the two IP's it has assigned so far, one of which allowed me to SSH into.

The first time you manage to SSH into the Raspberry, you should do "raspi-config" to enable SSH access in all next bootups, otherwise you will need to add again the ssh file into the partition, as explained in the beggining.