from Hacker News

MagiskSSH – SSH server on Android without Termux

by Oxodao on 12/9/24, 12:45 PM with 81 comments

  • by lutusp on 12/9/24, 4:06 PM

    From the linked Gitlab writeup: "Some changes to OpenSSH are used from Arachnoid's SSHelper." I'm very glad to see this port of open-source code I wrote years ago, especially now that Google has removed SSHelper from the Google Play store (BTW still available at https://arachnoid.com/android/SSHelper).

    After years of trying to keep up with Google's perpetual Android tweaks, I gave up and accepted that they would eventually remove any apps that weren't updated for each new Android version.

    These events only remind me how out-of-date I am as a programmer. I wrote and released my first major title, Apple Writer (https://en.wikipedia.org/wiki/Apple_Writer) in 1979. It lasted for six years in various forms, then was replaced by better programs. I wasn't a corporation, I was an individual, and my programs (then and since) have been individual projects.

    In modern times, individual releases are rare, and in the future are likely to be even more rare, replaced by collaborations between developer teams and AI.

    Not saying things were better in the past. Just different.

  • by therealmarv on 12/9/24, 7:12 PM

    I think this is a bit overkill for my taste with root but depends on use case.

    I'm SSHing regularly into my Android phone (and it does not need root) for backup purposes. Used various apps for that but settled for years on Termux.

    * Install https://f-droid.org/ store

    * Install Termux from there

    * Install ssh daemon and rsync in Termux with

        pkg upgrade
        pkg install openssh rsync
    
    * Read manual on https://wiki.termux.com/wiki/Remote_Access#Using_the_SSH_ser... on how to start, configure, stop ssh daemon. In general: The Termux documentation is good!
  • by 0x38B on 12/9/24, 2:39 PM

    > ... It also includes rsync (which actually was my main motivation for this project)

    I would take rsync any day over unreliable GUI apps that silently fail to complete remote transfers, often as soon as the screen is turned off.

    I've used an iPhone for the past few years but may move to a Pixel running GrapheneOS for my next phone. It's apps (well, modules) like this and Termux that tip the scales in Android's favor.

  • by tetris11 on 12/9/24, 3:38 PM

    This looks good.... but I don't get the importance of it. What can this do that termux openssh can't?

    Can I mount remote filesystems at the system level via sshfs?

  • by hagbard_c on 12/9/24, 5:40 PM

    Installed it just now - don't forget to enable incoming connections on the firewall (AFWall+) if you happen to use one - and did some experimenting, especially to find out whether it would open up the device to the deluge of ssh probing. Even though those probes will (in a sane universe) not succeed they're unwelcome anyway. I do notice the device listens on port 22 on both IPv4 and IPv6. Fortunately it is possible to change this by editing /data/ssh/sshd_config where I disabled IPv6 (not necessary in this context) and changed the listening port. You never know on which network your device will end up after all.
  • by nickcw on 12/9/24, 3:17 PM

    I wonder if that includes the SFTP server component of openssh?

    If so it would be very useful for use with rclone. I back up my phone by running an sshd in termux then using rclone with sftp remotely. This works very well (until the phone decides on a whim to kill the sshd!).

  • by tacomagick on 12/9/24, 2:55 PM

    The project looks awesome. If this was also done using Shizuku it would be pretty cool aswell.
  • by paravz on 12/9/24, 10:26 PM

    my rsync backup use case over usb and adb (with adb root)

    start rsync daemon: adb root adb forward tcp:6010 tcp:11873 adb shell "rsync --daemon --port 11873 --config=/sdcard/rsyncd.conf &"

    rsync: rsync -rltHDhP --stats --size-only --append-verify --partial --delete rsync://localhost:6010/root/data/data/ /backup/data

    cleanup: adb kill-server

    /sdcard/rsyncd.conf for the phone: address = 127.0.0.1 uid = root gid = root [root] path = / read only = true

  • by sammyo on 12/9/24, 4:15 PM

    A (super easy to set up) rsync on IPhone that can "see" the itunes music folder would be a huge boon and likely change the world for the better!