6

When I boot my laptop into Ubuntu 10.10, the wireless won't automatically connect; it is configured, and I can get a connection using "Connect to Hidden Wireless Network..." and selecting the name from the drop-down - however, the first time (per boot) I do this, it asks me to elevate myself. The connection works if I then surrender the elevated privilege. The connection is set as available to all users, and to connect automatically.

What I would like is that it silently and automatically connect to the wireless. How can I do that?

Zanna
  • 70,465
  • 1
    First I'd recommend not to use hidden network settings, because you'll have nothing but trouble from it (I am telling you this from my own personal experience). It is not a security feature, in fact, if you google it a bit, you'll discover that your network can actually be less secure with hidden SSID. It may also be the cause you need to elevate.. See http://www.brighthub.com/computing/smb-security/articles/1211.aspx – dr Hannibal Lecter Oct 23 '10 at 10:42
  • @drhannibal I wish you'd post that as an answer rather than a comment. It is certainly helpful, and it may turn out to be the correct answer. – Marc Gravell Oct 23 '10 at 11:11

3 Answers3

6

If even after all warnings about using a hidden SSID you still want to use it, this is how you can do it.

Create a script, e.g. ~/bin/nm-connect-me.sh with the follwing contents:

#!/bin/sh
#
# Automatically try to connect to 'MyWiFi' when WiFi is enabled
#

# the output of nmcli should be in English
LC_ALL=C

# loop for a while until NetworkManager is accepting commands
while [ "$(nmcli -t -f WIFI,STATE nm)" = 'enabled:disconnected' ]
do
 nmcli con up id MyWiFi
 sleep 5
done

exit 0

Then add it to your list of startup applications.

Of course you have to replace MyWiFi by your SSID name.

This information has been extracted from: http://blog.nixpanic.net/2011/01/connect-automatically-and-immediately.html

  • I tried this method but i get this when i try to run the script to test if it actually works: Error: Object 'nm' is unknown, try 'nmcli help'. Any thoughts ?. I am on Debian 8 – Maciej Cygan May 15 '15 at 13:47
  • For future readers, I resolved "Object 'nm' is unknown" in Ubuntu 16.04 by using $(nmcli -t -f WIFI,STATE g) instead. – making3 Nov 09 '16 at 17:22
2

I'd recommend not to use hidden network settings, because you'll have nothing but trouble from it (I am telling you this from my own personal experience).

It is not a security feature, in fact, if you google it a bit, you'll discover that your network can actually be less secure with hidden SSID. It may also be the cause you need to elevate..

See http://brighthub.com/computing/smb-security/articles/1211.aspx

  • Thanks; I'll give that a go and report back. Either way it sound like I shouldn't hide the SSID, regardless of whether it helps ubuntu :) – Marc Gravell Oct 23 '10 at 17:19
  • All working fine now, and I'm content that I'm no less secure. – Marc Gravell Oct 24 '10 at 08:43
  • Glad to hear that! – dr Hannibal Lecter Oct 24 '10 at 10:26
  • If you're concerned with security, simply use WPA authentication instead of WEP. – Oxwivi Feb 21 '11 at 11:53
  • 1
    I don't think, that a hint about the security risks is an answer to the question above! There are some cases in which the user has no privileges to change the network itself. In my case the wifi of my university has a hidden SSID and I have to bother with it. So a real answer how one can connect to a hidden wifi would be really helpful. My android tablet connects without problems, the windows pcs of the other students are connecting right after the user logged in, but for every single linux pc we have, we have to connect to that network manually, every time we sign in. – NobbZ Oct 30 '13 at 15:35
  • "less secure with hidden SSID" - that's a real bullshit! How does it make your WiFi hot spot less secure? Yes you can still figure out that WiFi hotspot is there somewhere in the air, but you will need to add significantly more efforts in doing that if you do not know exact SSID. This makes your WiFi hotspot much more secure but not vise versa. – Simanas Nov 11 '16 at 12:03
  • @Simanas Well then prove it, I don't mind being wrong. – dr Hannibal Lecter Dec 04 '16 at 11:57
1

You can set the keystore password to blank, therefore you will not be asked for a password anymore (I mean the keystore password, not your account password, obviously).

chris
  • 1,929