Skip to content

Instantly share code, notes, and snippets.

@paoloumali
Last active December 20, 2021 00:21
Show Gist options
  • Save paoloumali/5b7ed51f101a7590770b037d7bfa85d3 to your computer and use it in GitHub Desktop.
Save paoloumali/5b7ed51f101a7590770b037d7bfa85d3 to your computer and use it in GitHub Desktop.
Auto-connect to hidden wifi network in Ubutu 20.04

Add systemd hidden_wifi_connect.service

vim /etc/systemd/system/hidden_wifi_connect.service

[Unit]
Description=Connect to hidden wifi network on start
Before=network.target

[Service]
ExecStart=bash /home/paoloumali/connect_to_hidden_network.sh
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload sudo systemctl enable hidden_wifi_connect.service

Content of bash script: connect_to_hidden_network.sh

#!/bin/bash

nmcli radio wifi on
sleep 5s
nmcli con up id NameOfHiddenWifiSsid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment