Mobile devices have long ceased to be just a means of communication, having turned into full-fledged pocket computers. System administrators and developers are increasingly faced with the need for prompt intervention in their work remote serverswhile away from the office or workplace. Using a smartphone based Android for these purposes is becoming an industry standard due to the availability of powerful terminal emulators.
The process of setting up remote access requires an understanding of the basic principles of network protocols and the correct choice of tools. In this article, we will take a closer look at how to turn your phone into a powerful tool for administering Linux systems, paying special attention to security and ease of use.
Choosing software for the terminal
The first step towards effective server management is choosing the right application. The market offers many solutions, each of which has its own unique features and target audience. For beginners, interface simplicity is more important, while professionals are looking for configuration flexibility and support for advanced protocols.
One โโof the most popular solutions remains Termius. This is a cross-platform application that synchronizes data between devices via the cloud. It offers an intuitive interface and a built-in SFTP client for transferring files. However, it is worth considering that many advanced features are only available with a paid subscription.
An alternative for those who value open source and complete privacy is ConnectBot. This is a classic SSH client with a minimalist design. It does not require registration and works completely offline, saving all data locally on the device. For users accustomed to the classic Linux terminal, an excellent choice would be Termux, which provides emulation of the runtime environment.
Setting up an SSH connection and entering data
After installing the application, you need to create a new one connection. In most clients' interfaces, this process is standardized and requires the entry of several critical parameters. An error in one character may make it impossible to establish a connection, so be extremely careful when entering data.
You will need to specify host (IP address or domain name of the server) and port. By default, the SSH protocol uses port 22, but for security reasons, administrators often change it to a non-standard value. You also need to enter the username under which you plan to log in to the system.
There are two main authentication methods: by password and using SSH keys. The password method is easier to set up, but less secure if used frequently. Key authentication requires the preliminary generation of a key pair and placement of the public key on the server in a file ~/.ssh/authorized_keys.
โ๏ธ Check before connection
Working with access keys and security
The use of SSH keys is the gold standard for security in remote administration. This eliminates the risk of password interception and simplifies the login process by eliminating the need to enter complex combinations of characters each time. You can generate keys directly inside the mobile application or on your computer, and then transfer them to your phone.
When creating a key, you will be asked to select an encryption algorithm. The most modern and reliable algorithm is Ed25519, which provides high speed and resistance to hacking with a shorter key length compared to the traditional RSA. Old servers may not support new algorithms, so in such cases you have to use RSA with a key length of at least 4096 bits.
โ ๏ธ Attention: Never share the private key file (usually without or with a .pem extension) to third parties and do not upload it to public cloud storage without encryption. Losing this file is tantamount to handing over your server password to attackers.
Many applications allow you to protect the private key with an additional passphrase (passphrase). This adds a second layer of protection: even if someone gains access to the key file on your phone, they won't be able to use it without knowing this phrase. Each time you connect, the application will request its input.
What to do if the server rejects the key?
If the connection is broken immediately after authentication with the key, check the access rights to the files on the server. The .ssh directory should have permissions 700, and the authorized_keys file should have 600. Also make sure that key authentication is enabled in the sshd config (PubkeyAuthentication yes).
Comparison of popular SSH clients
To help you choose the optimal tool, we have compiled a comparison table of the main characteristics of popular applications. Please note that the functionality can be updated by developers, so always check the latest descriptions in the store Google Play.
| Application | License | SFTP support | Synchronization |
|---|---|---|---|
| Termius | Proprietary | Yes (built-in) | Cloud |
| ConnectBot | Open Source | No (plugin required) | Absent |
| JuiceSSH | Freemium | Yes (separate application) | Via account |
| Termux | Open Source | Via packages (openssh) | Manual |
The choice depends on your specific tasks. If you just need to quickly reboot the server or look at the logs, a lightweight ConnectBotwill do. To fully work with files and manage multiple hosts, it is better to choose Termius or configure a bundle Termux with additional utilities.
โ ๏ธ Attention: Application interfaces and the location of settings may change after major updates. If you do not find the described button, look for a similar function in the settings menu or help of a specific application.
Solving common connection problems
Even with correct settings, you may encounter connection errors. The most common problem is Connection refused. This message usually means that the port is closed, the SSH service is not running on the server, or the connection is being blocked by a firewall.
Another common error is related to host authentication. When connecting for the first time, the client stores a fingerprint of the server key. If the keys on the server have been reinstalled (for example, after reinstalling the OS), the phone will issue a warning about a possible attack and terminate the connection. In this case, you need to remove the old key from the known host database in the application settings.
Use the "Keep-Alive" function in the client settings to prevent connection loss when idle. This is especially true when working via the mobile data, where the connection may be unstable.
Problems with text input can also arise due to the features of the on-screen keyboard. Special characters such as tilde ~, vertical bar | or backslash \, often hidden in additional panels. It is recommended to enable the physical keyboard mode in the terminal settings or connect a Bluetooth keyboard for comfortable work.
Optimizing the workflow on a mobile device
Working with the command line on the small screen of a smartphone has its own characteristics. To make the process less tedious, use built-in app features, such as saving frequently used commands as snippets or macros. This allows you to perform complex sequences of actions with one touch.
Customize the appearance of the terminal to suit you: change the font size, color scheme and background transparency. Good text contrast is important for working outdoors in bright sunshine. Some applications support split screen, which allows you to simultaneously see the command output and the input panel.
Using external keyboards and mice significantly increases the productivity of server administration with Android, turning the phone into a full-fledged workstation.
Don't forget about the power saving mode. Aggressive battery settings can kill background terminal processes when the screen is locked, interrupting active sessions. Add your SSH application to system exceptions or disable battery optimization for it to maintain a stable connection.
Is it possible to use Android to administer Windows servers?
Yes, it is possible. To connect to Windows, the RDP (Remote Desktop Protocol) protocol is used. There are special clients, for example Microsoft Remote Desktop, that allow you to control the Windows desktop from an Android device. SSH on Windows is also available, starting with Windows 10, through the OpenSSH Server component.
Is it safe to connect to a server via public Wi-Fi?
The SSH protocol itself encrypts all traffic, which protects your data from interception on open networks. However, it is recommended to use additional security measures such as a VPN to hide the fact of the connection to a specific server and protect metadata from the Wi-Fi provider.
What should I do if I lost my phone with the saved keys?
Immediately delete the corresponding public key from the file authorized_keys on the server. This will revoke access for the lost device. After this, generate a new key pair for the main device and configure access again.
Does Termux support working with a graphical interface?
Termux itself works in text mode. However, by installing additional packages and using the VNC client on Android, you can launch a lightweight graphical environment and broadcast it to the smartphone screen, although this requires significant resources and configuration skills.