What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

How to permanently disable wifi and bluetooth on Ubuntu Server 24.04.1?

BosseSwede

Regular Contributor
Background:
I have built a new Ubuntu Server 24-04-1 LTS using an ASUS NUC 13 i7 PRO device as a replacement for my old server running on a Lenovo IdeaCentre minitowe PC, whiuch
I have moved a lot of data from the old to the new server and I have also added a MINT desktop to the server so I can use GParted on it to manage the disks.
When I used the MINT desktop via VNC (manually started using: vncserver :2) there was a pop-up dialog on VNC login saying "Authentication required. System policy prevents WiFi scans", which brought my attention to the fact that the NUC has both WiFi and Bluetooth, which the old server did not.

Additionally when I try to run TigerVNC as a service it fails and in the logs I find a lot of lines related to Bluetooth errors.
The VNC server can be started manually though, but I need it to be a service...

I do not want either WiFi nor Bluetooth to be running on this server, it should *only* use wired Ethernet.
Question:
How can I command Ubuntu to switch off both WiFi and BT radios in such a way that it will survive a reboot?
I have found various articles like this where they suggest these:
nmcli, rfkill, tlp, ip

Example:
This is what I get using rfkill:
Code:
$ rfkill list
0: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no
1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
So both BT and WiFi seems to be active even though I do not need them.

I am unsure about what to do now since it looks like the suggestions I have found will not survive a reboot.

So I want to switch off both wifi and bluetooth in such a way that it will survive a reboot but still allow me to switch on if I need to.
What is the best way to do this?
 
From the cli I would use the following for Wi-Fi. I don't know what the commands would be for Bluetooth as I never configured that on my Ubuntu server in the first place.
Code:
nmcli radio wifi off
Code:
nmcli radio wifi on

My guess for Bluetooth would be to disable the service through systemd, although I don't know whether that's the "best" way.
Code:
systemctl disable bluetooth
systemctl stop bluetooth
Code:
systemctl enable bluetooth
systemctl start bluetooth
 
Last edited:
Installing a desktop to manage a server for one app is not smart. Webmin does a better job.
 
Installing a desktop to manage a server for one app is not smart. Webmin does a better job.
Never heard about Webmin before, but if it uses Apache I get worried because I have an Apache installation which serves multiple purposes like:
- Host for a Subversion server which backs up a main server in another location using svnsync.
- Host for a video service for a limited number of subscribers.
- Managing DDNS monitoring and Letsencrypt certificates
I do not want a new system added to the server as a web service until I have completed the migration from the old server hardware onto this new device.
But I need to be able to manage the drives of the server using GParted (which I know and can handle) rather than command line interfaced systems like dd etc.
So I decided that instead of booting to a Ventoy based GParted Live system every time I needed to check/change stuff on the drives I could as well install a tiny desktop to be used via VNC when needed.
Now when looking at it it seems like the "tiny" desktop install was not so tiny after all! :mad:
A whole office package was installed....

1738428597637.png
 
I don't understand why you would need to mess with drives on a server once it is set up. I have used Webmin for years on Debian and Ubuntu servers. It has a GUI that can partition disks if needed (https://webmin.com/docs/modules/partitions-on-local-disks/). It also has a pretty good file manager/editor. No, it does not use Apache but can manage Apache as well as MySQL and a host of other server programs. You can install Webmin on your current server with the Mint desktop and play with it. It will not put an additional load on your server.
If you insist on using a VNC, RealVNC works well on Linux, and other OSes, but to install a RealVNC Server on Linux you will have to have a RealVNC account.
 
IIRC Webmin runs on lighttpd.
 
Does Webmin co-exist with Apache by using a non-standard port?
The normal ports for http and https are needed for Apache and Subversion also works through Apache.
I am going to copy over the apache2 config from the old server to the new and start bringing up the web services. At some time there I have to deal with Letsencrypt certs too and the reconfiguration of the ASUS router's port forward rules so that the external calls are redirected from the old to the new server.
And I have to shut down the old server and transfer its duties to the new server so there has to be a window of time where the Svn service is stopped while the data are migrated (some 60 GB of repositories) and the router is reconfigured....
 
Fixing the configuration of the VNC software would be better.

But to remove bluetooth from an Ubuntu install would be:

Code:
sudo apt-get purge blueman bluez-utils bluez bluetooth && sudo apt-get autoremove && sudo apt-get autoclean
 
Disabling wifi takes a different turn in Ubuntu, as you either turn it off at boot or create a systemd service that disables wifi.

to disable at boot:
Code:
sudo nano /etc/default/grub
Add ‘wifi.powersave=2‘ to the GRUB_CMDLINE_LINUX_DEFAULT line.
Then commit changes to grub:
Code:
sudo update-grub
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top