Gentoo Archives: gentoo-user

From: Grant Taylor <gtaylor@×××××××××××××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] logging my activity for audits
Date: Wed, 12 Sep 2018 15:39:53
Message-Id: ce3cfec1-ef5e-2069-ce09-6edc26bfc328@spamtrap.tnetconsulting.net
In Reply to: Re: [gentoo-user] logging my activity for audits by "J. Roeleveld"
1 On 09/12/2018 12:24 AM, J. Roeleveld wrote:
2 > Does sudo have a shell-mode?
3
4 You can use "-i" to invoke a shell, but that's just the target users
5 destination shell.
6
7 I prefer to use a utility (wrapper) that I wrote that allows me to
8 leverage sudo in my user shell without having to think about it.
9
10 Link - Sudify
11 - https://dotfiles.tnetconsulting.net/tools/sudify/sudify.html
12
13 TL;DR: Sudify lets me use all the power of sudo without having to think
14 about it. It does what I want without getting in my way or me thinking
15 about sudo.
16
17 Sudify is a simple wrapper that sits in your (optionally personal) $PATH
18 that uses the base name to call sudo for you. You then create
19 sym-links from the command names that you want to sudify. Actually,
20 sudify does this for you. I.e.:
21
22 $ sudify ip
23
24 Will create a sym-link from (by default) ~/bin/ip to ~/bin/sudify.
25
26 Note: I've been using ~/bin, but nothing prevents using
27 /usr{/local,}/bin if you want to do this system wide.
28
29 Thus when ever I type ip at my normal users command prompt, it actually
30 invokes sudify, which sees that the sym-link's base name is ip, and
31 automatically runs sudo with the full path tot he real ip command.
32
33 This allows me to do a LOT of things that normally require "sudo
34 $command…" without ever needing to think about it. I've gotten to the
35 point that almost all of my sudo interaction is through sudify.
36
37 All of this is logged via sudo's standard logging mechanisms, which can
38 be off box.
39
40
41
42 --
43 Grant. . . .
44 unix || die