Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #211421

Re: Buster install

From Andrei POPESCU <andreimpopescu@gmail.com>
Newsgroups linux.debian.user
Subject Re: Buster install
Date 2019-07-16 09:10 +0200
Message-ID <ykpL3-5oc-3@gated-at.bofh.it> (permalink)
References <yjwYh-4Se-1@gated-at.bofh.it> <yjyx4-5VC-11@gated-at.bofh.it> <yjGkV-2kh-11@gated-at.bofh.it> <yka9k-3XI-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Lu, 15 iul 19, 10:20:34, Greg Wooledge wrote:
> 
> The implementation of su in stretch-and-earlier is the best of all worlds.
> You get PATH set correctly before and after, you get to keep all of your
> customized environment settings like $PAGER and $LESS, and it doesn't
> change your working directory in the middle of your workflow.

It's probably not affecting me because of a different workflow.
 
> What are the replacement choices?
> 
>  * "su -" throws away your custom environment AND changes your working
>    directory.
> 
>  * "sudo -i" throws away your custom environment AND changes your working
>    directory.
> 
>  * "sudo -s" throws away most of your custom environment (unless configured
>    in a non-default way).
> 
>  * Putting /usr/local/sbin (et al.) in your regular PATH and using "su"
>    lets you keep your custom environment and your working directory, at
>    the cost of inefficiency when you're not root.  This may be extremely
>    difficult with some Display Managers.
> 
>  * Putting ALWAYS_SET_PATH yes in /etc/login.defs lets you keep your
>    customized enviornment and your working directory, without imposing
>    an extra cost when you're not root.
> 
> Objectively, the last one is the best choice, but I have *just* enough
> inertia that I don't really want to do that... so I've settled for sudo -s.
> For now, anyway.  I reserve the right to change my mind and do something
> else if I get sufficiently annoyed.

Let me suggest an alternative workflow:

  * Do everything from a user account, except for the (very few) actions 
    that actually require elevated privileges.


Looking up man pages, retrieving package information, check networking 
info[1], etc. is only ever done from the user account. I switch to root 
only when I need to do apt update/upgrade/install/etc., edit 
configuration files, restart daemons/system, etc.

This has the nice (for me) side effect that the root environment 
requires very little (if any) customization[2] as all customizations I 
really care about are done for my user account.

In practice I'm doing this with screen configured to always start a user 
shell and a root shell (using sudo -i). This also provides me with a 
consistent environment, regardless if I'm logged in locally or via ssh.


[1] iproute2 (i.e. ip and friends) have been a major improvement for my 
workflow in this regard, in addition to being shorter to type ;)

[2] currently the only customization I need for root is
'update-alternatives --config editor', which is useful for the user 
account as well ;) It also helps that vim in its default configuration 
has enough advanced features for my use.

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Buster install Curt Howland <Howland@priss.com> - 2019-07-13 22:40 +0200
  Re: Buster install Ansgar Burchardt <ansgar@43-1.org> - 2019-07-13 23:10 +0200
  Re: Buster install Curt Howland <Howland@priss.com> - 2019-07-13 23:30 +0200
    Re: Buster install <tomas@tuxteam.de> - 2019-07-14 00:10 +0200
      Re: Buster install Andrei POPESCU <andreimpopescu@gmail.com> - 2019-07-14 08:20 +0200
        Re: Buster install <tomas@tuxteam.de> - 2019-07-14 11:50 +0200
          Re: Buster install Greg Wooledge <wooledg@eeg.ccf.org> - 2019-07-15 16:00 +0200
  Re: Buster install Curt Howland <Howland@priss.com> - 2019-07-14 00:20 +0200
    Re: Buster install Andrei POPESCU <andreimpopescu@gmail.com> - 2019-07-14 08:40 +0200
      Re: Buster install Nicholas Geovanis <nickgeovanis@gmail.com> - 2019-07-14 21:30 +0200
      Re: Buster install Greg Wooledge <wooledg@eeg.ccf.org> - 2019-07-15 16:30 +0200
        Re: Buster install Andrei POPESCU <andreimpopescu@gmail.com> - 2019-07-16 09:10 +0200
          Re: Buster install Greg Wooledge <wooledg@eeg.ccf.org> - 2019-07-16 15:20 +0200

csiph-web