10

Is there a way to create a hotspot that doesn't have a password?

The "hotspot command" of nmcli :

 wifi hotspot [ifname ifname] [con-name name] [ssid SSID]
       [band {a | bg}] [channel channel] [password password]

does not allow to have a empty password: it gives

Error: Invalid 'password': '' is not valid WPA PSK.

I guess there is a way to edit the configuration files used by nmcli to generate a hotspot to turn it into a password-free hotspot.

If nmcli is not able to do this, what other tools would do it?

Thank you

3 Answers 3

7

It is not possible to create an open hotspot through wifi hotspot command , because nmcli will generate a password for you (WPA or wep) , the --show-secrets option will be used to print the password.

The easy way to create an open wifi-hotspot is using create_ap command:

To install it run:

git clone https://github.com/oblique/create_ap
cd create_ap
make install

Start the service:

systemctl start create_ap

To create an open access point run:

create_ap wlan0 eth0 MyAccessPoint

or if you are connected through Wifi:

create_ap wlan0 wlan0 MyAccessPoint

Update

create_ap is maintained in the linux-wifi-hotspot git repo instead of the original repo:

sudo apt install -y libgtk-3-dev build-essential gcc g++ pkg-config make hostapd libqrencode-dev libpng-dev
git clone https://github.com/lakinduakash/linux-wifi-hotspot
cd linux-wifi-hotspot
make
sudo make install
sudo systemctl enable --now create_ap
wihotspot

On Debian based distributions:

sudo add-apt-repository ppa:lakinduakash/lwh
sudo apt install linux-wifi-hotspot
4

nmcli device wifi hotspot is merely a convenience function for creating and activating a hotspot profile. Indeed, that does not support open hotspots.

However, you can just create a suitable connection profile via other means: like nm-connection-editor or nmcli connection add type wifi con-name "My Hotspot" autoconnect no wifi.mode ap wifi.ssid "My Hotspot" ipv4.method shared ipv6.method shared.

Of course, you can also modify an existing profile from having security to having no security. For example, with nmcli connection modify "$PROFILE" remove wifi-sec remove 802-1x

4

Yes, you can create an open wifi network access point without implementing security protocols using nmcli and NetworkManager. Use the following command

nmcli connection add \
     type wifi \
     con-name "My Hotspot" \
     autoconnect no \
     wifi.mode ap \
     wifi.ssid "My Hotspot" \
     ipv4.method shared \
     ipv6.method shared

Note the non-inclusion of the password parameter when creating the connection. Inclusion of the parameter when the connection is built creates a distinctly different connection profile which includes the 802-11-wireless-security section which forces WPA or WEP. Once a profile is formed, I don't believe it can be changed, so if you may need two profiles if you want to switch between secure and insecure.

Along these same lines, folks are trying to bridge wifi to ethernet. AFAIK you cannot change a wifi connection profile after it is created to include the bridge as it won't contain that section, so to create an open wifi bridged access point include the "master" parameter.

nmcli connection add \
     type wifi \
     master br0 \
     con-name "My Hotspot" \
     autoconnect no \
     wifi.mode ap \
     wifi.ssid "My Hotspot"

After bridging wifi you may have difficulties with the wpa_supplication and may need to specify the bridge interface on the command line, systemd, or arguments file. For CentOS8 this was in /etc/sysconfig/wpa_supplicant

--INTERFACES=""
++INTERFACES="-i wlp2s0 -b br0"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .