News for hackers. Stuff that matters.
Re:Termux is an Android terminal emulator and Linux environm... by sigmonsays on Tuesday November 03, 2020 @01:55PM (#24982720)
what do people use this for?

While I was really excited when i encountered it, I didn't find any practical uses.

Re:Termux is an Android terminal emulator and Linux environm... by sxp on Tuesday November 03, 2020 @02:02PM (#24982778)
On phones, I've installed node & python in it and used those systems as a powerful handheld calculator.

On my tablet, I used it as an ssh client.

On my VR headset, I used it to create a self-contained development environment: https://www.reddit.com/r/cyberDeck/comments/fc5sfr/oculus_qu...

You can use its PRoot functionality to run various Linux distros: https://wiki.termux.com/wiki/PRoot

And you can run Linux GUI apps if they are compiled properly: https://github.com/adi1090x/termux-desktop

Re:Termux is an Android terminal emulator and Linux environm... by UI_at_80x24 on Tuesday November 03, 2020 @02:23PM (#24982992)
Troubleshooting services and bypassing Google's help.

Scenario 1: You're in the middle of your data center. Internal tools/tests say that $service is running correctly, but external customers says it isn't working, and firewall won't let you use an external IP without having to run 3 floors away on the other side of the building.

Solution 1: Open termux, and running telnet aaa.bbb.ccc.ddd $PORT and test

Quicker then waiting for a co-worker to get back to you on Slack.

Scenario 2: You are setting up a new VPN server and want to confirm that your outgoing connections are being routed through the correct IPs/Gateways.

Solution 2: Open termux and run tracert and see where you are being routed.

and many more....... I used to own a Nokia N900. Having a Linux CLI that works in portable device (wifi + cellular) is so damn handy. I use it atleast 2 times a week. It's a perfect diagnosing tool for OOB troubleshooting.

Re:Termux is an Android terminal emulator and Linux environm... by MarkusWandel on Tuesday November 03, 2020 @02:10PM (#24982862)
Syncing photos off. Termux has sshd (you have to start it manually once, then it stays running until Termux is killed or the phone is rebooted).

With ssh-copy-id it takes a single command (1-line script) to rsync the phone's DCIM directory to my main machine for further processing. Nothing needs to be done on the phone at all other than to lightly nudge it to wake it up so sshd sees the connection attempt.

Downside: Android security clampdowns mean termux can't see the SD card. So I can only sync down the phone's internal camera directory and that's where I have to store the new pictures and videos. This means space occasionally runs low and I have to move stuff to the SD card. But in the future, they probably won't allow Termux to even work any more in its current form - no "exec" of executables that werent' installed as part of the apk.

Why do all this? Because I'm old school. My phone is an extension of my data ecosystem, which lives on (redundant and backed-up) hard disks in my home computing setup. I don't even let the phone sync the photos to the cloud.

Admittedly I've found no other practical uses for it; all the interesting stuff is blocked by Android security (e.g. back up or otherwise process your call/SMS history).

Re:Termux is an Android terminal emulator and Linux environm... by noja on Tuesday November 03, 2020 @02:19PM (#24982940)
Alternatives:

Resilio Sync: use it in backup mode to sync photos to your desktop pc/mac/nas. Delete photos from phone when you want to free space. Also lets you access and edit normal files, either on demand or by sync. https://play.google.com/store/apps/details?id=com.resilio.sy...

PhotoSync: sync your photos to pretty much anything. https://www.photosync-app.com/home.html

Re:Termux is an Android terminal emulator and Linux environm... by antocv on Tuesday November 03, 2020 @06:20PM (#24985158)
The thing with these apps is, not your suggestion in particular, is its not ever as it was 20 years ago "use this app it does this", now it is, "use this app it will maybe ask to ship your data to NSA or China, ask for account registering signup, for sure it will make some network calls to who knows where and include adtracking and other nastiness, and will nag about some license or buy-up".

Termux, ssh and rsync. Thats it. It works. I tell my phone, try to rsync when its been charging for at least 5 minutes and its evening time. Hurray.

Re:Termux is an Android terminal emulator and Linux environm... by MarkusWandel on Tuesday November 03, 2020 @06:51PM (#24985356)
The other thing is that these apps invariably screw usability up in some way. I use Sweech as a Wifi file server on the phone, but to get pictures off... whoops, no multi select. so if I want to grab the newest 50 photos off the wife's phone, that's 50 checkmarks to click (I'm not geeky enough to have Termux on the wife's phone). Or apps that only talk to a companion app on your (Windows or Mac) computer using a proprietary protocol. Or simply need a crapload of taps to get the job done.

Whereas the rsync method is exactly this: "syncphone" on my main machine. If it doesn't connect, nudge the phone so it wakes up (it'll connect anyway eventually; the phone seems to wake up on its own now and then). And then it's all automatic and scriptable from that point. I realize that perhaps 0.1% of smartphone users have the skills to automate things at that level and therefore care.

The auto rsync when charging is a good idea. I guess Termux can still get access to the battery/charge state?

Another example of user hostility: While on Android phones, at least older ones, bulk transfer of files via USB to/from a Linux machine has always been hit and miss, it's been rock solid on iDevices. Just do "idevicepair" and after that, transfer away to your heart's content, fast and solid. Only now I read that the latest version of IOS may have messed that up too, in the name of security of course.

Re:Termux is an Android terminal emulator and Linux environm... by npsimons on Tuesday November 03, 2020 @02:55PM (#24983328)
> Android security clampdowns mean termux can't see the SD card.

Not sure that's what's causing it; I can definitely scp files from my Android phone's SDCard to my servers. But I've not tried initiating the scp from the other machine to my phone.

Re:Termux is an Android terminal emulator and Linux environm... by MarkusWandel on Wednesday November 04, 2020 @07:51AM (#24988521)
For what it's worth, my SD card is unencrypted so Android treats it as external storage, rather than encrypted and integrated into Android's "system" storage.

Anyway what's left of filesystem access for Termux isn't really a blacklist as in "you're forbidden to go here" but rather feels like a whitelist. There are a few carefully selected places you're still allowed to go, front and center being the DCIM directory.

Re:Termux is an Android terminal emulator and Linux environm... by knaik94 on Tuesday November 03, 2020 @02:15PM (#24982909)
If DCIM syncing from external SD card is an issue, I would suggest looking into FolderSync. I've used it personally for music syncing. I'm old school too when it comes to curating my own music library.
Re:Termux is an Android terminal emulator and Linux environm... by vorpalhex on Tuesday November 03, 2020 @05:14PM (#24984625)
Rooting isn't as terrifying as it used to be, and it means you can do actual real backups and genuinely own your data.
Re:Termux is an Android terminal emulator and Linux environm... by jhbadger on Tuesday November 03, 2020 @06:41PM (#24985283)
One issue is that these days many people work at places that have BYOD (Bring Your Own Device) policy. This means you install work related apps on your own phone rather than being supplied with a work phone like in the old days. Many of these apps refuse to work on a rooted phone "for security" (justified or not, that's the argument)
Re:Termux is an Android terminal emulator and Linux environm... by lhoff on Tuesday November 03, 2020 @08:39PM (#24985933)
If dont know mich about these work related apps but all my banking apps work with a magisk based root. So maybe thats a workaround.
Re:Termux is an Android terminal emulator and Linux environm... by voltagex_ on Wednesday November 04, 2020 @01:05AM (#24986706)
I'm pretty sure flashing a non-OEM ROM on my Note 9 would blow an eFuse that permanently marks the thing as having been modified.

Certainly, when I unlocked a Sony Xperia XA2 it did something similar where it won't ever get OEM updates ever again.

Re:Termux is an Android terminal emulator and Linux environm... by knaik94 on Tuesday November 03, 2020 @02:12PM (#24982885)
This takes some setup, but you can add ffmpeg and python, and from there youtube-dl. There's a url handler so I can download podcasts and other things by using the built in android share function from page links.

People also use it on chromebooks for dev work that doesn't require low level compiling. I have seen NPM and webdev work being done using termux and I have seen people use it for Jupyter Notebooks too.

It also integrates with Tasker (another android automation app).

Re:Termux is an Android terminal emulator and Linux environm... by yjftsjthsd-h on Tuesday November 03, 2020 @02:55PM (#24983329)
What setup? I thought it was just `pkg i ffmpeg python && pip install --user youtube-dl`?
Re:Termux is an Android terminal emulator and Linux environm... by knaik94 on Tuesday November 03, 2020 @03:26PM (#24983600)
The setup I was focusing is creating a meaningful bash like script that runs when the URL is shared to Termux. I have also set up ways certain sites to have their audio stripped from the video, using ffmpeg and while basic, it does take about a couple hours to get things setup bug free in a way that's easy. Easy as in a two click, share -> termux and then just letting it run and it'll finish. And as other have mentioned, getting storage permissions right.
Re:Termux is an Android terminal emulator and Linux environm... by muxator on Tuesday November 03, 2020 @02:06PM (#24982815)
Just a few days ago I thought about using termux-api to do a quick poc for a monitoring application. Namely, I wanted to send an SMS when an event occurred.

Termux-api used to offer this [0], but apparently some time ago google decided to make it impossible:

> Usage of this API is no longer allowed by Google and we had to disable it to prevent delisting of Termux:API application from the Google Play.

It's my device, my SMS plan over a (supposedly) open source system. But it's the vendor's platform, and a huge part of it is proprietary (the play services).

This is the windows monopoly all over again, but in our pockets and with deep analytics backed in.

OK sorry, this ended being a rant. Is there an escape hatch? When will we have a credible free software mobile operating system?

[0] https://wiki.termux.com/wiki/Termux-sms-send

Re:Termux is an Android terminal emulator and Linux environm... by _underfl0w_ on Tuesday November 03, 2020 @02:17PM (#24982932)
Termux:API is available on F-Droid. Maybe the functionality exists in that version?
Re:Termux is an Android terminal emulator and Linux environm... by muxator on Tuesday November 03, 2020 @02:42PM (#24983189)
I fear not. My termux is installed from f-droid.
Re:Termux is an Android terminal emulator and Linux environm... by trynewideas on Tuesday November 03, 2020 @03:47PM (#24983800)
It was removed from termux-api in 0.32: https://github.com/termux/termux-api/compare/v0.31...v0.32

Discussed in termux-api issue #257: https://github.com/termux/termux-api/issues/257

Unless you build it yourself with the functionality restored, you can't use it. Termux maintainers are just that dedicated to targeting Google Play first.

Re:Termux is an Android terminal emulator and Linux environm... by lytedev on Tuesday November 03, 2020 @02:09PM (#24982853)
You can buy Linux phones right now!
Re:Termux is an Android terminal emulator and Linux environm... by arminiusreturns on Tuesday November 03, 2020 @05:26PM (#24984734)
Any thoughts on the best options for those of us wanting one? It seems pretty much to be Pinephone or Librem 5, are there others? Both are preorder only. Anything generally available?
Re:Termux is an Android terminal emulator and Linux environm... by opan on Tuesday November 03, 2020 @05:52PM (#24984975)
PinePhones have periodic batches, not sure if that's considered a pre-order exactly.

Check out the devices[0] list on the postmarketOS wiki to see which Android phones and other things have support. In general none of them will work as well as the PinePhone, because Pine isn't fighting this sort of thing the way most manufacturers are, but it could be a fun thing to look into if you own anything already supported. You could also port it to a device not yet on the list if you're up for it.

[0] https://wiki.postmarketos.org/wiki/Devices

Re:Termux is an Android terminal emulator and Linux environm... by opan on Tuesday November 03, 2020 @05:45PM (#24984910)
- routine backups with rsync (one time setup in my shell config with a `bkup` alias and then I just run that when I think of it)

- grabbing albums off my PC with sftp

- easy way to unzip files

- play audio via mpv

- run `xdg-open` on a file and get a native popup to select an app to open it with

- ssh into your other machines, works well to pick up your irc chat away from your pc if you use irssi + tmux (or weechat, or screen, etc.)

- use a "real" editor like vim or emacs locally on your phone

- api stuff, you can control the torch, notifications, etc. you can make scripts around that (imagine a simple `sleep 30m && ...` sort of one liner that turns on your light and plays some audio to wake you from a nap (I haven't done much with this part of termux)

Re:Termux is an Android terminal emulator and Linux environm... by briangray on Tuesday November 03, 2020 @03:31PM (#24983640)
A combination of general use and learning.

General: Using T-UI because I'm not a fan of modern touch UIs, but it is limited to Android functions like messages and launching apps. Anything beyond that (SSH, text editing, web calls, etc) I do through Termux. I wish I could combine the two more seamlessly, but it's effortless to switch between the two.

Learning: Wanted to learn to use vim. Termux provided simple vim access and vimtutor. I've also used Termux to freshen up on languages and write a few scripts. Namely, differences between Python2.7 to Python3 which I didn't look into until this year. Starting on C and/or Rust soon.

Re:Termux is an Android terminal emulator and Linux environm... by jhbadger on Tuesday November 03, 2020 @02:22PM (#24982981)
Programming on the go. Ruby, Python, Rust, Go, Nim, and many other programming languages are available for it. As are editors like Emacs and Vim.
Re:Termux is an Android terminal emulator and Linux environm... by trynewideas on Tuesday November 03, 2020 @03:41PM (#24983732)
I don't use it often, but I did use it twice to get a misbehaving apache service restarted while on the bus/train to work, saving me about 20 minutes of downtime before I could get in front of a better keyboard.

There's a widget addon that makes doing those sorts of things one-tap: https://wiki.termux.com/wiki/Termux:Widget

Though naturally once I created a widget to kick apache, it never failed again.

Re:Termux is an Android terminal emulator and Linux environm... by crtasm on Tuesday November 03, 2020 @02:03PM (#24982786)
A bash script that scps today's photos to my NAS

Persistent SSH session to a server running Weechat for IRC

(Remember to run 'pkg update' every so often, a recent update to the app required a reinstall or manual fix for anyone like me who didn't know it could be a problem)

Re:Termux is an Android terminal emulator and Linux environm... by giancarlostoro on Tuesday November 03, 2020 @02:02PM (#24982781)
I could see it as a rather easy way to get people to try programming with a tablet / keyboard combo. You can install Go, or Python and run a web server and visit it from within the browser... It's pretty impressive and capable honestly. You can find < $100 Android phones that are prepaid these days, I got a few ages ago.
Re:Termux is an Android terminal emulator and Linux environm... by bergie on Tuesday November 03, 2020 @02:06PM (#24982810)
I'm using this almost daily for various open source work. It has my vim setup, tmux, node, and git.

Primary usage is via Samsung DeX so I have multiple windows and a proper mechanical keyboard.

Re:Termux is an Android terminal emulator and Linux environm... by maelito on Tuesday November 03, 2020 @04:21PM (#24984137)
Same, but miss a real browser with devtools so much. Everything's great apart from that. UserLand is ok but the VNC mode messes with a proper environment with alt-tab.
Re:Termux is an Android terminal emulator and Linux environm... by Spica on Tuesday November 03, 2020 @03:05PM (#24983417)
I learnt python and did coding on phone(too broke to buy pc) so I used it for running python projects, using git and deploying the projects on heroku with the CLI.
Re:Termux is an Android terminal emulator and Linux environm... by mcshicks on Tuesday November 03, 2020 @02:34PM (#24983115)
I use it for emacs, mostly org mode on my phone. It works reasonably well with a small bluetooth keyboard.
Re:Termux is an Android terminal emulator and Linux environm... by npsimons on Tuesday November 03, 2020 @05:04PM (#24984547)
> I use it for emacs, mostly org mode on my phone.

I'm not the only weirdo who does this! Although I manage to get by with Hacker's Keyboard.

Re:Termux is an Android terminal emulator and Linux environm... by nanomonkey on Tuesday November 03, 2020 @05:20PM (#24984683)
This was my use case, unfortunately I never figured out how to get my keyboard to accept CapsLock as a Ctrl key. Any suggestions??!
Re:Termux is an Android terminal emulator and Linux environm... by mcshicks on Wednesday November 04, 2020 @10:59AM (#24990168)
That's actually the "reasonably" part. The BT keyboard mapping is not completely perfect for a few corner cases (I think alt-space was one?). Hackers keyboard is OK for small tasks. You might try a small USB keyboard and USB OTG cable if your phone supports USB peripherals. I used the setup more when I was going someplace and didn't want to drag a laptop. Since I'm not going much of anywhere these days it's of much less use, in fact last time my check termux busted on some update but I haven't needed it so I haven't fixed it.
Re:Termux is an Android terminal emulator and Linux environm... by trynumber9 on Tuesday November 03, 2020 @03:22PM (#24983565)
I rarely use it for more than ssh into work servers on the weekend, downloading videos, or testing code snippets. But it's really nice to be able to use normal iperf rather than looking for some Android application that wraps it and may or may not contain ads.
Re:Termux is an Android terminal emulator and Linux environm... by onedr0p on Tuesday November 03, 2020 @07:43PM (#24985678)
This. Termux is a great AIO app for a lot of apps available on the Play Store. I use it for running kubectl, ssh, scp, rclone, rsync, etc.. if there is a ARM binary it will most likely run in Termux.
Re:Termux is an Android terminal emulator and Linux environm... by miguelmota on Tuesday November 03, 2020 @04:45PM (#24984362)
You can run it on a FireTV stick by downloading termux via the F-Droid repository. Connect a bluetooth keyboard and you have a nice little linux environment to play around with. I installed archlinux on it and use it to test packages for ARM.
Re:Termux is an Android terminal emulator and Linux environm... by jack-of-some on Tuesday November 03, 2020 @01:58PM (#24982752)
I've used it for ssh-ing into my various machines, both work and personal. I also did some development work using this when I was stuck without a laptop. And one time it was useful in sending out a mass text.
Re:Termux is an Android terminal emulator and Linux environm... by a_e_k on Tuesday November 03, 2020 @07:38PM (#24985655)
- Stand up an ad-hoc web server with `python -m http.server 8000` and use it fetch some photos onto the desktop over local wifi.

- Having a backup of my private repos and dot files that's always with me. Easily keep them up to date with a pull every now and then.

- Occasionally do some lightweight symbolic math or high precision arithmetic with Emacs' calc.

- Test the portability of a library I've been writing by building and running its test suite on a lower-powered ARM environment.

Re:Termux is an Android terminal emulator and Linux environm... by jaggirs on Tuesday November 03, 2020 @02:24PM (#24982993)
Routing a development server to the phone's localhost so I can use https-only features like service workers and camera access without setting up https.

ssh -L 8080:172.383.20.18:8080

Re:Termux is an Android terminal emulator and Linux environm... by Valkhyr on Tuesday November 03, 2020 @08:44PM (#24985949)
Primary: File management. I tend to prefer the command line for that kind of thing. Includes occasionally rsync-ing or scp-ing stuff to and from servers, and modding a few games I have on Android (Beamdog's Enhanced Edition mobile ports of old CRPGs).

Secondary: Study programming - I am a self-taught programmer, and before the pandemic I would study a lot on public transit, in coffee shops, while waiting for people etc. This actually used to be the primary use case before I started working as a professional programmer and was also using breaks to study. Android/Termux is not really suitable for actual dev work (e.g. you'll probably need Docker at some point if you're doing backend, and you'll want a browser with dev tools for frontend), but for limited study projects (especially backend dev) it's absolutely awesome.

It's also my SSH client to access a few servers I keep privately, but this is a feature that certain dedicated apps (e.g. JuiceSSH) could do equally well or better, and I'm just using Termux because I already have it.

Re:Termux is an Android terminal emulator and Linux environm... by donio on Tuesday November 03, 2020 @03:05PM (#24983409)
- ssh (with a proper openssh config and various convenience wrappers around it)

- a local bookmark manager and search redirector that i wrote in Go (much easier to just run in termux than turning it into an Android app)

- sshd to allow adhoc file transfer and command execution over ssh, getting various information from the phone using the termux cli APIs

- random shell stuff although i tend to do most of that over the ssh connection.

Re:Termux is an Android terminal emulator and Linux environm... by rehemiau on Tuesday November 03, 2020 @02:40PM (#24983175)
ssh into a secured machine with port forwarding, then being able to access services exposed from that machine e.g. for web testing on Android, or using VNC / NoMachine to remote into it.
Re:Termux is an Android terminal emulator and Linux environm... by a3n on Tuesday November 03, 2020 @07:50PM (#24985713)
I run sshd on termux, and mount it wirelessly on my laptop via the phone's hotspot with sshfs on the laptop.

https://news.ycombinator.com/item?id=20660301

So I can copy photos from phone to laptop and post process with a script.

Re:Termux is an Android terminal emulator and Linux environm... by vharuck on Tuesday November 03, 2020 @04:57PM (#24984485)
For me, it's either to youtube-dl music onto my phone (mostly stuff from CDs I had bought but were stolen or lost), or run a small Python script to cheat at word games (finds all combinations of letters in a dictionary file).

Things that don't rise to the level of deserving an app, but are nice to have.

Re:Termux is an Android terminal emulator and Linux environm... by onedr0p on Tuesday November 03, 2020 @07:45PM (#24985691)
If there is a ARM64 binary, it will most likely run in Termux. I use it with helm, kubectl, rclone, ssh just to name a few.

ssh is the most used for me because I don't want to use Termius (paid) or some other SSH wrapper app. Termux is free, allows you to easily create ssh keys and use ssh-copy-id.

Re:Termux is an Android terminal emulator and Linux environm... by BenjiWiebe on Tuesday November 03, 2020 @08:47PM (#24985964)
See if JuiceSSH fits the bill for you. I use it and love it.
Re:Termux is an Android terminal emulator and Linux environm... by onedr0p on Tuesday November 03, 2020 @11:08PM (#24986394)
I have... JuiceSSH is ssh wrapper, riddled with bugs, isn’t free and it’s abandoned. Termux is honestly the best ssh client because it’s so much more. The only place it falls short is syncing between devices.
Re:Termux is an Android terminal emulator and Linux environm... by npsimons on Tuesday November 03, 2020 @02:53PM (#24983304)
> what do people use this for?

Emacs, org-mode, git and ssh. That's pretty much it, but allows me to have access to my org-mode files anywhere, just like on desktop.

But I'm also one of those weirdos who runs his own email server and sshes in to read mail in mutt.

Re:Termux is an Android terminal emulator and Linux environm... by dspillett on Tuesday November 03, 2020 @08:05PM (#24985795)
rsync over SSH for backups. Google photos want including the highest quality images, and I had tremendous terrible with both this and my last phone copying off large files (long recorded videos at high res) locally via normal USB methods.

A script running rsync over SSH over wi-fi works every time. And as I use rsync for backups generally (have done for many years) this integrates nicely with my general way of doing things.

I've not tried running SSHd to allow things to be pulled off or pushed to devices, but others report that working well too.

Re:Termux is an Android terminal emulator and Linux environm... by michrassena on Tuesday November 03, 2020 @02:57PM (#24983347)
I've found it useful to occasionally ssh into my raspberry pi. But I don't think I could use it as a serious work tool unless I had a Bluetooth keyboard connected to my phone.
Re:Termux is an Android terminal emulator and Linux environm... by tomcooks on Tuesday November 03, 2020 @03:51PM (#24983847)
tmux + Termux + brow.sh allows me to do browsing, email, maps, even shopping online in the middle of nowhere with a few bars of 2g connectivity.
Re:Termux is an Android terminal emulator and Linux environm... by gkfasdfasdf on Tuesday November 03, 2020 @04:49PM (#24984403)
A colleague used it to run iperf3 to test his home wifi.