Skip to main content

Timeline for sudo equivalent in systemd

Current License: CC BY-SA 4.0

10 events
when toggle format what by license comment
Oct 9, 2019 at 6:46 comment added Phenyl Alright, I let you answer you own question and I will upvote :).
Oct 8, 2019 at 17:40 comment added Badr Elmers no , it ask for password using gui dialogue, the solution that works is this sshpass -p Mypassword pkttyagent -p $(echo $$) | pkexec machinectl shell --uid=root --setenv="DISPLAY=:1.0" --setenv=SHELL=/bin/bash .host /bin/bash --login -c startxfce4
Oct 8, 2019 at 14:31 comment added Phenyl Your problem seems linked to the agent used. Is the following helping you ? machinectl shell --uid=root --setenv='DISPLAY=:1.0' --setenv=SHELL=/bin/bash .host /bin/bash -lc 'startxfce4'; pkttyagent --process $(pgreg machinectl)
Oct 8, 2019 at 13:38 comment added Badr Elmers yes I m attempting to change my sudo things to pkexec (PolicyKit) . bypass the password check is not a solution because hardening security is my objective not the inverse...thanks
Oct 8, 2019 at 13:24 comment added Phenyl Following you link, I understand that you are using PolicyKit. Is it an option for you to bypass the password check?
Oct 8, 2019 at 12:39 comment added Badr Elmers no, same problem, I want to avoid sudo . and --no-ask-password only force machinectl to not ask for a password.
Oct 8, 2019 at 9:04 comment added Phenyl @BadrElmers, is the command sudo machinectl --no-ask-password shell --uid=root --setenv='DISPLAY=:1.0' --setenv=SHELL=/bin/bash .host /bin/bash -lc 'thunar' combining sudo and the flag --no-ask-password answering you problem?
Oct 7, 2019 at 14:51 comment added Badr Elmers sorry but both solutions are not working, I think you did not understand my problem: I want to force machinectl to ask for the password using the terminal not the gui dialogue, like when we use sudo + command... I found a solution (using pkexec + pkttyagent) which seems the canonical method: sshpass -p Mypassword pkttyagent -p $(echo $$) | pkexec machinectl shell --uid=root --setenv="DISPLAY=:1.0" --setenv=SHELL=/bin/bash .host /bin/bash --login -c startxfce4
Oct 7, 2019 at 12:10 review First posts
Oct 7, 2019 at 12:12
Oct 7, 2019 at 12:06 history answered Phenyl CC BY-SA 4.0