Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions community-tutorials/access-server-over-termux/01-en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
---
title: Access your root server on android via termux
description: Learn to access your root server via termux on android
level: intermediate, advanced
updated_at: 2025-10-11
slug: termux-remote-ssh
author_name: vdbhb59
author_url: https://github.com/vdbhb59
author_image: https://avatars.githubusercontent.com/u/60728004
author_bio: Songs & Books 4ever
tags: [root-server, termux, terminal, netcup, android, remote-ssh, SSH, f-droid]
netcup_product_url: https://www.netcup.com/en/server/root-server/rs-2000-g12-iv-12m
language: en
available_languages: en
---

# Introduction

In this tutorial, I will guide you through the process of accessing your root-server from Termux (android terminal application installed via F-Droid) on an android phone.

The reading time of this tutorial is about 30 minutes; implementation will take approximately 90 minutes. The tutorial is for intermediate to advanced users only.

# Background

Termux is a powerful terminal emulator for Android that gives you access to a Linux environment right on your smartphone. With it, you can:

- Run Linux commands
- Control remote servers using SSH
- Install tools like Nmap, Metasploit, or Hydra
- Learn ethical hacking and cybersecurity
- Code in Python, Bash, C, and more
- Root access not required

# Prerequisites

- A Root Server from netcup with latest Ubuntu 20.04/22.04 (LTS); Debian 11/12 or later installed
- Root access to your server
- Android phone with Android version between 5 - 12; CPU: AArch64, ARM, i686, x86_64; at least 300 MB of disk space.
- Basic and above knowledge of using terminal
- Termux already [installed via F-Droid](https://wiki.termux.dev/wiki/Installing_from_F-Droid).
- Secure your root server with [this guide](https://community.netcup.com/en/tutorials/first-steps-to-protect-your-linux-server-against-common-attacks).

N.B.: The Play Store version of Termux is [no longer maintained](https://wiki.termux.dev/wiki/Termux_Google_Play)' and doesn’t support the latest packages or repositories.

Optional: You may also like to install [termux addons](https://wiki.termux.dev/wiki/Termux:API) & [termux styling](https://f-droid.org/en/packages/com.termux.styling)'

# Step 1: Update your termux packages

Before we begin, it's essential to ensure that your termux pacakges & system are up-to-date.

Open Termux and update packages Run this command:

```
pkg update -y && pkg upgrade -y
```

Note: If you are looking for a easy guide to install & setup basics of Termux, check [this guide](https://docs.nexoscreator.tech/termux-os/termux-app/installation/).

![Termux Main Window](images/01_Main_Screen.jpg "Main Window")

# Step 2: Install SSH server

Next install openssh, which is required to start the SSH server.

```
pkg install openssh -y
```

After installing openssh, our SSH host configurations and keys are stored under /data/data/com.termux/files/usr/etc/ssh/

Optional: If you like, you can also add the following additional termux repositories:

```
echo "deb https://grimler.se/termux-packages-24 stable main" > $PREFIX/etc/apt/sources.list
echo "deb https://grimler.se/termux-packages-24 stable main" > $PREFIX/etc/apt/sources.list.d/game.list
echo "deb https://grimler.se/termux-packages-24 stable main" > $PREFIX/etc/apt/sources.list.d/science.list
```


# Step 2: Create SSH Private/Public Key Pair on Android - Termux

In our android device, we need to generate SSH key pair for connecting to SSH server the remote machine (example debian). So, run the following command (this will also name the file as android for easy referencing):

```
ssh-keygen -t ed25519 -f id_ed25519_android
```


This will create the public & private key files in the `~/.ssh` folder (**/data/data/com.termux/files/homes/.ssh**)

# Step 3: Send SSH Public Key to Remote Machine

Run `cat ~/.ssh/id_ed25519_android.pub` from termux which will return the public key for your android device.

It will be something like this:

```
ssh-ed25519 ABCDE1AaaA1aAAA1AAA1AAAAAAAAAaaaA1AaaAaaaAaaa1aAAAAaaAAAAaAaaaAAaaAA user@host
```


Now copy and paste this key to your remote machine either via the chat box option in the file transfer assistant app [PlainApp](https://f-droid.org/en/packages/com.ismartcoding.plain/) or copying the `id_ed25519_android.pub` file across to your remote machine (using a USB connection) and then copy the content to `~/.ssh/authorized_keys` file (`$HOME/.ssh/authorized_keys`).

# Step 4: Restart SSHD service on android

Kill/end any running `sshd` service by typing in termux: `pkill -9 sshd`. This is to let go of any cache or broken service pipes.

Now rerun `sshd` command to start the SSH server.

# Step 5: Connect to your remote server

Connect to your remote server using the private key as pairing for the public key, via:

```
ssh -i ~/.ssh/id_ed25519_android user@host -p 1234
```

![SSH Connected](images/02_SSH_Connected.jpg "Connected to remote")

Optional: Run some command to check everything works as intended. Example:

![Commands being run](images/03_Commands_Run.jpg "Running few commands")

## Guidance and reverse idealogies

[Termux Wiki](https://wiki.termux.com/wiki/Remote_Access) | [Termux Repos](https://grimler.se/termux/) | [Reverse Logic From](https://exploit-notes.hdks.org/exploit/mobile/android/connect-to-android-from-pc/)

# Conclusion

Now you have a secure connection to your server from your android phone, and with lesser reliability on a laptop/desktop.

# Licence

[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)

Copyright (c) 2025 netcup

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:

1) The contribution was created in whole or in part by me and I have the right to submit it under the licence indicated in the file; or

2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate licence and I have the right under that licence to submit that work with modifications, whether created in whole or in part by me, under the same licence (unless I am permitted to submit under a different licence), as indicated in the file; or

3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the licence(s) involved.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
title: Set Up a Web Server Using Hestia Control Panel on netcup
description: Learn how to set up a Root Server for hosting using Hestia Control Panel on netcup.
level: beginner
updated_at: 2024-11-18
updated_at: 2025-10-11
slug: netcup-root-server-hosting-using-hestia-control-panel
author_name: vdbhb59
author_url: https://github.com/vdbhb59
author_image: https://avatars.githubusercontent.com/u/60728004
author_bio: Songs & Books 4ever
tags: [root, hosting, hestia-control-panel, netcup, debian, ubuntu, LTS-only]
netcup_product_url: https://www.netcup.com/en/server/root-server/rs-1000-g11-iv-12m
netcup_product_url: https://www.netcup.com/en/server/root-server/rs-2000-g12-iv-12m
language: en
available_languages: en
---
Expand All @@ -22,7 +22,7 @@ The reading time of this tutorial is about 15 minutes; implementation will take

# Prerequisites

- A Root Server from netcup with latest Ubuntu 20.04/22.04 (LTS); Debian 10/11/12 or later installed (see the below URL) - use minimal mode of installation, also called clean installation. [Requirement Details](https://hestiacp.com/docs/introduction/getting-started.html#requirements)
- A Root Server from netcup with latest Ubuntu 20.04/22.04 (LTS); Debian 11/12 or later installed (see the below URL) - use minimal mode of installation, also called clean installation. [Requirement Details](https://hestiacp.com/docs/introduction/getting-started.html#requirements)
- Please note latest Hestia Control Panel only supports the latest versions of the above OS. To know more visit:
[Supported OS](https://hestiacp.com/docs/introduction/getting-started.html#supported-operating-systems)
- A registered domain name (optional)
Expand All @@ -40,7 +40,7 @@ apt update && apt upgrade -y

# Step 2: Install Hestia Control Panel

To install Hestia Control Panel, you'll first need to install the installation script. Run the following commands to download and to execute the installation script:
To install Hestia Control Panel, you'll first need to download the installation script. Run the following commands to download and to execute the installation script:

```
cd ~ && wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh && bash hst-install.sh
Expand All @@ -49,9 +49,9 @@ cd ~ && wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install
> If the download fails due to an SSL validation error, please be sure you've installed the ca-certificate package on your system - you can do this with the following command: `apt-get update && apt-get install ca-certificates`

> **Info**
> To install with custom commands, use the script generator: [Script Generator](https://gabizz.github.io/hestiacp-scriptline-generator/)
> To install with custom commands, use the script generator: [Script Generator](https://hestiacp.com/install)

Possible options to use in the command are:
Possible options to use in the command are: list also available [here](https://hestiacp.com/docs/introduction/getting-started.html#list-of-installation-options)
```
-a, --apache Install Apache [yes | no] default: yes
-w, --phpfpm Install PHP-FPM [yes | no] default: yes
Expand All @@ -60,22 +60,24 @@ Possible options to use in the command are:
-j, --proftpd Install ProFTPD [yes | no] default: no
-k, --named Install BIND [yes | no] default: yes
-m, --mysql Install MariaDB [yes | no] default: yes
-M, --mysql8 Install Mysql8 [yes | no] default: no
-M, --mysql8 Install MySQL 8 [yes | no] default: no
-g, --postgresql Install PostgreSQL [yes | no] default: no
-x, --exim Install Exim [yes | no] default: yes
-z, --dovecot Install Dovecot [yes | no] default: yes
-Z, --sieve Install Sieve [yes | no] default: no
-c, --clamav Install ClamAV [yes | no] default: yes
-t, --spamassassin Install SpamAssassin [yes | no] default: yes
-i, --iptables Install Iptables [yes | no] default: yes
-b, --fail2ban Install Fail2ban [yes | no] default: yes
-i, --iptables Install iptables [yes | no] default: yes
-b, --fail2ban Install Fail2Ban [yes | no] default: yes
-q, --quota Filesystem Quota [yes | no] default: no
-W, --webterminal Web Terminal [yes | no] default: no
-d, --api Activate API [yes | no] default: yes
-r, --port Change Backend Port default: 8083
-l, --lang Default language default: en
-y, --interactive Interactive install [yes | no] default: yes
-s, --hostname Set hostname
-e, --email Set admin email
-u, --username Set admin user
-p, --password Set admin password
-D, --with-debs Path to Hestia debs
-f, --force Force installation
Expand All @@ -84,7 +86,7 @@ Possible options to use in the command are:

An example of an updated command to run the script:
```
cd ~ && wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh && bash hst-install.sh --apache yes --phpfpm yes --multiphp yes --vsftpd yes --port '8083' --hostname 'DOMAIN-HERE' --email 'EMAIL-HERE' --password 'PASSWORD-HERE' --lang 'en' --force
cd ~ && wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh && bash hst-install.sh --hostname 'examplepanel.domain.tld' --username 'admin' --email 'workingmail@domain.tld' --password 'strong&complexpasswordhere' --multiphp '8.2,8.3,8.4' --postgresql yes --sieve yes --webterminal yes --force
```

Follow the on-screen instructions to complete the installation. The installation process may take some time. Once it's complete, the Hestia Control Panel will be installed on your system.
Expand All @@ -111,8 +113,8 @@ On the dashboard, click the "Add User" button; fill out the fields; click the "S

To switch to the new user, hover over the user you want to login as; click the login as icon (`-]`) on the right of the user’s name and email; you are now logged in as the user. As such, any action you perform will be done as this user.

**Info**
Never run a web or mail domain with the admin user - by default, the admin user has elevated privileges. This can pose a security threat to your server!
> **Info**
> Never run a web or mail domain with the admin user - by default, the admin user has elevated privileges. This can pose a security threat to your server!

# Step 5: Set up your domain

Expand Down Expand Up @@ -164,7 +166,7 @@ Awesome! You've successfully set up a netcup Root Server for hosting using Hesti

[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)

Copyright (c) 2024 netcup
Copyright (c) 2025 netcup

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
Loading