3

I'm working on a custom Android device that needs to support ssh. We have a working service implemented that handles incoming ssh connections, but we have to run it currently on a port>1024 as per Linux permission requirements.

Is there a way to run the server on port 22?

Of course, we have system level access. We're trying to avoid exposing root access into the app space for security reasons. We do have a way to execute root commands, though if it's necessary.

aravance
  • 89
  • 1
  • 9

1 Answers1

1

At this level Android is basically just linux so any information about linux will likely be applicable. Take a look at Is there a way for non-root processes to bind to "privileged" ports on Linux?, there is an accepted answer that seems to apply to recent versions of Android.

setcap(8) will just be making system calls, if it isn't available on Android you could bundle it or look at the source and make the same system calls.

Community
  • 1
  • 1
TomKeddie
  • 305
  • 1
  • 2
  • 10