Terminal emulator's ssh trying to read /data/.ssh instead of $HOME/.ssh When I try using Terminal emulator's ssh I get


  ssh: Warning: failed creating /data/.ssh: Permission denied.


or since 2012-08-19:


  Could not create directory '/data/ssh_client'.


But when I type:

echo $HOME
/sdcard


Why isn't ssh checking /sdcard/.ssh or /sdcard/ssh_data?
This doesn't happen when you run ssh as root.
/sdcard is an unsafe(!) location for ssh client config and valuable keys (some users don't even encrypt their keys for reasons of laziness). Each app has read access to that location, so this is most probably set deliberately not to /sdcard/.ssh for security reasons.
If you have root access, create a symlink from /data/ssh_data or /data/.ssh to /data/jackpal.androidterm/ or create the folder with appropriate access rights for the terminal app (not system wide read/write though!).
By the way:
This might be fixed soon. See CyanogenMod's github commit log here. Excerpt:

Some users have / as home directory, some /data. This commit fixes ssh
and ssh-keygen trying to create /.ssh which is volatile and read-only
anyway.
To allow an app (e.g. Android Terminal Emulator) to use ssh
/data/ssh_client still has to exist and owner permissions need to be
set to the app user. This could be fixed by using the real data
directory (/data/data/&quot;app&quot;) in a later commit.