Hacker News new | past | comments | ask | show | jobs | submit login
Termux: terminal emulator and Debian-style userland as an Android app (termux.com)
338 points by fanf2 on Oct 22, 2017 | hide | past | favorite | 139 comments



Termux is a great project, may it be for cli lovers, hackers, road warriors ...

However, I have little trust in mobile devices nowadays and I don't feel safe copying private ssh/gpg/vpn/credentials data on them anymore. Planned obsolescence, theft risk, vendor/hardware/firmware issues, general feel of lack of control, ...

As a consequence, I tend to use my smartphone as anonymously as possible, mostly as a camera, an actual phone and 4G modem, tethering via usb/wifi to my laptop. It's simple, it feels safe and obviously it's not as practical.

I'd love postmarketos --or something similar-- to succeed, so I could leverage the privacy/backup strategies I have already set in place on laptops and servers that actually make me feel safe.


Make a separate ssh key for your phone with restricted sftp-only access to a phone-specific backup directory on your server.


What's a good tutorial for restricting sftp access to a particular directory? (Assuming the same host supports ssh login, too.)


Assuming openssh-server, look for "internal-sftp" in sshd_config(5). And of course, also google a bit around that.

It's worth pointing out that this will preclude use of rsync and similar tools that require running a server on the remote machine. I'm not aware of robust alternatives so if anyone else knows one please tell me! (and I consider rsync-restricted shells and similar approaches a hack)


how about running OpenSSH inside docker with bind mounts?


are y'all talking about chroots?


I have a complete opposite feelings: mobile apps are actually sandboxed, modern phones have secure elements in hardware and the attack surface itself is pretty limited.

On the other hand, there's virtually no sandboxing on your laptop. As software developers, we pull random code from the internet all the time and it's generally trivial to steal every secret that your user has access to (https://xkcd.com/1200/)

Personally I'm not worried about baseband processor (or Intel ME) owning my device. I'm more worried about some random malware installing a keylogger and/or stealing my whole LastPass database. This would be virtually impossible on mobile, but is relatively trivial on laptop.


I understand your feeling. I guess one can build "trust" or at least a somewhat "safe" feeling from simplicity, technical arguments, experience of a given evil ...

I "feel safe" running linux or openbsd on a "computer" given that I know only too well how flawed they can be. A mobile device could offer exactly the same feeling, and maybe better objective security characteristics, but unfortunately a "mobile device" doesn't seem to be defined as a "computer" you can single handedly operate but as a mix of short lived dependencies from hardware manufacturers to walled proprietary app stores through network carriers.

I don't dismiss the technical progress that is eventually happening in the mobile area but I think I'll pass as long as something as postmarketos offers what I feel is sustainable.


True there's no sandboxing by default on a typical linux desktop but I think the key difference between the linux distributions and Android security models is that your linux distribution is supposed to run trusted free software whereas your Android device is probably going to run some proprieatary untrusted apps.

That's why sandboxing is very necessary on Android and not so much on your linux box.

Now I agree you should sanbox everytime you can especially when linux is well capable of it, that's why I use firejail on my desktops so I get all the awesomeness of my favorite distributions AND strong sandboxing with real ease of use. https://firejail.wordpress.com/

One cool trick is to hook "sudo firecfg" in your package manager post operations so whenever you install new software it get sanboxed if a firejail profile is available (which is generally true). There may be a smarter way to do just that though?

That xkcd post makes a very good point indeed (that's why everybody should lock whenever afk, encrypt and use strong passwords of course) But I also think you should also worry about those backdoor issues: https://www.replicant.us/freedom-privacy-security-issues.php https://libreboot.org/faq.html#intel


The apps are indeed sandboxed but who knows what everything below is doing. I trust more the maintainer of my distribution than whoever hacked an android rom to commercialize it.


You sir, have very misplaced priorities.


I'd argue that both risk surfaces are large, not that the priorities are misplaced.

There's little of any electronics I trust much these days.


Well rather than using it on a phone, look at the scenario of using this on a chromebook with android app support. Currently to run crouton to do linux development on a chromebook you have to run in the entire insecure developer mode where you're wide open to attack. Using termux on a chromebook under normal mode you can work without having to compromise your chromeos device's default security setup.


I tried this out a little while ago and I was really impressed. It's worth mentioning that this isn't just a Debian chroot/container, the software is actually compiled to run natively on the Android NDK. It seems like they work around any limitations of Bionic compared to glibc by patching NDK headers and using support libraries.

Check out their "ports tree" to see what packages are available: https://github.com/termux/termux-packages


What exactly would you use it for? Not trying to be negative, I'm just not sure what would be worth typing out on a phone keyboard on the go, instead of waiting until I have access to an actual keyboard. I guess if you have a keyboard for your phone that's also different. (so for android tablets etc this is great)


Chromebook

I'm still waiting for Amazon to restock after I saw this post go up: https://blog.lessonslearned.org/building-a-more-secure-devel...


On my chromebook I use crouton[1], which is arguably more "native". You get an Ubuntu install in a chroot and can even run X11 apps in a chrome window. I was even able to compile neovim, you just need to set it up to use the system's lua and luarocks.

[1] https://github.com/dnschneid/crouton


Termux works on stock chromebooks _without_ switching to developer mode.


This is very important for schools which may lend students Chromebooks and thus likely restrict dev mode.


They would likely restrict play store installs, and currently there is no way to side-load Android apps; the normal Android developer mode options does not allow side-loading anyway, much less an enterprise managed device. I don't think there's any way to "restrict" dev mode, necessarily... anyone can put any Chromebook into dev mode, and lose all data that was on it in the process.


Great link. It's got Apache! Always wanted to run a web server on my phone.


You might also look at Servers Ultimate Pro from Ice Cold Apps. It has.... many servers. Perhaps too many. Perhaps enough that it looks like a "Hold my beer" response to a question about how many servers could actually be compiled for Android.

I wouldn't run most (any?) of them on a connection exposed to the real world, but at least in theory if you want to run an AAMP stack I believe you could, though on a quick glance you might actually have to be content with Nginx. You can also provide your own little bit of Gopherspace if you so desire.


This makes chromebook all that more appealing now I slightly regret selling my old one


I use it as a replacement for Android apps in several cases.

- Need to jot a note: vim is far better than most native apps

- Need to access a remote system: use ssh or mosh

- Need a calculator: Python is there, with a lot of useful libraries

It even emulates a mouse, so elinks is quite usable on text heavy websites. For some mobile hostile websites it is more usable since the text is large enough to be legible.

A similar user friendly tool are the widgets, which makes it easy to launch a command from the launcher with a tap.

Given the number of development tools available, it is quite easy to write a program on the computer and run it on a mobile device.


Do you do vim with Gboard/SwiftKey or do you have a hardware keyboard?


If you're doing much with Termux or SSH to other systems (or roguelikes), you should probably look into Hacker's Keyboard (https://play.google.com/store/apps/details?id=org.pocketwork...). If you miss the autocompletion aspect, there are multiple companion dictionaries that you can load as well for various languages.


I tried hacker's keyboard but didn't find it as good as the keyboard built in JuiceSSH. All the special keys important during a ssh session like Ctrl, Tab, arrow keys are very conveniently placed. I am yet to find a soft keyboard that good.


In termux, swipe from the left and long press the keyboard button to get those keys.


Just wish that compact 5 row would get some more love.

Switching it to anything but english to make use of dictionaries makes potential special characters vanish from the long-press popups...


An on screen keyboard is fine for vim, at least for things light duty tasks. I use the one provided by my phone's vendor (it provides the number row) and Termux offers a row of common keys that usually gets the job done.

I also find that vim is easier to use for editing than Android editors. It is easier to use insertion, movement, and deletion commands instead of trying to tap on the right position or dragging to select.


Termux + full keyboard is a game-changer. That's how I run my 9" tablet, and whilst not quite the laptop-replacement I'd like it to be, it's closer than anything else I've seen. The fact that I don't have the critical weak point of the laptop hinge to deal with, and the portrait/landscape flexibility of a tablet (I read a lot of formatted docs) is tremendously useful.

TL;DR: Your Android device really is a fully-capable computer, if the goddamned vendors will just get out of your goddamned way.


what keyboard do you recommend?


You can pretty much use any keyboard you want with USB. I used to use my tablet with one of those usb thinkpad keyboards - thin and easy to carry around.

For my phone - I looked at some folding Bluetooth keyboards on aliexpress which /look/ nice but at ~$30 it's a little steep for something that might be crap and end up never used/trashed. Maybe on Nov 11th i'll bite the bullet if there is a good sale.

Just search "folding keyboard" on ali.


None.

This is a major frustration point for me, as I'm working with a keyboard that's missing one physical key and has two others which only intermittently generate the requested character(s). I have ... workarounds, but they're frustrating.

I've written about this at more length than is good for either my sanity or its reputation here:

https://ello.co/dredmorbius/post/lqgtwy_rhsfbdh5cdxb1rq

Upshot: industry standardisation on device sizes, case attachments, and keyboard layouts would be an exceedingly good thing. The pictured keyboard/case (a Logitech device) seems to be among the better general options, though I question its attachment hardware.

Again, given the near-ideal nature of the form-factor, the industry fuckwittedness here is pretty staggering. I've spent more time than I care to think combing through Amazon, Newegg, and other shopping sites (product descriptions themselves make this tedious), and through various online forums and discussions.

The ability to pretty-much instantly, and without concern, switch between keyboarded/landscape and touchscreen/portrait modes is exceptionally useful. "Kickstand" type cases, and loose keyboards, don't offer this, or the ability to use the device in my lap (as I am now) as well as on a table or desk, or (in tablet mode) freestanding.

http://archive.is/FYE7D

Much as I don't care for iOS devices, the standardisation and sales volume Apple have attained make for a far superior accessories market than Android. The killer there is the lack of a true compute environment (shell, dev tools) on iOS.

Other options include laptops (including hybrids), though for my use case (many, many, many formatted documents), landscape-mode-only is a tremendous negative, and I am exceedingly averse to all-in-one, hinge-based designs. (For all its faults, Bluetooth doesn't physically wear.)

Mostly I play Old Man Yells At Clouds.


It works also on tablet.

Android, Termux and Dev Environment https://rsdoiel.github.io/blog/2016/09/20/Android-Termux-Dev...


I used it for SSH and scripts like youtube-dl. Also for the short time that I played Pokemon Go, I deployed a flask server (to track pokemon overlayed on gmaps) in termux and accessed it from Android's browser. It was sweet.


If you're using youtube-dl, take a look at mps-youtube (a Python application, install via pip).

Search, download, and play video (or soundtrack) interactively from console. Manage playlists (and save them permanently, locally), etc. Very impressive app.


I have a set of scripts that work on my local network, as well as arbitrary useful commands.

E.g. I can control the volume of the radio via a simple ssh command that turns the media center volume down. Termux has an additional extension that lets you map arbitrary scripts to a button / widget on the android home screen.


> What exactly would you use it for?

Give me an Android tablet, Bluetooth keyboard, this and Emacs...

And you’ll be surprised at what I can accomplish.

(You'll find patches to pretty big projects around the world which I've delivered this way :) )


Mostly for tablets, I suspect, though I do occasionally restart servers etc. from my phone but that tends to be via an ssh connection so I don't need a "local" userland...

But the replacement for my recently-dead Chromebook is an Android tablet/notebook hybrid (detachable keyboard), and while it's not comfortable, it does provide a tolerable alternative for when I don't want to drag my 17" laptop around.


Going to reply to myself as it's too long so I can't edit: Installed Termux and the API package and widget, and the API package (paid) has me tremendously excited. Not because it's all that advanced, but between the ability to open quick little dialog boxes to collect text, and the widgets ability to spawn them from a button, it just looks amazingly useful to automate quick little tasks without going down the particularly hellish route that is full app development for mobile...


Yeah, that's a valid question. I do use it on a phone and I don't think a phone's on-screen keyboard is suited for programming or heavy terminal use, but I've used termux for small things that I need to do when away from home. For example, rsyncing music from a server to the phone so I can listen to it, or fixing the config file in RetroArch with Vim, since sometimes fiddling with options can get it into a state where it needs an external text editor to fix, and Vim is easy to use on a restricted keyboard.


I mainly use it to run vi for small notes (i don't think it has full vim by default). I'm not really a vi fan (i used vim at the past, but today vi in termux is the only vi i use) but i just couldn't find any note taking application that i liked.

I also run mc sometimes.

Btw i use it with "Hacker's Keyboard", although the only reason i use that is because it has an esc key :-P.


I used it on my phone to run mp3Gain to adjust some mp3's volume, and I've also use it to write and run a couple of short C programs (not more than 20 lines of code) I had in mind. It's good also if you need to quickly SSH to a server and you can easily use your RSA key if you have one.


I run our clubs website using Jekyll. With this I could make a quick change to a markdown file and push it if I needed to update while out and about.


Termux is amazing (not possible to get equivalent on iOS without jailbreak). The number of packages in the repository, as well as the speed of version updates (sometimes in line with Arch Linux - a rolling release) are really amazing.

Bought all the paid add-ons to support the developer. It's one of the most valuable assets I miss on iOS (doesn't matter that much now as I've got Linux x86_64 and ARM with me on the go).


Where do you find the paid add-ons?



Highly recommend the Termux:Styling, most well known color schemes are available.

The others are Boot, Widget, Fload, Task. Buy if you need or have $ to spare ;-)


I was recently surprised to discover folks are using this on old phones or tablets as a "server" in various capacities.

You have storage, camera, at least dual network access (wifi + otg usb ethernet + cellular), a battery (ups), autostart capability via a purchase, basic package support.

Smaller than a laptop, way more self contained than a Pi, enough for some basic tinkering for sure.


I remember the idea of "cellphone as a server" being around as far back as in Symbian times. Nokia Mobile Web Server, more than just an idea, actually was an Apache port capable of loading modules and running Python scripts on your phone (e.g. in order to access the camera) and serve dynamic pages on your DDNS-reachable mymobilesite.com subdomain.

The original project website appears to have been axed, but there's still traces of people who used to talk about it: http://www.allaboutsymbian.com/features/item/Previewing_Noki...

>MWS, in its default install, comes with a default pre-configured web site which has a number of functions, including a guestbook, a blog, the ability to send SMS messages to the phone, share Calendar information, view contact information and access the phone's camera.


I've tried using a phone as a server in a similar fashion in the past, and found it to be too unstable and unreliable. With a Pi (at least, any Pi made since the Model B+ revision) stability and robustness is not an issue, however I've tried repurposing several Android devices from various manufacturers and they always end up rebooting themselves at inopportune times, or locking up, or the server app I'm using constantly crashes. By contrast, I've had the same RPi 3 running nonstop for nearly a year as a camera server.

I think it's more to do with the Android OS itself rather than the hardware, but I could be wrong. It's possible the SoC was overheating on those phones from the extended duty cycles; they simply aren't designed for much more than sporadic use.


Can I create script which snaps a photo let's say every minute? Basically, is camera available through terminal?



I use it for git repository hosting and I like its power efficiency.


Neat! As a test I installed nano and python, then used pip to install flask, wrote a web application from nano and ran it from my phone... Opened it from my laptop and everything works like you'd expect.

Sometimes I forget that these devices are just little computers!

EDIT:

I tried to get pyserial working (so my phone could talk to an arduino mini over USB) but hit the issue of not being able to access /dev for lack of root. Still, it's very cool.


> Sometimes I forget that these devices are just little computers!

When vendors try so hard to lock everything down, yes, users tend to forget about what you can do once you have freedom to do what you want with your device.


Cool!. Was that a non rooted phone?


Yep, just a standard Pixel.


Did you try the Termux-chroot package mentioned in https://wiki.termux.com/wiki/Differences_from_Linux to see if /dev might work ?


I still get "Permission denied" when I try to "ls /dev".


In an ideal world I could purchase a (usb c) dock that has some connectors and plug my awesome OnePlus 5 in to have a somewhat usable computer at home.

I know Samsung wants to do something like that now (but I won't ever again buy a Samsung phone). I'd root (and pay) for a generic solution that makes my phone usable on a big(ger) screen.


Android phones have been able to connect to bluetooth or usb mouse and keyboards since nearly the very beginning. The only thing 'missing' is the screen. Samsung (and other) phones have supported external screens for many years now, often via MHL (although, as you say the Dex dock now packages it all together). I don't believe that the OnePlus5 supports external screens, but I may be wrong. You might be able to get something working with network screen casting.


I know that, but connecting a keyboard or mouse to a phone is useless, the big screen is crucial.

And while there were options to do that in the past, all were one-offs and needed an extra port. So I guess we both agree about the capabilities that exist(ed), but that is exactly the reason why I posted my "In an ideal world" wish. There is no solution today as far as I'm aware. Which is a shame, given the power that these smartphones have.


"Sentio" is selling the SuperBook which is a sort of universal dock for smartphones. It works by adding a video card over USB (DisplayLink).


That sounded nice, their website looks cool.

Unfortunately that is unreleased/only available for pre-order. And in a very limited subset of the world: "Available for pre-order in the US, Canada, and Mexico"


Been using this app for SSH and it's been amazing. Side note (not the most optimized way), but want to run something in the background? $tmux $[run command] $shift (volume down) + B, then d (detach virtual term) command is running in tmux in background $tmux attach (to get back into the virtual term) See their docs obviously.. but using a mobile terminal I've been using this primarily for my tasks


Been using this for quite a while now, awesome app. Solved all my needs for a decent SSH terminal, and even for running a pocket version of Emacs.


I tried this Emacs for org-mode. It was not that good experience. Very recently I found orgzly[0]. It might be interesting for you too.

[0] https://github.com/orgzly/orgzly-android


I use it more for programming quick scripts and handling source code that people happen to send me over Telegram -- it even integrates well as a system editor. I'll take a look at orgzly, thanks.


Oh no way, orgzly is open source? I've been using it extensively but have been very frustrated with the fact that it doesn't sync automatically. Time to git clone...


Or if you'd rather not fork, check out this write up of an approach to getting Orgzly to sync via termux and Tasker: https://2li.ch/home/syncing-org-files


Wow. Given that this works with ChromeOS, this appears to give me what I've been looking for for a long time: something that makes a Chromebook a usable developer laptop.

Now time to buy a Chromebook and try it out.


Having tried it, it's an "almost there" solution. Termux is a proot, not a chroot. This means you can't do certain things. You end up in a state where you can run nodejs and react, but you can't run create-react-app successfully. Rustup doesn't work in Termux, when it does booted into Linux on the same chromebook. You can git clone, but you can't clone a repo from a USB stick. Every single time I tried to do any development on it, the attempt ended in "nearly works" frustrations.


I can run create-react-app. just be sure to change npm's global directory.


That's a bummer to hear.


I couldn't do bumpy and jupyter notebook Even though there are tutorials online.


Just a warning, unless you get a "free" Chromebook from a hacker friend you're looking at probably $100 for a new one.

In the end you're way better off with a beater $50 eBay thinkpad like my favorite x201. Which supports LibreBoot, is a repairable real computer.

Thick is the new thin.


$50? Nice find. I have come in possession of a t42 with a cracked display. I've set it up so I can ssh into it but it seems not worth the hassle because 1GB RAM and core2duo (afaik) processor. What is your setup and use case if you don't mind sharing.


> $50

If not cheaper, they're sometimes lacking AC adapter and/or drive caddy but that's maybe another $20.

X201 (not the tablet x201s) is i5/i7 12", enough pep for my needs, also you can get DisplayPort and modular UltraBay for optical with the optional dock thing.

The "dock" actually latches on and can even charge a standby battery with the most awkward external connector ever, if you desire extra thickness in your laptop, and frankly who doesn't.


Maybe a stupid question but why not just run Debian on a chrome book, or any cheap laptop? Or spend a bit more for a thinkpad or dell XPS


Because I don't want to be a sysadmin. I want to take advantage of all the work Google has done to make ChromeOS a slick user experience, including good drivers, seamless and invisible auto-update, fast boot, integration with Google services, etc.


It's false that you have to be a sysadmin to run Linux, and the users here know it perfectly well. There hasn't been a laptop (or desktop for that matter) I owned in the past ~8 years that hasn't worked flawlessly out of the box on the latest Ubuntu/Linux Mint (granted, with the exception of dedicated GPU drivers). And I got everything you mentioned: slick UX, good drivers, auto updates, fast boot on SSD. Granted, no integration with Google services, and I consider that a feature. I also have this little extra:

Owning my computer, as opposed to paying for it to be controlled by Our Benevolent Overlords.


With fedora and gnome, I don't even dnf upgrade anymore. When I turn of the computer, I just check "install updates" which is unchecked by default. This is how updates should work.


> I don't want to be a sysadmin

Hence "run Debian on it". The whole reason to run a Linux distribution is that the maintainers do most the sysadmin work for you, and Debian maintainers are among the most skilled sysadmins you can find.

You have to keep your filesystems from being full, but apart from that things will Just Work as long as you stay within the Debian tooling.


I don't think this sort of bottom-up approach will make you happy, though. You never know what kind of technology you need tomorrow and whether your Chromebook allows you then to handle that. And fixing that then is not possible, not with a bit of sysadmin work.


Don’t know why you are being downvoted- this is the exact reason I bought a Mac, can totally sympathize. I hear the dell and thinkpad have this problem solved from the driver point of view at least though.


> Debian on a chrome book

Easier said than done, Chromebooks aren't "computers" in the sense that you could easily or natively install Windows/Linux.

ChromeBooks run ChromeOS and often don't even have a BIOS, thus to shoehorn a different OS requires installing SeaBIOS when it isn't present.

They're more like an appliance, though GalliumOS[0] works on (most?) x86 Chromebooks.

[0]: https://galliumos.org


Why is the definition of a computer suddenly dependent on whether or not you can "easily" install Linux or Windows on it?



If you plan on trying Termux, you should also look into Hacker's Keybaord: https://f-droid.org/packages/org.pocketworkstation.pckeyboar...

In landscape mode, it provides all the keys found on a regular keyboard which make life in a terminal easier (tab, ctrl, arrows, etc.).

EDIT: In Google Play Store: https://play.google.com/store/apps/details?id=org.pocketwork...


If I open this on my phone, run vi <enter>, and type some text - how do I input <escape> so I can say :wq ?


Use an alternative keyboard, like Hacker's Keyboard.

https://f-droid.org/packages/org.pocketworkstation.pckeyboar...


Press Vol+ and 'e'


It's actually one small thing ConnectBot has over Termux: embedded help, in particular, you want to look at this page: https://termux.com/touch-keyboard.html

In fact, there's an issue about this: https://github.com/termux/termux-app/issues/184


Swipe from the left. Long press on keyboard -> you get a toolbar for special keys.


https://termux.com/touch-keyboard.html

here is a list of build-in keys that you can reach with volume up and down keys


Some keyboards, like "hacker keyboard" (f-droid) have an escape key.


you a a terminal-friendly keyboard for that. Get one on Fdroid.


I use Termux a lot too, because the Nokia N900 spoiled me and taught me to use Terminal on phone at all times.

Instead of Android + Termux, one can also look at Sailfish OS. You get all that functionality by default. There's also PostMarket OS [1], which should support at least some Android phones

[1] https://postmarketos.org


I love termux. The only negative I can say is that I think touch keyboards are a bit awkward doing terminal work. (note that termux has a few hidden shortcuts such as when holding volume up wasd becomes arrow keys etc.)

I use the termux widget to give me one-click access to a bunch of rsync over ssh commands. It is the best backup solution for android I've ever come across (this can also be automated with apps such as tasker or automate). Using rsync I also have two-way syncing for some folders so that I can easily put a file I want on my phone on my nas and then just sync it.

I always felt the rsync apps on the play store to be extremely clunky and when not wanting to go through a cloud the alternatives are limited. But this works perfectly.

edit: Also, being able to SSH into my phone and manipulate using a real keyboard and bigger screen is quite pleasant.



Thanks, but I'm not a fan of hackers keyboard, maybe it is worse because I use a nordic layout but I barely find it usable in portrait mode (which is what I almost exclusively use).


There is Gesture and key actions option inside Hackers keyboard options that allows to switch keyboard layout using Volume keys.


I've been using Termux for about a year and a half now, and can very honestly say that it is the single best and most useful capability I've yet found on Android.

I can also say that it's not entirely there, and has a number of significant limitations as compared to a full-featured Linux desktop or laptop.

My equipment: A Samsung Galaxy Tab A 9" tablet, with a Logitech "Type-S" self-supporting folio case/keyboard combination. I have major reservations against both pieces of hardware and can recommend neither on the basis of capabilities, vendor support, and artificially-imposed limitations.

That said, the form factor, display, and battery performance are exemplary. The tablet runs virtually all day on a charge, the keyboard for months, under heavy use. I've long sought a highly-flexible, lightweight, portalbe, long-battery-life system, and in terms of the fundamental physical package, this is almost completely there.

The keyboard has had physically-damaged keys since the beginning, Logitech first refused, then temporised, and finally claimed it did not have a suitable replacement product. (Why a keyboard/case should be dependent at the model-number level with specific hardware kit is entirely beyond me, and shows a desperate need for industry standardisation.)

Samsung's Tab A has proved resistant to rooting or re-ROMing, including the ability to make a back-up of the system prior to such activities so as not to lose critical data in ways that can only be described as deliberately user-hostile. I was not aware of this at the time I purchased the device, under exigent circumstances, and would not do so again.

Termux allows breaking out of many of the limitations of the Android "ecosystem" (I prefer to think of it as a toxic waste dump, but that's another story.) Be aware that Termux itself has a number of components, including base Termux, the Termux API Android App, the Termux package repository (based on app), and multiple third-party repos (e.g., pip for python). Collectively these provide a basic terminal environment, nearly 800 packages (a small count by Linux standards, but a surprisingly useful selection), and many more utilities through third-party utilities.

Not provided are a system root, full access to external storage media (I have a 128 GB microSD card, but can only make very limited use of it thanks to Android stupidity), or full access to the Android side of the house, though some interactions, including application intentions and clipboard interaction, are supported and are tremendously useful.

Another major limitation of Termux appears to be its terminal implementation itself. This is good so long as you're going forward, but is painfully slow in any back-navigation actions -- e.g., scrolling backwards in less and other pagers. Delays can be of many seconds. I've learned to quit out of files and re-open them from the start rather than going backwards. Experimenting from other Android console apps suggests this is a fault within Termux itself.

I've also had many lag and freeze issues using Termux for remote SSH access -- it's OK for quick or noninteractive (e.g., remote command-execution) interactions, but not for prolonged SSH sessions. This is tremendously disappointing as Termux, unlike other SSH tools I've used, doesn't map the <back-navigation>/<esc> key to "navigate out of the application". Critical when editing files in vim, and making apps such as SSHBot entirely useless.

I've found the community and developers helpful (excepting the two major issues above, I've seen multiple small issues fixed rapidly), and again, compared to the sheer uselessness of stock Android as a Real Computing Platform, this is a transcendental leap.

But it's Still Not Full Linux, and if that's what you're hoping for, you'll be disappointed.

On that point: Samsung shocked the motherlovin' stuffin' out of me last week in announcing (and reported here on HN) that they would be supporting full Linux distro installation on future Android devices. That would be a welcome development.

Stuff that absolutely rocks under Termux

Bash for file management. Every goddamned Android file manager in existance sucks balls.

mps-youtube. Install via pip. Provides console-mode, backgroundable, youtube video access. mps and mvs are related applications which can play other remote or local audio and video files (generally just the soundtrack). Media can be backgrounded, lists can be compiled and saved, content can be downloaded, and much, much, much more.

The Termux-API App. This provides access to the clipboard, application intents, and various Android capabilities. You need to install the "termux-api" package as well under apt. The ability to find specific files (say, from my 6k+ PDF library) and launch them to a PDF reader is just ever-so-slightly useful. (The degree of fail of Android Apps in this space is ... staggering.)

APT. God I've missed this.

vim, emacs, python, perl, ruby, ... An amazingly complete package set.

SSH. Limitations noted, it's vastly superior to App-based SSH clients.


I've never had the issues you mention with Termux's terminal emulator, but usually I run tmux inside Termux, so you may wish to try that and see if it doesn't improve things a bit.


I have, locally and remotely, most especially in less.

Using the Termux ssh daemon and connecting to localhost from another Android terminal app or SSHBot doesn't exhibit the problem. I've got a github issue open.


Well, if you've seen it you've seen it. I was suggesting a workaround in the form of tmux inside your termux session.


Noted, I'll give it a shot. Haven't much looked at tmux given long-term use of screen.


I use this when teaching Linux. Let's people quickly get comfortable in a shell


I installed this months ago and cant figure out how to access localhost through my browser. I wrote a sample flask app and ran it but cant access it outside of termux. Is there a way to do so?


  python3 -m http.server
  http://localhost:8000/  # on phone
However, I haven't been able to access a server running on termux on my phone from anywhere else. I suspect servers are blocked by my mobile ISP (makes sense!), but I never got to the bottom of it.

Should work over wifi though.


I suspect servers are blocked by my mobile ISP (makes sense!), but I never got to the bottom of it.

Many mobile ISPs run NAT, you don't even get a public IP of your own during the session, just an internal one.


Thanks! Is there a way to do it? It must support bi-dir streams, they just need to be initiated from the phone.


You can use a tunnel like https://pagekite.net/ it seems they support Android.

Alternatively, you can DIY by connecting to some other machine using SSH and establishing a reverse tunnel.


I tend to run:

    python -m http.server 0.0.0.0:8000
That should allow you to access it externally.


Just tested it and wont work.

Edit:

Works if you just run:

    python3 -m http.server
Thanks for the help

Edit[1]:

Works great with python's built in web server but wont work with flask's built in development web server.


This has made my pixel c still very useful although its going to make the linux development story on chromebooks far more secure, before android apps you had to put your system into insecure developer mode. If you need GUI based linux apps then you still will need to either convert a windows machine to linux or run in insecure mode. While running a terminal on your phone might have limited usefulness running a terminal on an android tablet or chromebook with android support is very useful for development.


Argh. One of my old phones in my collection is a Samsung Galaxy S Relay "4G" (the 4G in quotes because it was DC-HSPA rather than LTE). It would be a perfect candidate for Termux, being a QWERTY slider.

Unfortunately, it's on CM11 (KitKat), and thus not compatible. Between the collapse of CyanogenMod, LineageOS not picking up the Relay, and the limited specs by today's standards (1G RAM, 8G storage, dual-core CPU), I don't think there's any real future for this handset except as a curio.


Hey, I ported apt to Android 4.4 a while back and was hoping to eventually get to design it in a way that it would be a suitable backend for a third party app store that could also safely install core components and patches to phones that allowed it. My main goal was to eventually get Android split up into a collection of packages much like a modern Linux distribution in order to improve security and upgradeability. I'm glad to see termux is taking the first steps towards this :)


This is amazing. I've been dreaming of something like this forever for the iPhone. iOS restrictions are probably never going to be lifted, however.

I get by with Panic's Coda terminal, which is great, but even though I have multiple remote servers, sometimes I'd like to run something on my local network, like ping, wireshark, etc

Running mutt as a local mail client would be nice as well


I'm currently developing something like this for iOS, and I hope to have a basic proof of concept in the app store by the end of the year. https://github.com/tbodt/ish


Nice Theodore, best of luck!


There's someone working towards this as part of the Blink app for iOS: https://github.com/blinksh/blink/pull/281

I could see this getting onto the app store eventually.


Didn't know about blink, thanks. They get around the “no forking” limitation by turning everything into a function, it seems. Running CoreUtil is what I wanted, a port of BusyBox, basically.


This is really not too bad at all. I had a go on an Android Tablet. What got in the way was Android itself and the weak hardware.


While I love Termux too, I find it really sad that we need such a project to have a usable cli on Android. Google hackers should know better, than to deliver such a stripped down Linux.

I mean we have seen that mobile operating systems can bring a decent toolset by default as Meamo did (don't know about tizen?!?).



if it only had "normal" phonecalls (with placing next to an ear) I would bought it right now. Damn, I miss physical-keyboard phone so much


This works pretty well with Spacemacs and org-mode as well. The "space" key based navigation is a good fit for touch keyboard.

Not for heavy use, but for quick notes and calendar checking.

I ssh into my home server and drive my spacemacs instance from there.


Did anyone think of/tried running Pi-hole on it? https://pi-hole.net/


Great project. You can install Termux on any Chromebook capable of running Android apps and use it as a dev environment.


Just want to say thanks to the dev, working great on my BlackBerry Priv with Right Shift mapped to Ctrl.


Is there similar iOS alternative?


nodejs, vuejs and webpack, android splitscreen, live development on my phone like a charm, also got neet colors, and widgets to launch scripts. Awesome project, i was surprised that it worked 'out of the box'


I've been using this for years. USB OTG and a keyboard really help.


They also got metasploit-framework which is kinda awesome


Node.JS and node-red van run inside an android phone


Just wish they had keybase




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: