Install Hermes on Android and Setting Hostname in Termux
Installing Hermes Agent and setup ssh on Android Termux
Creating a custom SSH login name (works without root )
This lets you log in via SSH as a custom username , even though the underlying Android user is still u0_axxx.
Gather your current info
whoami # Shows: u0_a334 (or similar)
id # Shows UID/GID, e.g., uid=10427(gid=10427)
Record your UID (e.g., 10427). You need it for the passwd entry.
Create the passwd file
Termux's sshd reads $PREFIX/etc/passwd for valid login names. This file doesn't exist by default.
Create it with your desired SSH username
PREFIX=/data/data/com.termux/files/usr
printf'username:x:10427:10427::/data/data/com.termux/files/home:/data/data/com.termux/files/usr/bin/bash\n' \ > "$PREFIX/etc/passwd"
Key detail: Keep the UID/GID identical to your real Termux user (10427). If you change the number, file permissions break.
Verify the passwd file
cat /data/data/com.termux/files/usr/etc/passwd
Expected output:
username:x:10427:10427::/data/data/com.termux/files/home:/data/data/com.termux/files/usr/bin/bash
Restart sshd
pkill sshd 2>/dev/null
sleep 1
sshd
Verify sshd is running
pgrep -fl sshd
You should see something like 12345 sshd.
Confirm the port is listening
timeout 2 bash -c 'echo > /dev/tcp/127.0.0.1/8022' 2>&1 && echo "port 8022 OPEN" || echo "port 8022 CLOSED"
Termux's sshd listens on port 8022, not the standard SSH port 22.
Set a password
passwd
Enter and confirm a password. This is the password you'll use when logging in from another machine.
Find your phone's IP address
ifconfig
Test from another machine
From a Linux/Mac/Windows machine:
ssh username@192.168.x.x -p 8022
(Replace the IP with your phone's actual IP.)
If prompted for a password, enter the one you set in the last step
Troubleshooting
sshd restarts lose the passwd file Some Termux updates or system events may recreate files Solution: Recreate the passwd
Port is 8022, not 22 Termux's sshd defaults to 8022 Always specify -p 8022 in your SSH command
No root = no real hostname change The kernel/system hostname stays "localhost" Use this SSH alias trick instead
Password authentication required sshd may default to key-only auth Check PasswordAuthentication yes in sshd_config if login fails
"Permission denied" when connecting via SSH
Check sshd config:
grep -E "^(PasswordAuthentication|PermitRootLogin)" /data/data/com.termux/files/usr/etc/ssh/sshd_config
Ensure PasswordAuthentication yes is set (not commented out).
Can't reach port 8022
- Ensure wifi/VPN isn't blocking the connection
- Verify sshd is running:
pgrep -f sshd - Try restarting:
pkill sshd && sshd
File ownership problems after login
Make sure the UID in /usr/etc/passwd matches id -u. If they differ, you'll hit permission errors on your home directory files.
Quick Reference Commands
# Create passwd file
printf 's26:x:10427:10427::/data/data/com.termux/files/home:/data/data/com.termux/files/usr/bin/bash\n' > /data/data/com.termux/files/usr/etc/passwd
# Restart sshd
pkill sshd; sleep 1; sshd
# Check sshd status
pgrep -fl sshd
# Set SSH password
passwd
# Get your IP
ifconfig wlan0 | grep "inet "
# Test from remote
ssh username@YOUR.IP.ADDRESS -p 8022
Install Hermes Agent
Currently Hermes says the Termux installation is broken and a fix is coming maybe they are referring to the stable version I have installed and used the canary version without problems:
Install dependencies
pkg install curl gnupg
Create the dir
mkdir -p "$PREFIX/etc/apt/keyrings"
Export the key:
curl -fsSL https://hermes-assets.nousresearch.com/releases/termux/canary/key.asc -o key.asc
Add the key to keyring
mv key.asc "$PREFIX/etc/apt/keyrings/hermes-agent.asc"
Add the repositiry to apt list
printf '%s\n' \
"deb [signed-by=$PREFIX/etc/apt/keyrings/hermes-agent.asc] https://hermes-assets.nousresearch.com/releases/termux/canary hermes-canary main" \
> "$PREFIX/etc/apt/sources.list.d/hermes-agent.list"
Install
pkg update
pkg install hermes-agent
Configure then start
hermes setup
hermes --tui
If you want to setup Hermes with Proton Lumo go to Grab your key
https://carlostkd.ch/api-tracker/keys.php
If you need Guidance to set it up leave a Message