Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: (OT?) Re: Zsh configuration files
- X-seq: zsh-users 13491
- From: "Matt Wozniski" <godlygeek@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: (OT?) Re: Zsh configuration files
- Date: Tue, 25 Nov 2008 13:50:19 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=lUmNLYMkqqD1IP1Epsue+C9CfgevX1ytLrSHjE+KT5Q=; b=iqhbP8+bHPEaXFKql80UUT74wRHW7hognWxLVwNr3jq5EIouElf+0K3LVY5Uf7lnqn ju91XU66+eR88sdypT6CHE0q6DkamtqR/n+UAGyJqZf6bbJM96n9H2lZNIqT7tFQrdIH wzO+9BouvcUp5TDC7GIabk6aRwTBZZCFwidUg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=O6uaCPAtTenG3bdNFMclfEwdt3G9KsarKSAuwj84FCX6bH44l0+nIqNpSvtckSKHrJ mZSIKvVg7VruqsW8r1++dKszaBrE+oFQRiogvA0x/H/AGXyaKQ9SV4A6Gy5EV7VRNObi ALZmb6RWR7RgvWmKFbjOv9xxXZ8sEONqrJlTg=
- In-reply-to: <alpine.LNX.2.00.0811251304340.5776@acer>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <ggbjfl$der$1@xxxxxxxxxxxxx> <2d460de70811230730v1a79f3b3rd73a020f99b66f02@xxxxxxxxxxxxxx> <ggcv5t$a88$1@xxxxxxxxxxxxx> <alpine.LNX.2.00.0811241643240.20698@xxxxxxxxxxxxxxx> <b2e43f8f0811250910l7828242bnf3c8e137756b2f16@xxxxxxxxxxxxxx> <alpine.LNX.2.00.0811251304340.5776@acer>
On Tue, Nov 25, 2008 at 1:26 PM, Benjamin R. Haskellwrote:
> On Tue, 25 Nov 2008, Allan Caffee wrote:
>
>> On Mon, Nov 24, 2008 at 5:33 PM, Benjamin R. Haskell
>> wrote:
>>
>>> Long ago, I set some things up for easily sharing my Zsh startup scripts
>>> between various computers I use. I did most of this when I was still fairly
>>> new to Zsh, so some things might have easier/better ways to do them, but
>>> this is how I set mine up. Some features:
>>>
>>> 1. Automatically runs any files matching .zsh_* in my home dir, excluding
>>> vim swap files
>>>
>>> 2. For running as root, I can just link my normal-user .zshrc and .zshenv
>>> files, and it'll detect that they're linked, and use the .zsh_* files from
>>> my normal-user directory
>>
>> That sounds really dangerous. You're offering a hook for someone to
>> execute arbitrary code as root. If someone breaks your user account they
>> could for example add a file in your home directory that resets the root
>> password or does some other really mean things. If you want root to have
>> the same setup as your regular user you should put it somewhere that only
>> root can write.
>
> I was thinking about that as I posted to the list, and since you pointed it
> out, maybe I'll get some general feedback... (sorry if this is too
> off-topic)
>
> Like many users (I suspect), most of the systems I'm talking about here are
> essentially single-user systems. I log in under a normal user account, but
> the only reason not to log in as root is 'rm -rf /' protection. (i.e. so as
> to not cause unintentional damage.) On other systems, either:
>
> 1) I don't have root access, so this doesn't apply
>
> 2) The systems are properly secured (running/behind a firewall,
> non-essential services are off, passwords are strong, system is kept
> up-to-date, and I only ever log in to my normal account via SSH with keys)
> [modulo, of course, this discussion]
>
> Am I really setting myself up for badness via this automated .zsh_* stuff?
Yes. Automatically running code as root that can be written by a
regular user is a very bad idea.
> And even beyond those reasons... I always got the impression that someone
> capable of using exploit X to break into a normal user's account had a
> pretty low barrier to using exploit Y to elevate their privileges to root.
> Is that not generally the case? [i.e. a system is only secure as its least
> secure user]
That's not really true at all. It's much harder to get root
privileges with a user regular account than to break into the
system... and with a setup like yours, you make it much much easier
for someone to run arbitrary code as root, and compromise the system
entirely. The fact that extracting a tarball in $HOME that extracts a
(hidden!) file name .zsh_* can cause a script to be run as root that
can do anything at all to the system is very, very bad.
~Matt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author