Bug#1024568: openssh-client: ignores $HOME environment variable

Colin Watson <[email protected]>
Newsgroups gmane.linux.debian.devel.ssh
Message-ID <Y3uOJfdfvf4qJ7Ta__30638.1933785573$1669041934$gmane$org@riva.ucam.org>
Control: forwarded -1 https://bugzilla.mindrot.org/show_bug.cgi?id=3048

On Mon, Nov 21, 2022 at 02:54:13PM +0100, Gabor Kiss wrote:
> I tried to run ssh client in a test environment with files (known_hosts, config etc.)
> from other than my usual /home/kissg/.ssh/ directory.
> So after reading the docs I just modified the HOME environment variable to /tmp/kissg.
> However the program henceforward used the original /home/kissg/.ssh/.
> 
> Checking the source I found that - in contrast to the man page - ssh client does not care
> with $HOME(*) but always uses home dir retrieved from passwd file.
> (So I have to give every file in the command line one by one.)
> 
> *: More precisely strace shows that ssh tried to open "/tmp/kissg/.ssh/config_autotest" once:
> newfstatat(AT_FDCWD, "/tmp/kissg/.ssh/config_autotest", 0x7ffda93d3cf0, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
> That is quite funny because this file name does not occur in the source.

The most current upstream bug for this is probably either
https://bugzilla.mindrot.org/show_bug.cgi?id=3048 or
https://bugzilla.mindrot.org/show_bug.cgi?id=3470, and those explain the
historical reasons why the design is the way it is.  I don't think
there's anything we can sensibly do in Debian about this, so I'll just
mark this as forwarded upstream.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.