Why do all the sudo? [was Re: Software updater no longer functional]

Robert Heller heller at deepsoft.com
Sun Jan 22 17:12:35 UTC 2017


At Sun, 22 Jan 2017 16:47:05 +0000 "Ubuntu user technical support,  not for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:

> 
> Chris,
> 
> On Sun, 2017-01-22 at 12:37 +0000, Chris Green wrote:
> > This is a classic case where I wonder why not change:-
> > 
> > > 
> > > Next steps:
> > > 
> > > sudo apt-get install -f
> > > 
> > >  -- fixes any package errors
> > > 
> > > NOTE THEM DOWN if it doesn't work & tell us
> > > 
> > > sudo apt-get clean
> > > 
> > >  -- empty the package cache
> > > 
> > > sudo apt-get autoremove -y
> > > 
> > >  -- remove obsoleted packages & ones nothing else use
> > > 
> > > sudo touch /forcefsck
> > > sudo shutdown -r now
> > > 
> > 
> > to:-
> > 
> > > 
> > > Next steps:
> > > 
> > > sudo -i
> > > apt-get install -f
> > > 
> > >  -- fixes any package errors
> > > 
> > > NOTE THEM DOWN if it doesn't work & tell us
> > > 
> > > apt-get clean
> > > 
> > >  -- empty the package cache
> > > 
> > > apt-get autoremove -y
> > > 
> > >  -- remove obsoleted packages & ones nothing else use
> > > 
> > > touch /forcefsck
> > > shutdown -r now
> > > 
> > 
> > It saves typing!  :-)
> > 
> > This is by no means the worst case, you often see great streams of
> > 'sudo this' and 'sudo that' in descriptions of how to do things.
> > 
> 
> Yep! Couldn't agree more. I use 'sudo -i' a lot! But it's rarely
> suggested in any advice or documentation I've seen.

This is intentional.

sudo -i is *dangerous* for exactly the same reason "su" is dangerous.  One 
of the whole points of sudo was to avoid logging in as root or using the su 
command.  Before sudo was "invented", UNIX sys admins regularly logged in as 
root and/or used su to gain a root shell.  And just as often shot themselves 
in the foot.  Sudo is very much like the safety lever on guns -- the point is 
to prevent accidents.

It is far too easy to *forget* that one is root and do something stupid.  Also 
it is possible to leave your system open to someone sitting down at your 
screen and doing something bad.

It is *always* preferable to prefix one command at a time with sudo.

This is proper system administration 101.

One of the *strong* things about Linux is that one *never* just logs in as the
"administrator" (root). One of the *weak* features of MS-Windows is that
people often log in as an administrator user. 

> 
> Regards,
> Tony.

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller at deepsoft.com       -- Webhosting Services
                             




More information about the ubuntu-users mailing list