On Thu, Aug 31, 2000 at 11:45:05AM +0200, Niels Mvller wrote:
> Jeff Bailey <[EMAIL PROTECTED]> writes:
> 
> > what I'm proposing is a hack of lsh-authorize that takes a -u argument 
> > for a username.  It should be an easy enough hack of the shell script and 
> > will save me much grief.  
> 
> Do I understand you correctly that the option will be quite useless
> unless you're running as root?

Yup. =)

> Assuming the public key to be authorized is already readable by the
> user in question, it occurs to me that
> 
>   lsh-authorize -u user key
> 
> would be more or less equivalent to
> 
>   su user lsh-authorize key

Hmm..  A little less equiv, I think: When you su to the user, you no 
longer have access to the files that root does.  This means copying the 
file to a place where the user can see it.  I tend to work from my home 
directory (When setting OpenSSH stuff up) and quickly su to copy files 
around.

> (this depends on su setting HOME correctly. BTW, what is the right way
> for a shell script to look up a user's home directory? Not all systems
> use /home/user for all accounts).

Every program I've seen defines 'HOME' for current user.  In your script 
you refer to ~ for the users home directory, so I was just going to 
append the option username to that - ~$username or something.  I'll have 
to try it, but I think it will be that easy for most Bourne shells.

> > Will you accept it?
> 
> Sure; if it makes lsh-authorize more convenient for you, hack away and
> send it to me or to the list.

Thanks.  I've got 20 accounts or so to setup today, and this will save 
alot of work.

-- 
"It is easy to be blinded to the essential uselessness of computers by
the sense of accomplishment you get from getting them to work at all."
 - Douglas Adams


Reply via email to