Subject: Re: ssh use of $HOME
To: None <current-users@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: current-users
Date: 01/31/2007 20:17:04
In article <C2F9C3CC-9775-4566-B51A-20C0624673CF@planix.com>,
Andreas Wrede  <andreas@planix.com> wrote:
>-=-=-=-=-=-
>
>In NetBSD 4.0_BETA2 (and presumable -current), ssh sessions started  
>from cron jobs fail with "Host key verification failed".  The cause  
>of this is the patch from PR/13738, committed on Sep 18, 2005 to src/ 
>crypto/dist/ssh/tildexpand.c (now in src/crypto/dist/ssh/misc.c)  
>together with crontab's default HOME=/var/log setting. This causes  
>ssh to look for the id_* files in /var/log/.ssh/.
>
>The original PR author's reason for the patch was "ssh(1) talks about  
>$HOME/.ssh...".  The ssh man page replaced $HOME with ~ in OpenBSD  
>rev 1.206 of ssh.1.
>
>I think the patch should be reverted.

I don't disagree with you [that the patch should be reversed], but:

What is the meaning of `~'? I presume that you would like `~' to
mean "the user's home directory as specified in /etc/passwd (pw_dir)".
Well, this is not exactly right. The `~' first got a special meaning
when it became part of the globbing special characters in csh(1)
meaning the current location of the home directory (from the value of
$HOME). So still today:

% set home=/var/tmp	# csh mirrors $home -> $HOME
% echo $HOME
/var/tmp
% cd ~
% pwd
/var/tmp

So even if the patch is reversed, the manual page needs to be corrected.

christos