Bash script as root problem
Gene Heskett
gheskett at wdtv.com
Sun Mar 17 12:21:50 UTC 2013
On Sunday 17 March 2013 07:47:49 Colin Law did opine:
> On 17 March 2013 00:19, Gene Heskett <gheskett at wdtv.com> wrote:
> > On Saturday 16 March 2013 20:18:40 Bill K. Dengler did opine:
> >> A little hacky but what about
> >> sudo command_0
> >> sudo command_1
> >> sudo command_2
> >> sudo command_3
> >> sudo command_4
> >> sudo command_5
> >> sudo command_6
> >> su -c "command_7" $USER
> >> sudo command_8
> >> sudo command_9
> >>
> >> Bill
> >
> > Wrong syntax Bill, its
> > su user -c "command_7"
>
> man su says
> su [options] [username]
>
> Colin
Go ahead. Try it Colin, I'll wait. ;)
BTDT, the man page is incomplete and has been so for nearly 15 years.
Furinstance, much of amanda, the backup program will not run as root, its
part of their security to use no more permissions than it takes to get the
job don. So you setup a user with rights to run amanda. Usually named
amanda but could be most anything. That use is not even set with a
password, so it is only accessible to root. Copy paste from another screen
2 minutes ago, I am root via a sudo -i at the instant:
root at coyote:/home/gene/src/linux-3.8.2# su amanda -c "amcheck Daily"
Amanda Tape Server Host Check
-----------------------------
Holding disk /usr/dumps: 674148 MB disk space available, using 673648 MB
ERROR: directory '/amandatapes/Dailys' does not exist
Server check took 0.761 seconds
Amanda Backup Client Hosts Check
--------------------------------
Client check: 3 hosts checked in 2.716 seconds. 0 problems found.
(brought to you by Amanda 4.0.0alpha.svn.4761)
===========
Obviously that drive wasn't mounted as I am just now setting up amanda
again. The directory does exist, along with 30 virtual tapes.
Now, if we could just get someone to actually fix the %@$#&@( man page so
we don't have this argument everytime someone wants run su, not to get
root, but to get another user from root. There is a difference.
Cheers, Gene
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
My views
<http://www.armchairpatriot.com/What%20Has%20America%20Become.shtml>
One man's Mede is another man's Persian.
-- George M. Cohan
I was taught to respect my elders, but its getting
harder and harder to find any...
More information about the ubuntu-users
mailing list