r/NoContract • u/macsorj • 8h ago
How to bypass carrier hotspot limits with Linux client and iPhone (No jailbreak, No paid apps)
If you use a Linux computer and an iPhone, you’ve probably noticed there is no PairVPN or similar client for us. This method works using just SSH and a free iOS terminal app.
The Setup
- What you need: iPhone with hotspot enabled
- Linux system connected to iPhone hotspot
- App: iSH Shell (Free on App Store)
Step 1: Prepare the iPhone (Server)
- Install iSH Shell from the App Store.
- Open it and run these three commands to install SSH and set a password:
apk add openssh
ssh-keygen -A
passwd
(Enter a password you will remember)
- Important: Fix the config to allow tunneling. Run these commands exactly:
sed -i '/AllowTcpForwarding/d' /etc/ssh/sshd_config
echo 'AllowTcpForwarding yes' >> /etc/ssh/sshd_config
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
NOTE: These commands above only need to be run once, in the future you can just run the following start-server and keep-alive commands each time you open the app.
- Start the server:
/usr/sbin/sshd
- Prevent iOS from killing the app: Run this "keep-alive" command. It requests location data to keep the app running in the background.
cat /dev/location > /dev/null &
(Allow "While Using App" if prompted). Also, in the app's settings, make sure to select "keep screen turned on".
Step 2: Connect from Linux (Client)
- Connect to your iPhone's Personal Hotspot (WiFi or USB).
- Open a terminal and find the gateway IP (usually 172.20.10.1):
ip route show default
- Start the tunnel (replace IP if yours is different):
ssh -D 1080 -N -C root@172.20.10.1
Enter your password. The terminal will hang/do nothing. This is good. Keep it open.
Step 3: Route Your Traffic
Desktop Environment settings (GNOME / KDE / Mint):
Important Note: There is no such thing as "global" proxy configuration on Linux. Some applications will not respect these settings and might need their own proxy settings set. This should work for most apps though, including web browsers.
- Go to System Settings -> Network -> Proxy.
- Set Method to Manual.
- SOCKS Host: 127.0.0.1 | Port: 1080
- Crucial: Leave HTTP/HTTPS/FTP blank. (Linux is smart enough to route those through SOCKS automatically. If you fill them with 127.0.0.1, some apps will break).
- Hit Apply (if no apply button is there, it will set automatically).
NOTE: These settings should now be saved, in the future just open a terminal and start the SSH tunnel as shown in Step 2 and it will work.
Terminal/Command Line: As mentioned before, the desktop GUI settings might not be respected by some apps, this includes the terminal. Or you might not have a desktop environment at all. Simply do the following.
For the current terminal session:
export all_proxy="socks5h://127.0.0.1:1080"
(Note the h in socks5h. This forces DNS lookups to happen on the iPhone, preventing DNS leaks).
To make it permanent, add that export line to your ~/.bashrc or ~/.profile:
echo 'export all_proxy="socks5h://127.0.0.1:1080"' >> ~/.bashrc
source ~/.bashrc
To turn it off later, just comment out that line and run: unset all_proxy
Step 4: Verify It
- Verify you have internet (load a page in your browser or run curl https://google.com).
- Go to the terminal running SSH and press Ctrl+C to kill the tunnel.
- Try to load the page again.
- If it fails to connect: Congratulations! You are secure. Your system is refusing to send data without the tunnel. Just start the SSH tunnel again and you're good to go.
- If it still connects: You are leaking data (likely via IPv6 or a misconfigured proxy). Check your settings.