set bluetooth to disabled by default on debian 10

I'm not sure why Debian developers think it's good to enable bluetooth automatically on boot. I think this is a privacy issue and would prefer bluetooth to be "opt-in". So here's how to make sure bluetooth is turned off by default:

# install tool for disabling bluetooth
# it's a shame debian has no api for this!

sudo apt install rfkill

# setup systemd unit

cat << EOF | sudo bash -c 'cat > /etc/systemd/system/disable-bluetooth-on-startup.service'
Description=Make shure Bluetooth is disabled on system start.

ExecStart=rfkill block bluetooth


# enable systemd unit

sudo systemctl enable disable-bluetooth-on-startup

written by uniq on 2019-10-09