Dropbear SSH, a lightweight alternative to OpenSSH
librebyte.net
librebyte.net
Thank you to all these projects for delivering me from the clutches of MTP, I am indebted.
Is this sort of thing still a problem? How did you get around it?
My phone isn't rooted. Everything in /storage/emulated/0 backs up without issue. Obviously not a full system backup, but all my data none the less.
With regards to write permission, I've only ever issued any writes to my image folders to prune photos or screenshots older than xx days that have already been backed up. On that note, freeing up 20GB of space instantly with a single command is incredibly satisfying (compared to the MTP hell alternative).
I use this method to rsync to btrfs snapshots (+ raw copies of non-filesystem partitions) to make daily incremental backups of the entire phone. (Restoring said backups is a bit more involved, but I verified it's doable.)
Since Android 8 I've lost write access to general locations in the sd-card but I still have read access, as well as read+write on the internal storage.
It has an ssh server which can be nice if you want to edit some files on the phone remotely but that's not needed for rsync. I have a shortcut on the home screen which triggers a script that runs an rsync command for photos and other stuff I want to backup. Also use it to reverse-sync a folder from my NAS, want to send a file to the phone? But the file in that folder and run the script.
I don't see anything in that link that says that sdcard (outside private folder) is read-only.
The way I read "Each app has a private folder on the external SD card, and interchange between them needs to use a special API not yet available in Termux." is that I can't read another applications private folder, but I'm not trying to - I just want (write+delete) access to the publicly accessible parts of the sdcard (lots of other applications do this, and termux did in Android 7).
In the end I solved this by accessing this only while I'm tethered, that fixes the phone's IP address.
Too bad there doesn't seem to be an option to select keys according to host key instead of hostname or alias.
That said, I think it might be possible but I think you might have to shim it and wouldn’t have direct access to the file system under the photos.
The LOL is telling your Mom about DropbearSSH when this is now how iCloud Photos and Files just works. The equivalent goal is baked in.
You can still use cables or local WiFi via iTunes, but now all media and files sync over-the-air as files, along with an incremental backup of all state.
For the first time in last fall’s iPhone hardware upgrade, I didn’t use a wired backup/restore and every app’s and settings worked, along with device config. I’ve had an iPad Pro unexpectedly need replacing, no wired backup/restore needed. All my stuff syncs across all devices including desktop, all ambiently available.
The life changing part is confidence it’s working to the point of not having to think about it any more.
// Note: Photos and media end up as originals on Mac, along with all files. Those all backup in turn to Backblaze, for loss scenarios not covered by rsync style replication.
Android (with Google) offers the same functionality (AFAIK) as iCloud, but sometimes you just prefer that your private photos remain just that.
0. https://news.vice.com/en_us/article/xwm4ya/paul-manafort-may...
Open Terminal managed to sandbox a busybox like suite (grep, curl, gzip…). And a scripting language to boot.
rsync limited to the app's directory + shared folders such Photos, iCloud drive, etc would be pretty useful, even without full file system access.
iOS's restrictions are loosening up, vide Files.app
And did you have to root your phone to achieve any of this?
Also, is there a tool to use duckdns or similar to assign a hostname to your phone?
2) No.
3) Haven't looked into dynamic DNS yet; only using the setup with local wifi currently.
Last I checked there were some Go/Android technical hurdles that prevented it from working.
https://www.cvedetails.com/vulnerability-list/vendor_id-1580...
- mdnsd (not in Busybox),
- merecat httpd (much more full-featured than busybox httpd)
- inadyn dynamic DNS updater
- finit (IMO much nicer than busybox's runsv)
- watchdogd
- uftpd
- ntpd (with ipv6 support!)
He has been super responsive to requests as well.Remote FDE? Yes please!
For automatic unlocking at unattended reboots of LUKS-locked remote servers, see Mandos: https://www.recompile.se/mandos
For remote servers, I reboot them and then have to use a serial console to type in the LUKS password.
Are you saying that with this, I could put an ssh server in the initrd (and I guess I'd have to make sure network was up as well), that I could log in to to provide my LUKS password???? Because that would be ... beautiful.
Basicaly when linux boot from initrd it starts "/init" executable and chroots to your system (ok, it is using pivot_root and it is slightly more complex), but idea it is same as manually mounting filesystems and doing chroot then starting executable /bin/init
Another approach is to use something like OpenWRT as a bootloader then pivot_root into the real distribution after unlocking it - not sure there are any good instructions online for that though. I'm using it on a Raspberry Pi colocated 14000km away for https://dropbear.nl, it works pretty well. Kexec is great for remote kernel upgrades too.
When I first started switching my VPSs to having full disk encryption, I think it was around lenny though it might have been squeeze. Anyway, me and another peer thought it would be good practice to, while we figured we'd never cover every possible surface, find a standard deployment for debian VMs where even though we have no physical access to the hosts, wherever possible minimized the ability of an employee at a hosting company accessing our precious, precious bits.
The memory hadn't come back when I wrote my first comment, but one of the ideas we had at the time was shoving sshd inside the initrd! But we concluded it would be hard -- involving not only making a static build of sshd (which I did some eons ago when I had foolish opinions concerning /bin /usr/bin) but also probably trimming code away from it or adding executable compression, and modifying the initrd creation scripts....either way -- too much complexity.
So I went the route previously described. Now I learn that not only is there an ssh implementation which i can statically link into a tiny binary (which helps some other projects...), but someone went threw the trouble of making a modified initrd package with it!
Fantastic. Look for an email from me soon offering help on a specific project I noticed on your github...
I'm well aware of building my own scripts that use chroot/pivot_root tricks -- I personally like using them for making small boxes that run everything from ram and keep no persistent state.
But just out of random curiosity, what's the advantage of using OpenWRT?
I can't remember the exact reason, maybe it was because then the "bootloader" is completely decoupled from the main OS which makes upgrading kernels etc easier. It was about 5 years ago I set it up.
I should add, all the Debian initramfs work has been contributed by various people over the years - full credit to people such as the Debian maintainers, currently Guilhem Moulin.
Oh certainly, I would have assumed it was.
All I know for sure is that many moons ago I would have loved this feature, could have probably done it myself at great great great effort but didn't want to, and now, hey, here it is :) progress!!
As for decoupling and lowering complexity... <tiny voice> occasionally i miss LILO... </>
I've been paging through the code (dropbear) so far, very clear. Glad that there's TCP forwarding, as it opens the door to another possible solution in search of a problem. Namely, with USB over IP tunneled through dropbear, a user would have the ability to plug in a yubikey or some sort of challenge response device. ; )
Also, I sent you a note.
Dropbear is the default SSH server for DietPi[0], a lightweight image for Raspberry Pi and other (mainly single board) computers.
In comparison, dropbear doesn't really do anything that ssh doesn't, and lags in a bunch of esoteric features that "most" people don't use but that inevitably some people do. Who wants to use a distro where one's preferred ssh-agent feature or X11 forwarding inexplicably doesn't work?
Dropbear is small and builds cleanly everywhere, so it's what you pick if you're size constrained or just need "an ssh" for your embedded environment and don't want to bother integrating something larger. No one specifically wants it at the command line on their "Linux" system.
It used to have one unique feature, but OpenSSH has copied it now[0] :)
dbclient host1,host2,user@host3
to onion-TCP-forward through a few hosts.[0] https://manpages.debian.org/stretch/openssh-client/ssh.1.en....
When I was elbow-deep in CLFS[1], I never ran into trouble getting Dropbear to compile and work with my fledgling Linux Distro, and upon reflection that is quite an accomplishment and something I'm thankful for.
Dropbear "just worked", and it worked well. It was the first "portal" into my Distro, and I can still remember SSH'ing into my system for the first time and being completely amazed it worked at all, let alone returned a shell prompt!
Open Source projects don't get enough appreciation, and our Open Source hero's, such as yourself, get even less. Thank you for Dropbear!
First of all, thank you for creating Dropbear SSH. I would love to try it. I am currently using OpenSSH with PAM (Google Authenticator) and Ed25519. Does Dropbear support both PAM and Ed25519?
I would have used dropbear on my main machine as well, but it doesn't seem to support ~/.ssh/config
https://busybox.net is a good example of this.
#define DO_HOST_LOOKUP 0From the project ChangeLog:
```
[..]
0.28 - Sun Apr 6 2003
- Initial public release
Development was started in October 2002
```
..why is it surfacing now on HN? O_o
OpenWRT uses it for example.