Answer the question
In order to leave comments, you need to log in
How to autostart a graphical application as a different user on a Debian linux distribution for a non-privileged user?
Actually, what I need to achieve from Debian:
cd /home/defender/thin-defender/thin_defender
/home/defender/thin-defender/.venv/bin/python3 /home/defender/thin-defender/thin_defender/manage.py run_app --config test
reader ALL=(ALL:ALL) NOPASSWD:/home/defender/thin-defender/thin_defender/run.sh
sudo -u defender /home/defender/thin-defender/thin_defender/run.sh
No protocol specified
Unable to init server: Could not connect: Connection refused
No protocol specified
Unable to init server: Не удалось подключиться к: Connection refused
Segmentation fault
gksudo -u defender /home/defender/thin-defender/thin_defender/run.sh
No ask_pass set, using default!
xauth: /tmp/libgksu-4YNi0X/.Xauthority
STARTUP_ID: gksudo/|home|defender|thin-defender|thin_defender|run.sh/3546-0-default_TIME8935278
cmd[0]: /usr/bin/sudo
cmd[1]: -H
cmd[2]: -S
cmd[3]: -p
cmd[4]: GNOME_SUDO_PASS
cmd[5]: -u
cmd[6]: defender
cmd[7]: --
cmd[8]: /home/defender/thin-defender/thin_defender/run.sh
buffer: -No protocol specified-
buffer: -Unable to init server: Could not connect: Connection refused-
buffer: -No protocol specified-
buffer: -Unable to init server: Не удалось подключиться к: Connection refused-
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: -Segmentation fault-
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
buffer: --
brute force GNOME_SUDO_PASS ended...
No password prompt found; we'll assume we don't need a password.
xauth: /tmp/libgksu-4YNi0X/.Xauthority
xauth_env: /home/reader/.Xauthority
dir: /tmp/libgksu-4YNi0X
gksu -Sdu defender /home/defender/thin-defender/thin_defender/run.sh
gksu -du defender /home/defender/thin-defender/thin_defender/run.sh
run xhost
export DISPLAY=":0.0"
xhost +
Answer the question
In order to leave comments, you need to log in
I studied this question: I took out an
orange (Orange PI One), filled it with armbian.
The easiest way is to take lightdm and run the application as greeter (no auto-logins needed).
In this version, you only need to install xorg and lightdm
and run systemctl set-default graphical.target
/etc/lightdm/lightdm.conf
[Seat:*]
greeter-session=my-greeter
[Desktop Entry]
Name=My GTK+ Greeter
Comment=This runs the My GTK+ greeter, it should only be run from LightDM
Exec=python /home/user/greeter.py
Type=Application
X-Ubuntu-Gettext-Domain=lightdm
setup_add() {
echo $new_host_name > /etc/hostname
hostname $new_host_name
if [ -z "$new_nds_servers" ] ; then
return
fi
echo rdp_server=$new_nds_servers > /tmp/rdp_config
echo rdp_user=$new_nds_tree_name >> /tmp/rdp_config
echo rdp_passwd=$new_nds_context >> /tmp/rdp_config
}
case $reason in
BOUND|RENEW|REBIND|REBOOT)
setup_add
;;
EXPIRE|FAIL|RELEASE|STOP)
return
;;
esac
there is a graphical application that needs permission to change a couple of system configs in /etc/;
man suid
Even Wikipedia has: https://ru.wikipedia.org/wiki/Suid
And if the script, then:
sudo cat /etc/sudoers
Everything is written right there in the comments.
Or google sudoers nopasswd
Running an application as root in a guest session is certainly powerful. If you really need it, look towards sudo
No "graphical application" from the user should write to directories other than home and /tmp. And getting into /etc is complete hell and demons. If you really need to change something like this in /etc - write a daemon that will start as root and write to /etc and a client that will send commands to it. And it’s best to start the demon not from root, but from some pseudo-user who will own this pair of files
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question