Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Gotcha, you snot-necked weenies!" -- Post Bros. Comics


computers / alt.os.linux.mint / [OT] Executing a script requirinf sudu from a desktop icon

SubjectAuthor
* [OT] Executing a script requirinf sudu from a desktop iconpinnerite
+* Re: [OT] Executing a script requirinf sudu from a desktop iconjeorge
|`- Re: [OT] Executing a script requirinf sudu from a desktop iconpinnerite
`- Re: [OT] Executing a script requirinf sudu from a desktop iconBig Al

1
[OT] Executing a script requirinf sudu from a desktop icon

<20230813203309.adde18c55b8f0a253a419079@gmail.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6646&group=alt.os.linux.mint#6646

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pinner...@gmail.com (pinnerite)
Newsgroups: alt.os.linux.mint
Subject: [OT] Executing a script requirinf sudu from a desktop icon
Date: Sun, 13 Aug 2023 20:33:09 +0100
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <20230813203309.adde18c55b8f0a253a419079@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="3ce9c092548e02b4d9a91e3c750ec159";
logging-data="2051995"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+NYtp9vW7seh8XszK2fhd2CmvYo/BFsqo="
Cancel-Lock: sha1:qElitw7SJ9OGc3Xi8P4As8zJGQM=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
 by: pinnerite - Sun, 13 Aug 2023 19:33 UTC

The script is called testbed.sh

The desktop file looks like this:

[Desktop Entry]
Name=Testbed
Exec=gnome-terminal -e "sudo /bin/bash -c /home/alan/Scripts/testbed.sh"
Comment=
Terminal=false
Icon=/home/alan/icons/testbed.png
Type=Application
StartupNotify=true
Name[en_GB]=Testbed

I have fiddled about with the Exec line but nothing works.
I tried adding an output file >> testbed.txt but nothing was created.

i have scanned the WWW but nothing covers it.

Suggestions welcome.

TIA

--
Linux Mint 21.1 kernel version 5.15.0-78-generic Cinnamon 5.6.8

Re: [OT] Executing a script requirinf sudu from a desktop icon

<ubbdic$2da4$1@nnrp.usenet.blueworldhosting.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6647&group=alt.os.linux.mint#6647

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED!not-for-mail
From: some...@invalid.invalid (jeorge)
Newsgroups: alt.os.linux.mint
Subject: Re: [OT] Executing a script requirinf sudu from a desktop icon
Date: Sun, 13 Aug 2023 14:14:04 -0600
Organization: Ministry of Madness
Message-ID: <ubbdic$2da4$1@nnrp.usenet.blueworldhosting.com>
References: <20230813203309.adde18c55b8f0a253a419079@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 13 Aug 2023 20:14:04 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com; posting-account="YKRG+wcUE3ZH5QknWLsQFQjWpafUZ9Hi6Jg7DGavMDA";
logging-data="79172"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:cHARYQxdzAEBQ9hnaul3vvpRF9o= sha256:9crU+PLn971Z8NnMJD8YfjC8O5o6ngMxjSmGq1PJGGk=
sha1:wjaKaPZtiiKpG/w2upMhvGiE0sQ= sha256:hDENxpcpOKxyxszipKLjvx+t8MwHFy/T+HcLpeEH9cU=
In-Reply-To: <20230813203309.adde18c55b8f0a253a419079@gmail.com>
Content-Language: en-US
X-Received-Bytes: 2252
 by: jeorge - Sun, 13 Aug 2023 20:14 UTC

On 8/13/23 1:33 PM, pinnerite wrote:
> The script is called testbed.sh
>
> The desktop file looks like this:
>
> [Desktop Entry]
> Name=Testbed
> Exec=gnome-terminal -e "sudo /bin/bash -c /home/alan/Scripts/testbed.sh"
> Comment=
> Terminal=false
> Icon=/home/alan/icons/testbed.png
> Type=Application
> StartupNotify=true
> Name[en_GB]=Testbed
>
> I have fiddled about with the Exec line but nothing works.
> I tried adding an output file >> testbed.txt but nothing was created.
>
> i have scanned the WWW but nothing covers it.
>
> Suggestions welcome.
>
> TIA
>
>

Think you need to set the environmental var SUDO_ASKPASS to some sort of
GUI "askpass" tool (seahorse seems to be included with LM) and call sudo
with the '-A' and possibly '-E' options.

for example, I have a zenity-based wireguard VPN script with the following:

--
export SUDO_ASKPASS=/usr/libexec/seahorse/ssh-askpass
sudo -AE <privileged cmd>
--

Re: [OT] Executing a script requirinf sudu from a desktop icon

<20230813230535.5e97c5e9d8f2cc945ab744c4@gmail.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6648&group=alt.os.linux.mint#6648

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pinner...@gmail.com (pinnerite)
Newsgroups: alt.os.linux.mint
Subject: Re: [OT] Executing a script requirinf sudu from a desktop icon
Date: Sun, 13 Aug 2023 23:05:35 +0100
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <20230813230535.5e97c5e9d8f2cc945ab744c4@gmail.com>
References: <20230813203309.adde18c55b8f0a253a419079@gmail.com>
<ubbdic$2da4$1@nnrp.usenet.blueworldhosting.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="b13ea0f60e029c3e4540956215f84b54";
logging-data="2092464"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+hYpqHykY9VqrHf2V5Vg4K4v5q13F6k8="
Cancel-Lock: sha1:O+tq3cz+s8HNKxuFah+VXhQOXAo=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
 by: pinnerite - Sun, 13 Aug 2023 22:05 UTC

On Sun, 13 Aug 2023 14:14:04 -0600
jeorge <someone@invalid.invalid> wrote:

> On 8/13/23 1:33 PM, pinnerite wrote:
> > The script is called testbed.sh
> >
> > The desktop file looks like this:
> >
> > [Desktop Entry]
> > Name=Testbed
> > Exec=gnome-terminal -e "sudo /bin/bash -c /home/alan/Scripts/testbed.sh"
> > Comment=
> > Terminal=false
> > Icon=/home/alan/icons/testbed.png
> > Type=Application
> > StartupNotify=true
> > Name[en_GB]=Testbed
> >
> > I have fiddled about with the Exec line but nothing works.
> > I tried adding an output file >> testbed.txt but nothing was created.
> >
> > i have scanned the WWW but nothing covers it.
> >
> > Suggestions welcome.
> >
> > TIA
> >
> >
>
> Think you need to set the environmental var SUDO_ASKPASS to some sort of
> GUI "askpass" tool (seahorse seems to be included with LM) and call sudo
> with the '-A' and possibly '-E' options.
>
> for example, I have a zenity-based wireguard VPN script with the following:
>
> --
> export SUDO_ASKPASS=/usr/libexec/seahorse/ssh-askpass
> sudo -AE <privileged cmd>
> --
> I have printed that off. I will study it later in the week.

Thank you.

Alan

--
Linux Mint 21.1 kernel version 5.15.0-78-generic Cinnamon 5.6.8

Re: [OT] Executing a script requirinf sudu from a desktop icon

<ubblbj$2013s$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6649&group=alt.os.linux.mint#6649

  copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bea...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Re: [OT] Executing a script requirinf sudu from a desktop icon
Date: Sun, 13 Aug 2023 18:26:57 -0400
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <ubblbj$2013s$1@dont-email.me>
References: <20230813203309.adde18c55b8f0a253a419079@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 13 Aug 2023 22:26:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1833969bfdcd154f83c532e51696c559";
logging-data="2098300"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+nGB6KkT2zMe1zZ0oVoCWaqGWD+qul5qg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:+ot3ci7t/hdlu8OKPnOvjdToV20=
In-Reply-To: <20230813203309.adde18c55b8f0a253a419079@gmail.com>
Content-Language: en-US
 by: Big Al - Sun, 13 Aug 2023 22:26 UTC

On 8/13/23 15:33, this is what pinnerite wrote:
> The script is called testbed.sh
>
> The desktop file looks like this:
>
> [Desktop Entry]
> Name=Testbed
> Exec=gnome-terminal -e "sudo /bin/bash -c /home/alan/Scripts/testbed.sh"
> Comment=
> Terminal=false
> Icon=/home/alan/icons/testbed.png
> Type=Application
> StartupNotify=true
> Name[en_GB]=Testbed
>
> I have fiddled about with the Exec line but nothing works.
> I tried adding an output file >> testbed.txt but nothing was created.
>
> i have scanned the WWW but nothing covers it.
>
> Suggestions welcome.
>
> TIA
>
>
I have this as a script to sync files. It's not run as root, but I also have other scripts that at some point will hit
a sudo command and they just ask.

#!/usr/bin/env xdg-open
[Desktop Entry]
Comment=Sync contents of grive
Terminal=true
Name=Drive Sync
Exec=/home/alan/grive/grive_update.sh Manual
Type=Application
Icon=/home/alan/.icons/Icons/Sync-Arrows2.png
Name[en_US]=Sync

grive_update.sh will take an argument for a popup notification at the end. But it runs in a shell (Terminal=true)

--
Linux Mint 21.1 Cinnamon 5.6.8
Al

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor