How to run gsettings for another user Ubuntu 18.04.2 LTS Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Why should users never use normal sudo to start graphical applications?Graphical editor for GSettings/dconf?Permission denied error for running command on ubuntugsettings and anacronHow to run `gsettings set` in chroot?List all non system usersHaving trouble preventing users from changing wallpaper/settingsAs root, I can use su to make dconf changes for another user. How do I actually make them apply?Why does 'sudo java' change the user home directory to /root?Changing gsettings for another user from an ansible script (started by vagrant)Run gsettings with crontab
Are two submodules (where one is contained in the other) isomorphic if their quotientmodules are isomorphic?
Why did the IBM 650 use bi-quinary?
What's the meaning of 間時肆拾貳 at a car parking sign
If a contract sometimes uses the wrong name, is it still valid?
Seeking colloquialism for “just because”
At the end of Thor: Ragnarok why don't the Asgardians turn and head for the Bifrost as per their original plan?
How would the world control an invulnerable immortal mass murderer?
Short Story with Cinderella as a Voo-doo Witch
Resolving to minmaj7
2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?
What does the "x" in "x86" represent?
Coloring maths inside a tcolorbox
How can I make names more distinctive without making them longer?
Why didn't this character "real die" when they blew their stack out in Altered Carbon?
When do you get frequent flier miles - when you buy, or when you fly?
ListPlot join points by nearest neighbor rather than order
Single word antonym of "flightless"
Echoing a tail command produces unexpected output?
Denied boarding although I have proper visa and documentation. To whom should I make a complaint?
Output the ŋarâþ crîþ alphabet song without using (m)any letters
Extract all GPU name, model and GPU ram
What is a non-alternating simple group with big order, but relatively few conjugacy classes?
Should I discuss the type of campaign with my players?
Identify plant with long narrow paired leaves and reddish stems
How to run gsettings for another user Ubuntu 18.04.2 LTS
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Why should users never use normal sudo to start graphical applications?Graphical editor for GSettings/dconf?Permission denied error for running command on ubuntugsettings and anacronHow to run `gsettings set` in chroot?List all non system usersHaving trouble preventing users from changing wallpaper/settingsAs root, I can use su to make dconf changes for another user. How do I actually make them apply?Why does 'sudo java' change the user home directory to /root?Changing gsettings for another user from an ansible script (started by vagrant)Run gsettings with crontab
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am trying to run gsettings for another user in Ubuntu 18.04.2 LTS. Specifically, I am attempting to prevent the user's screen from locking. This will be run as part of a bash script. The commands I am using are:
su someuser
dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
Because this is run via ssh, I am opening with dbus-launch to start dbus then attempting a simple call to gsettings. However, I get the error:
dbus[22652]: Unable to set up transient service directory: XDG_RUNTIME_DIR "/run/user/1000" is owned by uid 1000, not our uid 1001
(process:22650): dconf-CRITICAL **: 11:11:27.830: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
(process:22650): dconf-CRITICAL **: 11:11:27.830: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
(process:22650): dconf-CRITICAL **: 11:11:27.836: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
To confirm that the UIDs are being mismatched I checked the /run/user directory:
ls -lah /run/user
Which outputs:
total 0
drwxr-xr-x 4 root root 80 Apr 16 14:25 .
drwxr-xr-x 31 root root 900 Apr 16 14:25 ..
drwx------ 4 adminuser adminuser 100 Apr 16 14:25 1000
drwx------ 11 someuser someuser 260 Apr 16 12:26 1001
I also tried using sudo:
sudo -u "someuser" dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
Which gives the errors:
(process:22264): dconf-CRITICAL **: 14:33:41.124: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-CRITICAL **: 14:33:41.124: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-CRITICAL **: 14:33:41.135: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-WARNING **: 14:33:41.152: failed to commit changes to dconf: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dfile_2derror_2dquark.Code2: Cannot open dconf database: Failed to open file “/home/adminuser/.config/dconf/user”: Permission denied
Which leads to the question, why is gsettings trying to run for adminuser instead of someuser and how can it be directed to run for someuser by adminuser over SSH?
command-line gsettings
add a comment |
I am trying to run gsettings for another user in Ubuntu 18.04.2 LTS. Specifically, I am attempting to prevent the user's screen from locking. This will be run as part of a bash script. The commands I am using are:
su someuser
dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
Because this is run via ssh, I am opening with dbus-launch to start dbus then attempting a simple call to gsettings. However, I get the error:
dbus[22652]: Unable to set up transient service directory: XDG_RUNTIME_DIR "/run/user/1000" is owned by uid 1000, not our uid 1001
(process:22650): dconf-CRITICAL **: 11:11:27.830: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
(process:22650): dconf-CRITICAL **: 11:11:27.830: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
(process:22650): dconf-CRITICAL **: 11:11:27.836: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
To confirm that the UIDs are being mismatched I checked the /run/user directory:
ls -lah /run/user
Which outputs:
total 0
drwxr-xr-x 4 root root 80 Apr 16 14:25 .
drwxr-xr-x 31 root root 900 Apr 16 14:25 ..
drwx------ 4 adminuser adminuser 100 Apr 16 14:25 1000
drwx------ 11 someuser someuser 260 Apr 16 12:26 1001
I also tried using sudo:
sudo -u "someuser" dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
Which gives the errors:
(process:22264): dconf-CRITICAL **: 14:33:41.124: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-CRITICAL **: 14:33:41.124: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-CRITICAL **: 14:33:41.135: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-WARNING **: 14:33:41.152: failed to commit changes to dconf: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dfile_2derror_2dquark.Code2: Cannot open dconf database: Failed to open file “/home/adminuser/.config/dconf/user”: Permission denied
Which leads to the question, why is gsettings trying to run for adminuser instead of someuser and how can it be directed to run for someuser by adminuser over SSH?
command-line gsettings
2
Trysudo -Hu someuser dbus-launch ...
– steeldriver
4 hours ago
It works! Post as an answer and I will accept it.
– user2395126
4 hours ago
add a comment |
I am trying to run gsettings for another user in Ubuntu 18.04.2 LTS. Specifically, I am attempting to prevent the user's screen from locking. This will be run as part of a bash script. The commands I am using are:
su someuser
dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
Because this is run via ssh, I am opening with dbus-launch to start dbus then attempting a simple call to gsettings. However, I get the error:
dbus[22652]: Unable to set up transient service directory: XDG_RUNTIME_DIR "/run/user/1000" is owned by uid 1000, not our uid 1001
(process:22650): dconf-CRITICAL **: 11:11:27.830: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
(process:22650): dconf-CRITICAL **: 11:11:27.830: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
(process:22650): dconf-CRITICAL **: 11:11:27.836: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
To confirm that the UIDs are being mismatched I checked the /run/user directory:
ls -lah /run/user
Which outputs:
total 0
drwxr-xr-x 4 root root 80 Apr 16 14:25 .
drwxr-xr-x 31 root root 900 Apr 16 14:25 ..
drwx------ 4 adminuser adminuser 100 Apr 16 14:25 1000
drwx------ 11 someuser someuser 260 Apr 16 12:26 1001
I also tried using sudo:
sudo -u "someuser" dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
Which gives the errors:
(process:22264): dconf-CRITICAL **: 14:33:41.124: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-CRITICAL **: 14:33:41.124: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-CRITICAL **: 14:33:41.135: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-WARNING **: 14:33:41.152: failed to commit changes to dconf: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dfile_2derror_2dquark.Code2: Cannot open dconf database: Failed to open file “/home/adminuser/.config/dconf/user”: Permission denied
Which leads to the question, why is gsettings trying to run for adminuser instead of someuser and how can it be directed to run for someuser by adminuser over SSH?
command-line gsettings
I am trying to run gsettings for another user in Ubuntu 18.04.2 LTS. Specifically, I am attempting to prevent the user's screen from locking. This will be run as part of a bash script. The commands I am using are:
su someuser
dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
Because this is run via ssh, I am opening with dbus-launch to start dbus then attempting a simple call to gsettings. However, I get the error:
dbus[22652]: Unable to set up transient service directory: XDG_RUNTIME_DIR "/run/user/1000" is owned by uid 1000, not our uid 1001
(process:22650): dconf-CRITICAL **: 11:11:27.830: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
(process:22650): dconf-CRITICAL **: 11:11:27.830: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
(process:22650): dconf-CRITICAL **: 11:11:27.836: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
To confirm that the UIDs are being mismatched I checked the /run/user directory:
ls -lah /run/user
Which outputs:
total 0
drwxr-xr-x 4 root root 80 Apr 16 14:25 .
drwxr-xr-x 31 root root 900 Apr 16 14:25 ..
drwx------ 4 adminuser adminuser 100 Apr 16 14:25 1000
drwx------ 11 someuser someuser 260 Apr 16 12:26 1001
I also tried using sudo:
sudo -u "someuser" dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
Which gives the errors:
(process:22264): dconf-CRITICAL **: 14:33:41.124: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-CRITICAL **: 14:33:41.124: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-CRITICAL **: 14:33:41.135: unable to create directory '/home/adminuser/.cache/dconf': Permission denied. dconf will not work properly.
(process:22264): dconf-WARNING **: 14:33:41.152: failed to commit changes to dconf: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dfile_2derror_2dquark.Code2: Cannot open dconf database: Failed to open file “/home/adminuser/.config/dconf/user”: Permission denied
Which leads to the question, why is gsettings trying to run for adminuser instead of someuser and how can it be directed to run for someuser by adminuser over SSH?
command-line gsettings
command-line gsettings
edited 4 hours ago
terdon♦
67.8k13140223
67.8k13140223
asked 4 hours ago
user2395126user2395126
1233
1233
2
Trysudo -Hu someuser dbus-launch ...
– steeldriver
4 hours ago
It works! Post as an answer and I will accept it.
– user2395126
4 hours ago
add a comment |
2
Trysudo -Hu someuser dbus-launch ...
– steeldriver
4 hours ago
It works! Post as an answer and I will accept it.
– user2395126
4 hours ago
2
2
Try
sudo -Hu someuser dbus-launch ...
– steeldriver
4 hours ago
Try
sudo -Hu someuser dbus-launch ...
– steeldriver
4 hours ago
It works! Post as an answer and I will accept it.
– user2395126
4 hours ago
It works! Post as an answer and I will accept it.
– user2395126
4 hours ago
add a comment |
1 Answer
1
active
oldest
votes
The issue here is related to Why should users never use normal sudo to start graphical applications? i.e. that by default, sudo
does not change $HOME
to that of the target user.
You can change that using the -H
(--set-home
) option:
-H, --set-home
Request that the security policy set the HOME environment
variable to the home directory specified by the target user's
password database entry. Depending on the policy, this may
be the default behavior.
So
sudo -Hu someuser dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1134453%2fhow-to-run-gsettings-for-another-user-ubuntu-18-04-2-lts%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The issue here is related to Why should users never use normal sudo to start graphical applications? i.e. that by default, sudo
does not change $HOME
to that of the target user.
You can change that using the -H
(--set-home
) option:
-H, --set-home
Request that the security policy set the HOME environment
variable to the home directory specified by the target user's
password database entry. Depending on the policy, this may
be the default behavior.
So
sudo -Hu someuser dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
add a comment |
The issue here is related to Why should users never use normal sudo to start graphical applications? i.e. that by default, sudo
does not change $HOME
to that of the target user.
You can change that using the -H
(--set-home
) option:
-H, --set-home
Request that the security policy set the HOME environment
variable to the home directory specified by the target user's
password database entry. Depending on the policy, this may
be the default behavior.
So
sudo -Hu someuser dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
add a comment |
The issue here is related to Why should users never use normal sudo to start graphical applications? i.e. that by default, sudo
does not change $HOME
to that of the target user.
You can change that using the -H
(--set-home
) option:
-H, --set-home
Request that the security policy set the HOME environment
variable to the home directory specified by the target user's
password database entry. Depending on the policy, this may
be the default behavior.
So
sudo -Hu someuser dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
The issue here is related to Why should users never use normal sudo to start graphical applications? i.e. that by default, sudo
does not change $HOME
to that of the target user.
You can change that using the -H
(--set-home
) option:
-H, --set-home
Request that the security policy set the HOME environment
variable to the home directory specified by the target user's
password database entry. Depending on the policy, this may
be the default behavior.
So
sudo -Hu someuser dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
answered 4 hours ago
steeldriversteeldriver
70.9k11115187
70.9k11115187
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1134453%2fhow-to-run-gsettings-for-another-user-ubuntu-18-04-2-lts%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Try
sudo -Hu someuser dbus-launch ...
– steeldriver
4 hours ago
It works! Post as an answer and I will accept it.
– user2395126
4 hours ago