ssh: HOME variable issue I'm in Cyanogenmod 13 and I'm having troubles getting ssh working properly.

Server:
With AuthorizedKeysFile commented in the sshd_config file, I get a weird path in logcat:

Could not open authorized keys '//.ssh/authorized_keys': No such file or directory


I set AuthorizedKeysFile and the server seems to work with no more problems.

Still I cannot get the client working:

root@i9300:/ # ssh 192.168.0.20
Could not create directory '/.ssh'.
The authenticity of host '192.168.0.20 (192.168.0.20)' can't be established.
ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/.ssh/known_hosts).
Permission denied (publickey).


As you can see ssh is trying to create the directory /, and we all know that it is not possible.
All of this led me to the conclusion that there might be something wrong with the environment variable HOME.

Another piece of information:

root@i9300:/ # echo $HOME
/data
root@i9300:/ # su shell
shell@i9300:/ $ echo $HOME
/


Many thanks in advance for your help!
Here is a solid workaround which requires a bit of work if you are not accustomed with the subject:
Edit BOOT partition.  

In the BOOT partition (boot.img) are stored all the files that will be loaded in / at boot.
I added a symlink in it:

.ssh -&gt; /data/.ssh


Here are two very helpful tutorials that will get you going:
HOWTO: Unpack, Edit, and Repack Boot Images
Android boot.img manipulation  

a little hint:
Do edit the ramdisk in your Android device.
I spent three days in frustration trying to do so in my pc, I guess is a matter of "endianness".