From nobody Thu Aug 19 06:16:32 2021 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2DF1E17730CF for ; Thu, 19 Aug 2021 06:16:47 +0000 (UTC) (envelope-from jonc@chen.org.nz) Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gqvg30g1mz3J6F for ; Thu, 19 Aug 2021 06:16:46 +0000 (UTC) (envelope-from jonc@chen.org.nz) Received: by mail-ot1-x32c.google.com with SMTP id 61-20020a9d0d430000b02903eabfc221a9so7452410oti.0 for ; Wed, 18 Aug 2021 23:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chen-org-nz.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2lTr2Dkm8Tj3MMhwewE2Avh47cZgqaur2mzSKopqCcc=; b=D0JK6qbjCWqmhxehjh7GyJty6JiIiv7UpaxhowMBSRbDrdEpgPvmXclTMm13hz9rtv zFfns80tezi+dgpTt8KArpx1IP6q49SHzuDzWWuTx8/Izej9aopRhz7tOXeSqwXIc8pt VorDBnsn7vIuBAyuFOpK32LTg2HKEtCYllQp7ay8rslo2DtJbIOrIfHDkSbTWyXyUIUV F8xjMM32zrJFpyTDY7Dn0YI3eRYf2/bycDaMNaFlnPn9CiC106HMt9g2KGKdBjJUOnyB 6iGs349s0+CGajRBHWVAmehmOpjm+BQkWqqyfmnP4XPpKUz5eEmx9vBDbPVZ6pJIHvSj GlWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2lTr2Dkm8Tj3MMhwewE2Avh47cZgqaur2mzSKopqCcc=; b=Jc9frpimXXJ3P3ufinnIM9xO7donPOoGz2jCvHuNSD9GA8V+B4Hf2OO7id160Fil6G o2ju+lk4urVQ2zFgmrF900HKh+UAZujKWEqFhGlQ0DHnGuy6b51WvrXSuSS5lb9oyCAm 5YKu7mAwFAQzsX31j0W/lqcg8408tQrLvfsoFEzxe2QOgQt7o87mhEkrdReYj0YtX++j 19ZzawdmdBdskokrOLD8jVFuz/TFscaxWwh1z7326Iw6fAe4WlUUnLbpdfR4OO5EU6L3 9F31VDCQmlGc3h2s2d9ZNzwA2DJEWXLWq9Xx1F9MvcMZkbxjJSD/84hY5K0naXr+TfuA /Qvg== X-Gm-Message-State: AOAM533UuJ2FgT2VcW6ej42QYWTMqWE9mSQajjxhhuV/ekrewtH6us6l AioB4m6ZUFrsJBcrwmzTGBgdrLojLZkkeze6r5CLecno/DU= X-Google-Smtp-Source: ABdhPJwrWC7YleX71taJkEMB0yNiiF3HW6FBmRu9MW6xECUHDd7OrF6DVbQKUZaR7jdrqEB1Ds+Nl+KN15oBa0LPOmg= X-Received: by 2002:a9d:4c89:: with SMTP id m9mr10918873otf.255.1629353806230; Wed, 18 Aug 2021 23:16:46 -0700 (PDT) List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Chen Date: Thu, 19 Aug 2021 18:16:32 +1200 Message-ID: Subject: Re: Run script as root without sudo To: ari@ish.com.au Cc: freebsd-stable Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4Gqvg30g1mz3J6F X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, 19 Aug 2021 at 17:33, Aristedes Maniatis via freebsd-stable wrote: [...] > How else can I get this script running as root remotely in a completely > unattended way? The way it's usually done is with an rc script in /usr/local/etc/rc.d, eg: /usr/local/etc/rc.d/myscript and add the entry into /etc/rc.conf: myscript_enable="YES" The FreeBSD AWS instances uses this method to auto-install required packages. Cheers. -- Jonathan Chen