# ssh HOME environment variable



## TroT (Jan 7, 2012)

```
# mkdir /test
# setenv HOME /test
# ssh -v localhost
```

OUTPUT:

```
OpenSSH_5.8p2_hpn13v11 FreeBSD-20110503, OpenSSL 0.9.8q 2 Dec 2010
...
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
...
```

How to change $HOME for ssh?


----------



## phoenix (Jan 7, 2012)

Change the user you login as via the ssh command:
`$ ssh someuser@localhost`
IOW, create a "test" user, with "/test" as the home directory.  Then login via SSH as user "test".


----------



## TroT (Jan 7, 2012)

A remote user and remote home folder do not interest me. I need to specify a special path for known_hosts file. I was hoping for a change of variable $HOME.


----------



## casdal (Jan 8, 2012)

If you're trying to do is supply a different known_hosts file, there's an easier way to do it: 


```
ssh -o UserKnownHostsFile=/path/to/other/known_hosts -v localhost
```


----------



## TroT (Jan 10, 2012)

Thank you


----------

