I am trying to set up a Raspberry Pi Zero W without a keyboard and mouse, so I will enable SSH by creating the "ssh" file in the root partition. I will then use SSH on first boot to enable and configure VNC for use with the Pi. However, when I am done working with VNC, I want to be able to disable ssh and VNC so that the Pi will boot to desktop like normal. Is this possible? Can I, via VNC, use the config menu to disable SSH and allow the pi to boot to desktop?

I have looked everywhere for how to disable SSH, but everything I found only dealt with enabling it.

  • If you disable SSH and VNC how are you going to connect to and control the Pi? Enabling SSH and VNC do not prevent the Pi from booting to the desktop. Jul 21 '17 at 19:56
  • @SteveRobillard I am trying to configure a Bluetooth keyboard-mouse combo that I can't get to work through bluetoothctl. So, I figured I would try connecting the keybaord through the GUI. I need to set up the keyboard in headless, after which I will be able to control the pi with the Bluetooth keyboard
    – ajflj
    Jul 21 '17 at 19:59
  • This does not require disabling SSH or VNC, however, if you insist on doing so you can use sudo raspi-config or the GUI version to disable them. Jul 21 '17 at 20:01
  • @SteveRobillard Thank you very much for your help. Earlier, when I attempted this, the pi wouldnt boot into desktop. The welcome screen would just show with an ssh terminal. However, now it seems to be working fine. Thanks again
    – ajflj
    Jul 21 '17 at 20:04
  • BTW that is not likely an SSH terminal it is the command line. It does look like an SSH window, but it runs locally and SSH is normally used remotely. You can type startx on the command line to access the desktop. Jul 21 '17 at 20:16

Having SSH or VNC enabled does not affect whether your Pi boots to the desktop. You can choose to boot to the command line or desktop by setting the boot option in the raspi-config script.

You can launch this with the following command:

sudo raspi-config

You may want to reconsider disabling SSH and VNC. SSH especially provides a convenient means of accessing your Pi especially if it becomes unresponsive or you need to reconfigure your keyboard. However, if you are intent on doing this you can disable them from the raspi-config script or the equivalent GUI preferences menu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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