I find mixing su and sudo leads to bad juju.
I just use something like:
$ sudo -u amanda amcheck blah blah
You can also just do:
$ sudo -u amanda /bin/bash -l
.. to give yourself a login shell for the amanda account. Whether or not this
will work on your platform varies with the distro. (Debian and its derivatives
like to use account name 'backup' rather than account name 'amanda', for
example.)
In one of your examples below, you su into amanda, and then sudo into root from
there. I presume your discussion of what you do is flawed below, rather than
your understanding of the sudo and su commands.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Debra S Baddorf
Sent: Friday, February 6, 2015 11:38
To: Gene Heskett
Cc: Debra S Baddorf; [email protected]
Subject: Re: An odd problem...
How about temporarily actually logging in AS the privileged account, rather
than
just using SU ? You might have to edit /etc/passwd to allow the account
to be logged into. You could set it back later. I do the following, if I
don't want
to mess with SU (or if it isn't working right)
su - name-of-acct-with-privilege
<type acct password>
sudo bash
<type same password again to actually turn privs ON>
Now you are walking around with privs turned ON so be very very careful
This might show up an error that didn't show up earlier.
Deb Baddorf
On Feb 6, 2015, at 11:11 AM, Gene Heskett <[email protected]> wrote:
> Greetings all;
>
> I just had to install wheezy on a fresh disk, seems the old disk with
> the Lucid install on it ran out of ink and cannot be written to.
>
> Using the same build script as always, invoked by sudo -i cd
> /home/amanda su amanda -c "./gh.cf"
> su: Authentication failure
> (Ignored)
> which then goes on to run the gh.cf script as usual!
>
> It first does a make clean; ../configure with a list of options, same
> as forever.
> It finishes up doing a make, and no errors are reported. Other than
> the auth failure reported and ignored above.
>
> as root, make install. No errors.
>
> then:
> su amanda -c "amcheck Daily"
> root@coyote:/home/amanda# su amanda -c "amcheck Daily"
> su: Authentication failure
> (Ignored)
> sh: 1: amcheck: not found
>
> But amcheck is sitting in /usr/local/sbin. And its in the $PATH.
>
> The amanda stuff in both the old /etc/passwd and this one are
> identical, as is the old group and new group.
>
> Next to check?
>
> Thanks.
>
> Cheers, Gene Heskett
> --
> "There are four boxes to be used in defense of liberty:
> soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author)
> Genes Web page <http://geneslinuxbox.net:6309/gene>
> US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS