From 4ed726b316e0afc8e0c58e39911e5073b554e4f2 Mon Sep 17 00:00:00 2001 From: Greg Alexander Date: Mon, 16 Dec 2019 09:03:24 -0500 Subject: [PATCH] Alex confirms that restorecon -F authorized_keys works, so added it to the documentation. --- NOTES | 2 +- doc/index.html | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/NOTES b/NOTES index 0cce723..a50fe1d 100644 --- a/NOTES +++ b/NOTES @@ -1111,7 +1111,7 @@ sort of firewall, it hangs instead of saying connection denied. So maybe simply doesn't support -R, but I kind of thought it did? -XXX - if the unlink(authorized_keys) fails, or if the open() fails for permission reasons, generate a Toast for the user...and add "restorecon -F authorized_keys" to the FAQ if it works.. SELinux will apparently hide authorized_keys from the app, on LineageOS? +XXX - if the unlink(authorized_keys) fails, or if the open() fails for permission reasons, generate a Toast for the user. (confirmed that restorecon -F authorized_keys works) XXX - restart the daemon on app upgrade XXX - why doesn't "ssh -R 2223:192.168.1.254:80 mouse" work? diff --git a/doc/index.html b/doc/index.html index 9bcd308..e68f0a4 100644 --- a/doc/index.html +++ b/doc/index.html @@ -35,8 +35,11 @@ Port 2222
  • Launch SimpleSSHD, and in Settings enable "Start on Boot", then manually start it for the first time. -
  • Create authorized_keys in the home directory (do not use ssh-copy-id) -
  • Optionally make .profile +
  • Create authorized_keys in the home directory +(do not use ssh-copy-id). +
  • Optionally run restorecon -F authorized_keys (LineageOS +needs it for "SELinux context"). +
  • Optionally make .profile.

    If SimpleSSHD does not find an authorized_keys file when a @@ -187,6 +190,12 @@ an SD card through the Android Java API, but shell commands usually use Unix APIs (POSIX, C). I don't know a work-around. Most phones let you write to /sdcard, but it's often in the phone's internal memory. +

  • If you installed an authorized_keys file, but SimpleSSHD +acts like it doesn't exist, try running "restorecon -F +authorized_keys". Some Android configurations, such as LineageOS, +run apps in an "SELinux Context" (don't ask me) where that kind of thing +is necessary. +
  • rsync will do too much work for an update, because there is usually no way to update the ctime, mtime, or atime on files in /sdcard. Use rynsc --size-only, and it will compare