Software & AppsOperating SystemLinux

How To Turn On Wi-Fi Hotspot Using Command Line on Ubuntu 18.04

Ubuntu 15

In this guide, we’ll walk you through the process of enabling a Wi-Fi hotspot using the command line on Ubuntu 18.04. This can be particularly useful if you’re working in a server environment or prefer using the terminal over the graphical interface.

Quick Answer

To turn on a Wi-Fi hotspot using the command line on Ubuntu 18.04, you can use the nmcli command. Simply run nmcli connection up <SSID> in the terminal, replacing <SSID> with the profile name of your Wi-Fi hotspot. To disable the hotspot, use nmcli connection down <SSID>.

Prerequisites

Before we begin, it’s important to note that this guide assumes you have already set up a Wi-Fi hotspot profile on your Ubuntu system. If you haven’t done so, you can follow the instructions provided in this Ask Ubuntu thread to create a new Wi-Fi hotspot.

Understanding the nmcli Command

The command we’ll be using to manage our Wi-Fi hotspot is nmcli. This is a command-line client for NetworkManager, which is the program that manages network connections on Ubuntu. The nmcli command allows us to create, display, edit, delete, activate, and deactivate network connections, as well as control and display network device status.

Enabling the Wi-Fi Hotspot

To enable your Wi-Fi hotspot, you’ll need to know the profile name of your hotspot. This is not the same as the SSID of your device. You can find the profile name by running the nm-connection-editor command or by navigating to Settings > Wi-Fi > (settings icon) > Connect to Hidden Wi-Fi Network... > Connection.

Once you have your profile name, you can enable the hotspot by opening a terminal and running the following command:

nmcli connection up <SSID>

Replace <SSID> with the profile name of your Wi-Fi hotspot. This command tells NetworkManager to activate the connection associated with the given profile name.

Disabling the Wi-Fi Hotspot

If you want to disable the Wi-Fi hotspot, you can do so by running the following command:

nmcli connection down <SSID>

Again, replace <SSID> with the profile name of your Wi-Fi hotspot. This command tells NetworkManager to deactivate the connection associated with the given profile name.

Conclusion

By using the nmcli command, you can easily manage your Wi-Fi hotspot from the command line on Ubuntu 18.04. This can be a powerful tool for system administrators and power users who prefer to work from the terminal.

Remember to replace <SSID> with the actual profile name of your hotspot in the commands provided. If you’re unsure of your profile name, you can find it using the nm-connection-editor command or by navigating through the network settings on your system.

For more information on using the nmcli command, you can refer to the official NetworkManager documentation.

Can I enable a Wi-Fi hotspot on Ubuntu 18.04 without using the command line?

Yes, you can enable a Wi-Fi hotspot on Ubuntu 18.04 using the graphical interface. You can follow the instructions provided in this Ask Ubuntu thread to create a new Wi-Fi hotspot without using the command line.

How do I find the profile name of my Wi-Fi hotspot?

To find the profile name of your Wi-Fi hotspot, you can run the nm-connection-editor command or navigate to Settings > Wi-Fi > (settings icon) > Connect to Hidden Wi-Fi Network... > Connection. The profile name is different from the SSID of your device.

Can I manage my Wi-Fi hotspot from the command line on Ubuntu 20.04?

Yes, the nmcli command is available on Ubuntu 20.04 as well. You can use the same commands mentioned in this guide to manage your Wi-Fi hotspot from the command line on Ubuntu 20.04.

Are there any other options available for managing network connections on Ubuntu?

Yes, apart from nmcli, you can also use the nmtui command to manage network connections on Ubuntu. nmtui provides a text-based interface for managing network connections and can be a convenient alternative to the command line.

Leave a Comment

Your email address will not be published. Required fields are marked *