4

Always I log into Ubuntu 15.04 and my wifi network (HP-LASERJET) is in range it wants a password from me, despite I always save it. I have a problem just with this wifi network (it is not a printer, it is a basic AP). The only difference is, that it has a hidden SSID. How to force ubuntu to remember my password? I dont want to type it again and again. Thank you.

annoying popup

When I try to fix it in Network Manager -> Edit connections, I choose my network I save the password on my screen appear different popup window: enter image description here

And I have to type keyring password before I want to connect to my wifi. On different networks I do not have to do this.

wair92
  • 482
  • 2
  • 5
  • 19

4 Answers4

4

edit :

sudo -H gedit /etc/NetworkManager/system-connections/HP-LASERJET

and find the section that says

[802-11-wireless-security]
key-mgmt=wpa-psk

and place the following on the next line.

psk=yourPassword

As a prevention for rewriteing it by system use:

chmod 400 /etc/NetworkManager/system-connections/HP-LASERJET
Zanna
  • 70,465
wair92
  • 482
  • 2
  • 5
  • 19
-1

You need to modify the connection's properties programmatically, with NetworkManager's nmcli utility.

Here are some useful commands (hit TAB for autocompletion at all times):

  • To modify properties of existing connections:

    # sudo nmcli connection modify <connection-id> <parameter> <value>
    

    to set the password:

    sudo nmcli connection modify "HP-LASERJET" 802-11-wireless-security.psk p@$$w0rd

    to disable the network's autoconnection property:

    sudo nmcli connection modify "HP-LASERJET" connection.autoconnect no

  • To list all the properties of a given connection (really much more than what you can get from the contents of a *.nmconnection file or the nm-connection-editor GUI):

    nmcli connection show "HP-LASERJET"
    

    to reveal the hidden values:

    nmcli connection show --show-secrets "HP-LASERJET"

Source: https://linuxhint.com/expertly-use-the-ubuntu-network-manager/

KiriSakow
  • 823
-1

This may or may not apply, but I suspect that if you open your Internet connection icon at the top of the screen and select "edit connections" you might be able to select your printer, press "edit..." and check the box marked "connect automatically". I realize it is probably already checked, but maybe there is a way to make it apply the saved password automatically. It might be a setting under the tab there marked "wireless security".

The reason I suspect it might not apply is that I am using an earlier version of Ubuntu and the configuration of this feature may very well have changed slightly.

gyropyge
  • 2,558
  • 1
  • 16
  • 11
  • I am trying to find something useful, but with no success. I edited my question a little bit. – wair92 Jun 23 '15 at 15:53
  • Had you not stated the brand of your printer, I would have inquired as certain printers, particularly many of those by cannon, do not adhere to what I admit I assume are accepted rules. Generally HP has been one of those brands I expect not to encounter this type of problem with, but I've been hearing that in very recent years, HP has gone astray. Perhaps yours is a very new model and is being needlessly difficult? – gyropyge Jun 23 '15 at 15:58
  • It is a classic router, not a printer, sorry for that SSID. On Ubuntu 14.04 it works pretty well but on 15.04 I have a problems with it. – wair92 Jun 23 '15 at 16:02
  • I really appreciate you telling me that, as I have been sticking with 12.04 (primarily) as a result of so many complaints about 14.04. I had hoped 15.04 would be less problematic, not more, so our insight educates me. As to "classic router" I take that to mean a router which acts also as a print server. I've had such problems with such devices I gave up on them entirely. It seems the only stable way to have a network printer, is to buy a printer with the feature built in. Fortunately they are becoming more common these days. – gyropyge Jun 23 '15 at 16:18
-1

My situation is similar to what eldergeek described, but it has some variation.

sudo -H gedit /etc/NetworkManager/system-connections/HP-LASERJET

Change this:

[wifi-security]
key-mgmt=wpa-psk
psk-flags=1

To this:

[wifi-security]
key-mgmt=wpa-psk
psk=YourPassword
psk-flags=0
Zanna
  • 70,465