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!
-i IDENTITY_FILE
and provide config using -F. $HOME is perfectly fine. Permissions on/data
are beyond the privilege shell user can have.ssh 192.168.0.20 -i /data/.ssh/id_rsa
does the job. I'd be very happy if someone could tell me where a template for ssh_config file is, it doesn't seem to exist. The problem of creating/.ssh/known_hosts
remains. I managed a workaround creating the symlink/.ssh -> /data/.ssh/
. It is not possible to create it by shell/script because I get errorRead-only file system
(even with/system
mounted rw). I did manage with CMFileManager, and I wish I knew how it has done it!!/.ssh
will disappear at every boot and I'd like to create a script to sort this out