Changing the host-name from a non-admin user

Hi :slight_smile:

I’m not an admin user.
I would like very much to change the host-name without having to change the user (to be able to copy-paste, …).

Would it be possible?
The settings app offers to unlock when I want to add a printer, but it doesn’t for the host-name.


Software Information:

  • OS Name: Ubuntu 24.04.2 LTS
  • GNOME Version: 46
  • Window System: Wayland
  • Kernel Version: Linux 6.14.0-27-generic

Hostname can be edited as follows:

Settings -> System -> About -> Device Name

I found the place (sorry, it’s in French, so I’m not sure about the translation Hostname / Device Name).
It’s also in Sharing (Settings -> Sharing -> Device Name).

The problem is I can’t find how to unlock it. (I think as an admin it’s unlocked by default.)
When I want to add a printer, the way to unlock it is very clear.

The following polkit rule from Settings app allows only privileged users (sudo group) to change some settings.

polkit.addRule(function(action, subject) {
	if ((action.id == "org.freedesktop.locale1.set-locale" ||
	     action.id == "org.freedesktop.locale1.set-keyboard" ||
	     action.id == "org.freedesktop.ModemManager1.Device.Control" ||
	     action.id == "org.freedesktop.hostname1.set-static-hostname" ||
	     action.id == "org.freedesktop.hostname1.set-hostname" ||
	     action.id == "org.gnome.controlcenter.datetime.configure") &&
	    subject.local &&
	    subject.active &&
	    subject.isInGroup ("@PRIVILEGED_GROUP@")) {
		    return polkit.Result.YES;
	    }
});

Source: gnome-control-center/panels/common/gnome-control-center.rules.in

1 Like

In Settings -> System -> Date and time, there is an unlock button, but a little bit different than in Settings -> Printers.

I don’t find what are the corresponding settings:

  • In Settings -> Keyboard, I’m able to add a keyboard without admin password.
  • In Settings -> Network/WiFi/Bluetooth, all network settings I know are allowed to be changed without admin password.

What’s the difference?
Settings -> Sharing -> Device Name and Settings -> System -> About -> Device Name seem to point on the same thing.

Anyway, there is no unlock button at all, which is the most annoying thing.


I like the ergonomics of macOS, I find it simpler.

There is an unlock button which is always shown, and which is only disabled when no setting requires it. It’s also quite unobtrusive, more like Settings -> System -> Date and time than Settings -> Printers or Settings -> System -> Users.

Where should I make the suggestion, please? :slight_smile:

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.