Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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?

share|improve this question

closed as too localized by Izzy, roxan, Al E., Zuul, Richard Borcsik Sep 12 '12 at 13:42

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

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

1 Answer 1

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.