SFTP on Android with AnExplorer
SFTP (SSH File Transfer Protocol) is the secure way to transfer files over the internet. Unlike plain FTP, every SFTP connection is encrypted via SSH — your credentials and file data are protected in transit. AnExplorer supports SFTP with both password and SSH key authentication.
SFTP is the right choice when:
- Connecting to a remote server (VPS, cloud server, home server with port-forwarding)
- Accessing a Synology or QNAP NAS from outside your home network
- Working with a Linux machine or Raspberry Pi over the internet
- Security is important (e.g., you're on public Wi-Fi)
For local-only transfers on a home network, SMB or FTP are simpler options.
Step-by-Step: Add an SFTP Connection
- Open AnExplorer
- Tap + in the sidebar > SFTP
- Enter:
- Host: IP address or domain (e.g.,
203.0.113.50ormyserver.example.com) - Port: Default SSH port is
22; some providers use2222or a random high port - Username: Your SSH login username (e.g.,
ubuntu,pi,admin) - Password: Your SSH password, OR leave blank if using an SSH key
- SSH Key: (Optional) Tap to import a private key file (
.pem,id_rsa)
- Host: IP address or domain (e.g.,
- Tap Connect
- If prompted to accept the server's fingerprint (host key), verify it matches and confirm
- Bookmark the connection for quick access
Password vs SSH Key Authentication
| Method | Security | Convenience |
|---|---|---|
| Password | 🟡 OK | Easy to set up |
| SSH Private Key | ✅ Much stronger | Requires key setup |
Using SSH Key Auth
If your server uses key-based authentication (common on AWS, DigitalOcean, Linode, etc.):
- Copy the
.pemor private key file to your phone storage - In AnExplorer SFTP setup, tap Private Key and navigate to your key file
- Leave the password field blank (or enter passphrase if your key is passphrase-protected)
- Connect — SFTP authenticates via your key without a password
Common SFTP Use Cases
VPS / Cloud Server (AWS, DigitalOcean, Linode, Vultr)
All major VPS providers use SSH + key-based auth:
- Host: Your VPS IP (e.g.,
203.0.113.50) - Port:
22 - Username:
ubuntu(Ubuntu/Debian),ec2-user(Amazon Linux),root(depends on provider) - Key: The
.pemfile downloaded when you created the instance
Once connected, you can browse /var/www/html to manage web files, /home/username/ for user files, or any directory your SSH user has access to.
Synology NAS (Remote SFTP)
- DSM > Control Panel > Terminal & SNMP > Enable SSH service
- Port: 22 (or change for security)
- Connect from AnExplorer: NAS public IP or DDNS hostname, port 22, DSM username/password
- At home on local Wi-Fi, SMB is faster. SFTP is better when you're away from home.
Raspberry Pi
- Enable SSH on Pi:
sudo systemctl enable ssh && sudo systemctl start ssh - Find Pi IP:
hostname -I - Connect from AnExplorer: Pi's local IP, port 22, username
pi(Raspberry Pi OS default) - Browse
/home/pi/for user files,/media/pi/for attached USB drives
Linux Home Server
Any Linux machine with OpenSSH server installed is immediately accessible:
- Install:
sudo apt install openssh-server(Ubuntu/Debian) - Start:
sudo systemctl enable --now ssh - Connect from AnExplorer using the machine's IP and your Linux username
SFTP vs FTP vs SFTP
| Protocol | Port | Encryption | Best for |
|---|---|---|---|
| FTP | 21 | ❌ | Local network only |
| FTPS | 990 | ✅ TLS | FTP servers with TLS support |
| SFTP | 22 | ✅ SSH | Any SSH-capable server |
SFTP and FTPS are both encrypted, but SFTP runs over SSH (port 22) which is already open on most servers. FTPS requires TLS certificate setup on the server side. SFTP is easier to configure and more universally supported.
Troubleshooting SFTP
"Authentication failed" with correct password:
- The server may have
PasswordAuthentication noin/etc/ssh/sshd_config— key auth required - Check username case (case-sensitive on Linux)
- On AWS/GCP, root password login is typically disabled; use the correct user (
ubuntu,ec2-user, etc.)
"Connection timeout" (never connects):
- Firewall on the server may be blocking port 22 — check server security group / iptables rules
- Some home routers don't forward port 22 to your server — check port-forwarding rules
"Host key verification failed":
- This happens if the server's SSH fingerprint changed (e.g., server was rebuilt)
- Remove the old known host entry in AnExplorer's SFTP settings and reconnect
Transfer is slow over mobile data:
- SFTP over 4G/LTE is typically 5–15 MB/s. Check your mobile data speed with a speed test first.
- Large transfers are faster on Wi-Fi to a home VPN + SMB, but that requires VPN setup.
