I am trying to use nmcli to edit an existing connection and I would like to remove completely some properties (as opposed to just modifying their value).

Specifically the properties are wifi-sec.key-mgmt and wifi-sec.psk and the use case is because the network has been switched to open mode from wpa-psk mode.

I can't seem to find a way to delete these properties, and the nmcli help seems to point to the command nmcli connection modify but it doesn't seem to have the ability to delete entire properties, just delete some items in multi-value properties, which is not the case for the ones I want.

Usage: nmcli connection modify { ARGUMENTS | help }

ARGUMENTS := [id | uuid | path] <ID> ([+|-]<setting>.<property> <value>)+

Modify one or more properties of the connection profile.
The profile is identified by its name, UUID or D-Bus path. For multi-valued
properties you can use optional '+' or '-' prefix to the property name.
The '+' sign allows appending items instead of overwriting the whole value.
The '-' sign allows removing selected items instead of the whole value.

Is there any way to completely remove a property via nmcli or do I have to delete the whole connection and then re-create it without these properties ?

Note that this needs to be invoked from another program, so interactive mode commands are not suitable.


Information from nmcli manual:

  1. First you need to identify the connection you want to edit with the following command:

    nmcli connection show

  2. Then, assuming you have a connection named 'Ethernet' (used here just as an example) use this command:

    nmcli connection edit Ethernet

It starts the ===| nmcli interactive connection editor |===, which can remove properties of a connection.

  • Thank you, but unfortunately this does not work for me because nmcli is invoked by another program, thus I can't go into interactive mode. I updated the original question. – feralgeometry Jan 12 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.