Hello. Could you please advise me how to block desktop background change for a normal user. Maybe there is some configuration file so that I can restrict access rights to it.
Open the files manager > Other Positions > Computer > usr > share > right-click the folder
backgrounds > Permissions > change permissions. I'm on Core and they are grayed for me so it's possible that they are grayed to you, too.
Thanks for the reply. But what if a user can download any picture from the Internet and set it as a background using the right mouse button ?
They can only do so with Permissions set.
You can use dconf-editor to place a
read only lock on the
sudo apt install dconf-editor
Create a local directory for your user
sudo mkdir /etc/dconf/db/local.d
Give that directory a locks folder
sudo mkdir /etc/dconf/db/local.d/locks
Create a file to contain your lock info
sudo touch /etc/dconf/db/local.d/locks/default-wallpaper
Open the file
sudo nano /etc/dconf/db/local.d/locks/default-wallpaper
Copy the contents below and paste it into that file
# prevent changes to the background /org/gnome/desktop/background/picture-uri /org/gnome/desktop/background/picture-options /org/gnome/desktop/background/primary-color /org/gnome/desktop/background/secondary-color
ctrl+o to overwrite. Then
enter key to save current configuration. Then
ctrl+x to exit the editor.
You can do the above with GUI if you prefer. Elevate to Root
Launch file manager
In left pane, select "other locations" in right pane, select "computer". Now, navigate the the
etc folder, then follow the rest of the tree :
dconf/db/local.d/locks/ and then right click
default_wallpaper and open with text editor.
Paste in the contents, then save and close the file.
Now, you must run
sudo dconf update
for the changes to take effect.
You can launch
dconf-editor as a GUI app from the app menu to use for other settings or to check your settings.
Thank you so much for your help. I did everything according to the instructions. But for some reason the user can still change the background. I also tried following these instructions
I just looked at your Profile and it says you are using Zorin OS Lite which uses XFCE, not Gnome.
If so, that would explain it - the changes we made are for Gnome. I recommend letting the file remain in place. It is harmless, but should you use Gnome later, that file will be already setup.
On XFCE, the process is different but importantly... This may be a good thing. Setting up
kiosk mode may suit your needs better as it not only prevents changes to wallpaper, it is much more broad in its protections, being able to limit access to a large variety of customizations. Please scroll down to post number 3 in this thread:
Hello. Thank you for your help. Yes, indeed I am using XFCE. I tried to enable kiosk mode. I created a kioskrc folder, created a configuration file in it. Maybe the kiosk mode was moved to a different folder like in this thread.I have also tried placing the kioskrc folder in other places. But nothing worked for me. The background was still not blocked. Finally I found a command that made any context menu invisible "xfconf-query --channel xfwm4 -p /general/popup_opacity -s 0". I removed the Start button. Disabled all hotkeys except terminal invocation. I configured the computer to turn on and off via "Cron" and left only Firefox in the autoloader. I hope this will be enough for me, but I plan to deal with the kiosk mode later. Thank you very much for your advice.
If I were to be helpful, I would need to study up on Kiosk mode, as well. I have never used it. My computers are under my control so I never needed to.
It is worth learning, though...