7

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?

3
  • 3
    That is a question you should ask the author of the terminal emulator app.
    – Robert
    Dec 21, 2011 at 9:11
  • @Robert: Good suggestion, I will try that :-)
    – Dan
    Dec 21, 2011 at 18:57
  • Added source link and info... I find this question legitimate, btw. See my answer...
    – ce4
    Aug 31, 2012 at 8:08

1 Answer 1

3

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/"app") in a later commit.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .