I bought the new Raspberry Pi W but I don't have right now an mini-HDMI adaptor (to connect it to a monitor) neither an Ethernet module to connect by SSH.

Can I connect somehow by SSH through USB?

How can I connect by SSH by WiFi without it being setup? Will the WiFi automatically connect e.g to a wireless network without password?

  • This is a great video in case you're not too tech savvy. youtu.be/xj3MPmJhAPU Check it out if you're stuck. Commented Mar 31, 2017 at 0:49
  • There are certain complications with Raspberry Pi Headless Setup. Just follow the instruction given in this tutorial.
    – Vickey
    Commented Nov 13, 2017 at 17:39

8 Answers 8


That's a tough one. The WiFi won't automatically connect. So I would try the following:

  1. Image a micro SD card with the Raspbian OS image using Win32DiskImager.

  2. Manually configure your WiFi from another computer. In another computer running Linux (or PC with Live CD) you could edit the following file:


And add the following where you enter your WiFi network SSID and password details:

  1. Enable SSH on the Pi from another computer. Create a file on the /boot partition named “ssh”.

Put the SD card on your Pi and if everything works as I hope it would, you'll be able to see the Pi on your WiFi network using your router app and SSH into it. Good luck, hope it helps.

  • Worked for me. See also thecruftofmybrain.com/?p=680
    – Mawg
    Commented Mar 15, 2017 at 21:14
  • Thanks for this. What do you do if your wifi is WEP? Commented Apr 24, 2017 at 3:08
  • 4
    @ScriptKitty, upgrade to WPA2. WEP is an open door these days Commented May 30, 2017 at 11:51
  • @John La Rooy I know I've seen people hack really easily. Its not my choice though because it's not my network and done devices cannot connect to the wpa2 Commented May 30, 2017 at 13:35
  • Ubuntu in VirtualBox will work for accessing the Raspbian SD card in an USB card reader.
    – weberjn
    Commented Jan 18, 2018 at 22:07

You are looking for information on running "headless". There are details on this on the raspberry pi site. https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=161202

Basically put a file, wpa_supplicant.conf, on the "boot" sector of the sdcard, that you can see from windows, and edit the file to include your wifi credentials:

       psk="Your Network's Passphrase"
  • Where exactly? A boot sector doesn't necessarily point where. Be specific man
    – chx101
    Commented Mar 25, 2021 at 20:30

You can drop in a wpa_supplicant.conf file in the boot directory before installing the SD Card into the Pi. When the Pi boots up, the file /etc/wpa_supplicant/wpa_supplicant.conf will be overwritten (or maybe appended, I'm not sure) with the wpa_supplicant.conf file in the /boot/ directory.

Use the following syntax:



The above setup works for standard WPA wifi connections. There are additional settings in the example below:


Make sure to create the wpa_supplicant.conf file in a text editor set to UNIX encoding (if you're doing this from Windows).

  • I'm having issue of ssh and wpa_supplicant.conffiles being removed each time my pi zero w boot. That NIX encoding seems help. To be safe, I added the line ctrl_interface, update_config and country line in conf.
    – checksum
    Commented Nov 27, 2017 at 10:03

You can SSH in from USB after some configuration.

This assumes you're not using NOOBS. Doing this with a NOOBS SD card is a little harder and (to my knowledge) impossible on Windows.

  1. First, the Raspberry Pi Foundation disabled SSH as a security precaution, so you'll have to connect the SD card to a computer and put a file called "ssh" (no extension) in the drive labeled "boot" that pops up. (If you're running Windows, only one drive will show up. That one will work.) Now the Pi will enable SSH on boot.
  2. Edit the file config.txt and add dtoverlay=dwc2 on its own line at the end.
  3. Edit the file cmdline.txt and add modules-load=dwc2,g_ether right after it says rootwait. Seperate it from rootwait with a space. Don't add it on a new line, add it on the same line.

When you put the SD card in the Pi and plug it in to your computer (use the left USB port where the USB connectors are on the bottom), it should show up as an ethernet device. You should be able to SSH to [email protected] from the attached computer.

Edit: Ricardo's answer reminded me that you could also just do step 1 then see my answer on this related post.


You can connect to wifi by creating a wpa_supplicant.conf file in SD Card.


You can create an empty ssh file in SD Card to enable ssh while booting.

touch ssh

and insert it in your raspberry pi.



Use an awesome app for Mac and maybe windows called PiBakery which is a drag and drop way of setting up Pi zero. That what I did and it really helped. Check it out here: http://www.pibakery.org/


If you have windows and don't have access on partition only boot, you can try this • If a wpa_supplicant.conf file is placed into the /boot/ directory, this will be moved to the /etc/wpa_supplicant/ directory the next time the system is booted, overwriting the network settings; this allows a Wifi configuration to be preloaded onto a card from a Windows or other machine that can only see the boot partition.


I failed to use the above answers for WPA2.

I used:

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid <ssid here>
wpa-psk <psk here>

in the /etc/network/interfaces file.

https://www.raspberrypi.org/forums/viewtopic.php?t=50312 http://blog.darrenparkinson.uk/2013/10/accessing-raspberry-pi-filesystem-from.html

  • This is not the preferred method of configuring networking on recent versions of Raspbian (jeesie and stretch) evidence of this is the old posts you linked to. Commented Oct 22, 2017 at 17:49
  • Preferred or not, the preferred version did not work for me. This way did. it's a valid answer despite not being preferred, and some people may find it useful for getting an initial wifi connection that they can then modify to get the preferred version.
    – Retiarius
    Commented Oct 22, 2017 at 20:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.