Americas

  • United States
sandra_henrystocker
Unix Dweeb

Connecting to your Linux system with your Android phone

How-To
Jun 03, 20223 mins
Linux

If you have an Android cell phone, you can install an app that allows you to connect to your Linux system and run commands in a terminal session.

While using your cell phone to connect to your Linux system might not seem like much of a priority, it is possible and you might have a good reason to do this from time to time. If you have an Android cell phone, you can install a tool that will allow you to connect, open a terminal session on your Linux box and run commands just like you would if you were sitting in front of the system. Well, almost.

The tool that I recommend is called JuiceSSH. It installs easily and leaves an icon with an image of a lemon with its name below it on your screen. Click on that icon and select Quick Connect to set up your connection.

JuiceSSH image 1 connect Sandra Henry-Stocker

You will need to enter something like user@192.168.0.4:22 with your Linux username, the target system’s IP address and port 22 specified. The form should default to saving the connection as shown in the image above. Enter your password when prompted.

Before you get started with any serious work, you will probably want to enlarge your font. To do that, go to Settings and scan down the menu looking for Font and Font size to make your selections.

JuiceSSH image 2 settings Sandra Henry-Stocker

When changing the font size, you can slide down to one that works for you. The sizes run from 1 to 30 points. Keep in mind that output from most commands will likely wrap around, since the screen on your cell phone is fairly narrow.

JuiceSSH image 3 font size Sandra Henry-Stocker

You can also change other settings (e.g., theme colors) if you want to customize your sessions further.

Once you have connected to Linux, you can ask who is logged in on the target system using the who command. You might see something like this.

$ who
justme  tty2    2022-06-02 11:05 (tty2) 	

If there are multiple logins, they will look very similar, but the most recent should be at the bottom of the listing and will display your cell phone’s IP address.

To go back to doing something else on your phone while leaving your JuiceSSH session active, tap the home button. Mine is a little circle in the middle at the bottom of my screen. It looks something like this:

        ◁                  ▢

Later, you can reenter your Linux session simply by clicking on the JuiceSSH icon again.

Once you’re back in your SSH session, you can tap repeatedly on the up arrow to repeat prior commands as you would when logged in at the console or using putty. If you don’t see the arrow, tap on the screen portion of the display – above the keyboard. After pressing the up arrow a number of time, pressing the down arrow will walk you back down to more recently entered commands.

JuiceSSH image 4 session Sandra Henry-Stocker

Tap CTRL in the line above your screen keyboard and then press “D” or simply type "logout" in your terminal window to exit your SSH session.

NOTE: This post describes the free version of JuiceSSH. There is also a “Pro” version with additional features.

Wrap-up

While it isn’t likely something you’ll need to do often, it’s nice to know that you can use your Android cell phone to log into your Linux system. Fortunately, it’s a lot easier to do this than you likely imagined. I hope you try it out and find some ways that it can be useful.

sandra_henrystocker
Unix Dweeb

Sandra Henry-Stocker has been administering Unix systems for more than 30 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She lives in the mountains in Virginia where, when not working with or writing about Unix, she's chasing the bears away from her bird feeders.

The opinions expressed in this blog are those of Sandra Henry-Stocker and do not necessarily represent those of IDG Communications, Inc., its parent, subsidiary or affiliated companies.

More from this author