Phase 1: SSH Key Transfer

Phase 1: SSH Key Transfer

Transfer SSH keys from workstation to Z Fold 7 via ADB over USB.

On Workstation

Check Device Connection

adb devices -l
Expected
R3GYB0J7YHY  device usb:5-2 product:q7quew model:SM_F966U1 device:q7q transport_id:10

Prepare SSH Keys

mkdir -p /tmp/ssh-push
cp ~/.ssh/id_ed25519_* ~/.ssh/config /tmp/ssh-push/

Push to Phone

adb push /tmp/ssh-push/ /sdcard/Download/ssh-keys/

Forward SSH Port

adb forward tcp:8022 tcp:8022

Create and Push Setup Script

cat > /tmp/ssh-push/setup-ssh.sh << 'EOF'
#!/data/data/com.termux/files/usr/bin/bash
echo "=== Setting up SSH ==="
mkdir -p ~/.ssh/sockets
cp -r /sdcard/Download/ssh-keys/* ~/.ssh/
chmod 700 ~/.ssh ~/.ssh/sockets
chmod 600 ~/.ssh/id_ed25519_* ~/.ssh/config 2>/dev/null
chmod 644 ~/.ssh/*.pub
echo "=== SSH keys installed ==="
EOF
chmod +x /tmp/ssh-push/setup-ssh.sh
adb push /tmp/ssh-push/setup-ssh.sh /sdcard/Download/ssh-keys/

On Phone (Termux)

bash /sdcard/Download/ssh-keys/setup-ssh.sh

SSH Config Entry (Workstation)

Add to ~/.ssh/config:

Host fold7
    HostName 10.50.10.110
    Port 8022
    User u0_a385
    IdentityFile ~/.ssh/id_ed25519_vault
    CertificateFile ~/.ssh/id_ed25519_vault-cert.pub
    IdentityFile ~/.ssh/id_ed25519_sk_rk_d000_nano
    IdentityFile ~/.ssh/id_ed25519_sk_rk_d000
    IdentityFile ~/.ssh/id_ed25519_sk_rk_d000_secondary
    IdentityFile ~/.ssh/id_ed25519_d000
    StrictHostKeyChecking no
    UserKnownHostsFile ~/.ssh/known_hosts_mobile

Verify from Workstation

ssh -p 8022 localhost

SSH Keys Reference

Key Purpose Works on Phone

id_ed25519_github

GitHub

Yes

id_ed25519_gitlab

GitLab

Yes

id_ed25519_bitbucket

Bitbucket

Yes

id_ed25519_codeberg

Codeberg

Yes

id_ed25519_gitea

Self-hosted Gitea

Yes

id_ed25519_d000

Home servers (d000)

Yes

id_ed25519_d001

Work servers (d001)

Yes

id_ed25519_sk_rk_*

FIDO2/YubiKey

No (hardware bound)

Check Status

ADB device detected

[x]

SSH keys pushed to sdcard

[x]

Setup script run on phone

[x]

SSH config entry added on workstation

[x]

SSH connection verified

[x]