DEV Community

Cover image for How to make `git pull` work via mobile hotspot
Zaphod Dev
Zaphod Dev

Posted on

How to make `git pull` work via mobile hotspot

The fix

GIT_SSH_COMMAND="ssh -v -o KexAlgorithms=curve25519-sha256" git pull
Enter fullscreen mode Exit fullscreen mode

How to debug

GIT_SSH_COMMAND="ssh -v" git pull
Enter fullscreen mode Exit fullscreen mode

Explanation

A hang at expecting SSH2_MSG_KEX_ECDH_REPLY during key exchange points to a MTU/packet fragmentation issue, which is extremely common with mobile hotspots.

What's happening
The SSH key exchange uses large packets (especially with post-quantum algorithms like sntrup761x25519-sha512). Mobile networks often have:

  • Lower MTU than typical networks (1500 bytes on wifi vs ~1400 on cellular)
  • Aggressive packet filtering or mangling
  • Issues with large UDP/TCP packets that need fragmentation The connection establishes fine (small packets), but hangs when the first large crypto packet is sent.

Alternative fix

# Find your hotspot interface (probably wlan0 or similar)
ip link show

# Temporarily reduce MTU
sudo ip link set dev <interface> mtu 1400
Enter fullscreen mode Exit fullscreen mode

Permanent SSH config fix

Add to ~/.ssh/config:

Host github.com
    KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org
Enter fullscreen mode Exit fullscreen mode

This disables the post-quantum sntrup761 algorithm which generates the largest packets.

Top comments (0)