How to Run a Linux Terminal on Your Android

Samsung Galaxy S3 smartphone thumbnail

Lots of developers, programmers and systems people run SSH, allowing them access to their remote Linux systems. While a remote terminal on your Linux notebook is useful if you have your notebook at hand, having the capability on your Android smartphone is pretty darned convenient, especially if you are two floors and 10 offices away from your desk and notebook. Today, we’ll talk about what you need to get it going.

hands holding Samsung Galaxy S3 smartphoneMost Linux systems, especially desktops, start SSH by default these days. If not, simply install it on the machine you want to remotely log into, using your favorite package manager. While there are many Android SSH clients you can run, I like the one called ConnectBot, which can be downloaded from Google Play.

Click here to find Linux jobs.

Using ConnectBot

Download and open ConnectBot.

The screen will open with a user name input box and keyboard at the bottom. Enter a user name and remote host, the same way you’d do it for any other SSH session. There’s also a drop-down to the left of the user name box where you can choose SSH, telnet or local. Enter your password to log into your remote Linux machine.

ConnectBot comes up with a font size that’s way too small. Click the Menu button, choose “Force Re-Size” and enter “50” in the left hand input box. Hit the Resize key and the text will be quite usable.

At this point you can type commands into the remote Linux command line and use your finger to scroll the screen up or down.

One big problem I have with ConnectBot is the issue of arrow keys. I use arrow keys all the time to recall past commands. It’s a huge time saver, most certainly on a tiny Galaxy S3 soft keyboard. Alas, no luck with a standard Android build, but there are ways around the problem.

One is to use CTRL-P to recall the previous command. Tap the screen above the keyboard and CTRL-ESC, and the keyboard buttons will appear. Simply tap the screen and select the CTRL button, then the letter “P.”  The same thing can also be accomplished with “!!”.

Take a look at the history command, then recall old commands with ‘!’ and the history number. Standard Linux stuff.

Of course, you can also find old commands with “!?”. Part of the command, such as “!?cpu”, might retrieve the following line, which I use occasionally.

sudo sh -c “echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor”

Additional Techniques

Another app, the Hacker’s Keyboard, actually has arrow keys. It’s also available in Google Play.

Download and open the app. When the screen opens, touch the Enable Keyboard button, then check the “Hacker’s Keyboard” box. Tap the Android home key to return to the home screen.

Next, go to the Android settings, then Language, and input and check the “Hacker’s Keyboard” box. Now, move back up to and tap the Default keyboard under Language and Input. Choose the “Hacker Keyboard” radio button. Go back down and tap the “Hacker’s Keyboard” settings button. Make sure the “Keyboard Mode” entries are set to “Full 5-Row Layout.” Otherwise, you won’t see any arrows. In this configuration, the keys are quite small, so it might take some getting used to. But, hey, there are arrow keys.

Return to ConnectBot and you should have now have a keyboard with arrow keys. You may have to log in again.

It may not be a perfect approach, but it lets you get things done when you don’t have your standard tools at hand.

Related Posts

Comments

3 Responses to “How to Run a Linux Terminal on Your Android”

July 22, 2014 at 12:53 pm, Scott DuBois said:

Yes, this is kind of fun if your eyes are good enough to follow along. I haven’t been able to find a way to increase the font size. Seems to work better from a tablet perspective I think though.

Reply

May 12, 2015 at 12:41 pm, abrahm said:

Hey its about ubantu not linux….dude want to knw about how can i use linux over my phone….plzz help me,
Thanx ☺

Reply

January 04, 2016 at 2:17 am, pretti Amale said:

i installed terminal emulator app in my android mobile..can i run program using linux command??

Reply

Post a Comment

Your email address will not be published.