Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.os.linux > #64445 > unrolled thread

How to allow execution of a script requiring root privileges?

Started byBengt T <bengt_tornqvist@hotmail.com>
First post2020-04-08 10:02 -0700
Last post2020-04-09 22:58 -0700
Articles 7 on this page of 47 — 16 participants

Back to article view | Back to alt.os.linux


Contents

  How to allow execution of a script requiring root privileges? Bengt T <bengt_tornqvist@hotmail.com> - 2020-04-08 10:02 -0700
    Re: How to allow execution of a script requiring root privileges? "Carlos E.R." <robin_listas@es.invalid> - 2020-04-08 19:20 +0200
      Re: How to allow execution of a script requiring root privileges? Aragorn <thorongil@telenet.be> - 2020-04-08 19:54 +0200
        Re: How to allow execution of a script requiring root privileges? Aragorn <thorongil@telenet.be> - 2020-04-08 19:58 +0200
          Re: How to allow execution of a script requiring root privileges? Soviet_Mario <SovietMario@CCCP.MIR> - 2020-04-08 21:30 +0200
            Re: How to allow execution of a script requiring root privileges? Aragorn <thorongil@telenet.be> - 2020-04-08 21:35 +0200
              Re: How to allow execution of a script requiring root privileges? Soviet_Mario <SovietMario@CCCP.MIR> - 2020-04-09 16:03 +0200
    Re: How to allow execution of a script requiring root privileges? Ned Latham <nedlatham@woden.valhalla.oz> - 2020-04-08 13:00 -0500
      Re: How to allow execution of a script requiring root privileges? "J.O. Aho" <user@example.net> - 2020-04-08 20:13 +0200
        Re: How to allow execution of a script requiring root privileges? "Carlos E.R." <robin_listas@es.invalid> - 2020-04-08 20:27 +0200
        Re: How to allow execution of a script requiring root privileges? Richard Kettlewell <invalid@invalid.invalid> - 2020-04-09 09:20 +0100
          Re: How to allow execution of a script requiring root privileges? "J.O. Aho" <user@example.net> - 2020-04-09 11:46 +0200
      Re: How to allow execution of a script requiring root privileges? Bengt T <bengt_tornqvist@hotmail.com> - 2020-04-08 12:23 -0700
        Re: How to allow execution of a script requiring root privileges? Ned Latham <nedlatham@woden.valhalla.oz> - 2020-04-08 19:36 -0500
      Re: How to allow execution of a script requiring root privileges? Bengt T <bengt_tornqvist@hotmail.com> - 2020-04-08 12:25 -0700
        Re: How to allow execution of a script requiring root privileges? "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2020-04-08 19:29 -0400
    Re: How to allow execution of a script requiring root privileges? F Russell <fr@random.info> - 2020-04-08 21:32 +0000
      Re: How to allow execution of a script requiring root privileges? mGhost <mGhost@mouse-potato.com> - 2020-04-08 21:47 +0000
        Re: How to allow execution of a script requiring root privileges? Wildman <best_lay@yahoo.com> - 2020-04-08 17:00 -0500
          Re: How to allow execution of a script requiring root privileges? mGhost <mGhost@mouse-potato.com> - 2020-04-08 22:15 +0000
            Re: How to allow execution of a script requiring root privileges? Wildman <best_lay@yahoo.com> - 2020-04-08 19:05 -0500
              Re: How to allow execution of a script requiring root privileges? mGhost <mGhost@mouse-potato.com> - 2020-04-09 00:12 +0000
                Re: How to allow execution of a script requiring root privileges? Wildman <best_lay@yahoo.com> - 2020-04-08 21:03 -0500
              Re: How to allow execution of a script requiring root privileges? "Carlos E.R." <robin_listas@es.invalid> - 2020-04-09 13:50 +0200
                Re: How to allow execution of a script requiring root privileges? Melzzzzz <Melzzzzz@zzzzz.com> - 2020-04-09 14:29 +0000
                  [OT] Re: How to allow execution of a script requiring root privileges? Bit Twister <BitTwister@mouse-potato.com> - 2020-04-09 10:19 -0500
        Re: How to allow execution of a script requiring root privileges? F Russell <fr@random.info> - 2020-04-08 22:10 +0000
          Re: How to allow execution of a script requiring root privileges? mGhost <mGhost@mouse-potato.com> - 2020-04-08 22:20 +0000
            Re: How to allow execution of a script requiring root privileges? F Russell <fr@random.info> - 2020-04-08 22:37 +0000
              Re: How to allow execution of a script requiring root privileges? mGhost <mGhost@mouse-potato.com> - 2020-04-08 22:56 +0000
            Re: How to allow execution of a script requiring root privileges? "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2020-04-08 19:33 -0400
              Re: How to allow execution of a script requiring root privileges? mGhost <mGhost@mouse-potato.com> - 2020-04-08 23:50 +0000
                Re: How to allow execution of a script requiring root privileges? "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2020-04-08 21:23 -0400
                  Re: How to allow execution of a script requiring root privileges? mGhost <mGhost@mouse-potato.com> - 2020-04-09 02:45 +0000
                Re: How to allow execution of a script requiring root privileges? Bit Twister <BitTwister@mouse-potato.com> - 2020-04-08 23:29 -0500
                Re: How to allow execution of a script requiring root privileges? Martyn Barclay <mby@dev.null> - 2020-04-09 07:33 +0100
                Re: How to allow execution of a script requiring root privileges? "Carlos E.R." <robin_listas@es.invalid> - 2020-04-09 13:47 +0200
          Re: How to allow execution of a script requiring root privileges? Aragorn <thorongil@telenet.be> - 2020-04-09 10:20 +0200
            Re: How to allow execution of a script requiring root privileges? Martyn Barclay <mby@dev.null> - 2020-04-09 11:15 +0100
      Re: How to allow execution of a script requiring root privileges? Ned Latham <nedlatham@woden.valhalla.oz> - 2020-04-08 19:39 -0500
        Re: How to allow execution of a script requiring root privileges? "J.O. Aho" <user@example.net> - 2020-04-09 09:30 +0200
      Re: How to allow execution of a script requiring root privileges? "J.O. Aho" <user@example.net> - 2020-04-09 09:28 +0200
        Re: How to allow execution of a script requiring root privileges? Martyn Barclay <mby@dev.null> - 2020-04-09 11:01 +0100
    Re: How to allow execution of a script requiring root privileges? Jasen Betts <jasen@xnet.co.nz> - 2020-04-09 11:06 +0000
    Re: How to allow execution of a script requiring root privileges? Allodoxaphobia <trepidation@example.net> - 2020-04-09 17:00 +0000
      Re: How to allow execution of a script requiring root privileges? Allodoxaphobia <trepidation@example.net> - 2020-04-10 17:42 +0000
    Re: How to allow execution of a script requiring root privileges? Bengt T <bengt_tornqvist@hotmail.com> - 2020-04-09 22:58 -0700

Page 3 of 3 — ← Prev page 1 2 [3]


#64484

From"J.O. Aho" <user@example.net>
Date2020-04-09 09:30 +0200
Message-ID<hf818sFpia2U2@mid.individual.net>
In reply to#64470
On 09/04/2020 02.39, Ned Latham wrote:
> F Russell wrote:
>> Bengt T wrote:
>>>
>>> In my backup script, using rsync, some directories/files will not be processed
>>> because they are only accessible by root. My way around this is to use "sudo
>>
>> Your "way around" should be to boot up as the root user and
>> stay as the root user.
>>
>> For the single-user workstation this is the ONLY way.
> 
> It's madness.
> 
>> I still hear moans and groans about running as root but
>> all of that security nonsense is just that: nonsense.
>> They can always spout off with generalities but they
>> can never provide specific examples about how a single-user
>> workstation can be compromised by running as root.
> 
> cd /
> rm *

That one wouldn't make much of damage, as / tends to just have 
directories, on the other hand the following oneliner would do what you 
thought of: rm -rf /

That would be possible to execute from a javascript when someone visits 
your home page.

-- 

  //Aho

[toc] | [prev] | [next] | [standalone]


#64483

From"J.O. Aho" <user@example.net>
Date2020-04-09 09:28 +0200
Message-ID<hf814mFpia2U1@mid.individual.net>
In reply to#64456
On 08/04/2020 23.32, F Russell wrote:
> On Wed, 08 Apr 2020 10:02:47 -0700, Bengt T wrote:
> 
>> In my backup script, using rsync, some directories/files will not be processed
>> because they are only accessible by root. My way around this is to use "sudo
>>
> 
> Your "way around" should be to boot up as the root user and
> stay as the root user.

Then you have lowered your system security to the level of microsoft 
windows with a window run as administrator (you don't need to be logged 
in as administrator).


> For the single-user workstation this is the ONLY way.

No, that is only the wrong way to do things.


> I still hear moans and groans about running as root but
> all of that security nonsense is just that: nonsense.

You remember that bug steam had a few yours around, where they got the 
paths wrong, you as root would have wiped your hard drive, for everyone 
one else it was your users files that was gone.


> They can always spout off with generalities but they
> can never provide specific examples about how a single-user
> workstation can be compromised by running as root.

With all the CPU vulnerabilities, a javascript can execute system 
binaries, which in your case mean someone would have full control of 
your system, your only luck is that Linux not as targeted as microsoft 
windows.

-- 

  //Aho

[toc] | [prev] | [next] | [standalone]


#64488

FromMartyn Barclay <mby@dev.null>
Date2020-04-09 11:01 +0100
Message-ID<pan.2020.04.09.10.01.40.23557@dev.null>
In reply to#64483
On Thu, 09 Apr 2020 09:28:21 +0200, J.O. Aho wrote:

> On 08/04/2020 23.32, F Russell wrote:
>> On Wed, 08 Apr 2020 10:02:47 -0700, Bengt T wrote:
>> 
>>> In my backup script, using rsync, some directories/files will not be
>>> processed because they are only accessible by root. My way around this
>>> is to use "sudo
>>>
>>>
>> Your "way around" should be to boot up as the root user and stay as the
>> root user.
> 
> Then you have lowered your system security to the level of microsoft
> windows with a window run as administrator (you don't need to be logged in
> as administrator).

+1
 
>> For the single-user workstation this is the ONLY way.
> 
> No, that is only the wrong way to do things.

It is, absolutely the /wrong/ way to do things.
 
>> I still hear moans and groans about running as root but all of that
>> security nonsense is just that: nonsense.
> 
> You remember that bug steam had a few yours around, where they got the
> paths wrong, you as root would have wiped your hard drive, for everyone
> one else it was your users files that was gone.
> 
> 
>> They can always spout off with generalities but they can never provide
>> specific examples about how a single-user workstation can be compromised
>> by running as root.
> 
> With all the CPU vulnerabilities, a javascript can execute system
> binaries, which in your case mean someone would have full control of your
> system, your only luck is that Linux not as targeted as microsoft windows.

-- 
Debian 10.2 "Buster"  

[toc] | [prev] | [next] | [standalone]


#64490

FromJasen Betts <jasen@xnet.co.nz>
Date2020-04-09 11:06 +0000
Message-ID<r6mvjc$s1g$3@gonzo.revmaps.no-ip.org>
In reply to#64445
On 2020-04-08, Bengt T <bengt_tornqvist@hotmail.com> wrote:
> In my backup script, using rsync, some directories/files will not be processed because they are only accessible by root. My way around this is to use "sudo my_backup.script" and provide a password.
>
> My wish is to allow execution of the backup script directly without "sudo..." and password.
>
> Is/are there any way/s to accomplish this?


have the script sudo itself.


     (( $( id -u ) )) || exec sudo "$0" "$@"


-- 
  Jasen.

[toc] | [prev] | [next] | [standalone]


#64509

FromAllodoxaphobia <trepidation@example.net>
Date2020-04-09 17:00 +0000
Message-ID<slrnr8ul5u.p1h.trepidation@vps.jonz.net>
In reply to#64445
On Wed, 8 Apr 2020 10:02:47 -0700 (PDT), Bengt T wrote:

> In my backup script, using rsync, some directories/files will not be 
> processed because they are only accessible by root. My way around this 
> is to use "sudo my_backup.script" and provide a password.
>
> My wish is to allow execution of the backup script directly without 
> "sudo..." and password.
>
> Is/are there any way/s to accomplish this?

I see no one has suggested cron.
Configure a cron job (script) to do what you wish.

Setting the resultant file (backup) permissions 
is left as an exercise for grasshopper.  :-)

Jonesy
-- 
  Marvin L Jones    | Marvin      | W3DHJ.net  | linux
   38.238N 104.547W |  @ jonz.net | Jonesy     |  FreeBSD
    * Killfiling google & XXXXbanter.com: jonz.net/ng.htm

[toc] | [prev] | [next] | [standalone]


#64540

FromAllodoxaphobia <trepidation@example.net>
Date2020-04-10 17:42 +0000
Message-ID<slrnr91c0i.1imt.trepidation@vps.jonz.net>
In reply to#64509
On 9 Apr 2020 17:00:46 GMT, Allodoxaphobia wrote:
> On Wed, 8 Apr 2020 10:02:47 -0700 (PDT), Bengt T wrote:
>
>> In my backup script, using rsync, some directories/files will not be 
>> processed because they are only accessible by root. My way around this 
>> is to use "sudo my_backup.script" and provide a password.
>>
>> My wish is to allow execution of the backup script directly without 
>> "sudo..." and password.
>>
>> Is/are there any way/s to accomplish this?
>
> I see no one has suggested cron.
> Configure a cron job (script) to do what you wish.

Sorry - Missing an important adjective:
  Configure a root cron job (script) to do what you wish.

> Setting the resultant file (backup) permissions 
> is left as an exercise for grasshopper.  :-)

Jonesy

[toc] | [prev] | [next] | [standalone]


#64524

FromBengt T <bengt_tornqvist@hotmail.com>
Date2020-04-09 22:58 -0700
Message-ID<1890d18d-46ba-48c1-87b4-99db85acf7cb@googlegroups.com>
In reply to#64445
After reading received advises and some further reading it seems to me that I should add the information ("bengt All =...") into a new file /etc/sudoers.d/bengt.

Thank you all who contributed in answering my question.

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | alt.os.linux


csiph-web