logoalt Hacker News

MagiskSSH – SSH server on Android without Termux

124 pointsby Oxodao12/09/202474 commentsview on HN

Comments

therealmarv12/09/2024

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!
show 1 reply
0x38B12/09/2024

> ... 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.

show 9 replies
tetris1112/09/2024

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?

show 2 replies
nickcw12/09/2024

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!).

show 1 reply
lutusp12/09/2024

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.

show 1 reply
paravz12/09/2024

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

tacomagick12/09/2024

The project looks awesome. If this was also done using Shizuku it would be pretty cool aswell.

sammyo12/09/2024

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!

show 1 reply
hagbard_c12/09/2024

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.

show 1 reply