termux-connecting 1.1.33 → 1.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -237,6 +237,12 @@ cmd_connection() {
237
237
  fi
238
238
  if $copy_ok; then
239
239
  info "Public key berhasil di-copy ke HP"
240
+ if ssh-keygen -y -P "" -f "$SSH_KEY" >/dev/null 2>&1; then
241
+ : # no passphrase
242
+ else
243
+ warn "Key $SSH_KEY memiliki passphrase. Agar tidak ditanya tiap kali:"
244
+ echo " ssh-add $SSH_KEY"
245
+ fi
240
246
  else
241
247
  warn "Gagal copy otomatis. Copy manual:"
242
248
  echo " ssh-copy-id -i ${SSH_KEY} -p ${SSH_PORT} ${SSH_USER}@${SSH_HOST}"
@@ -361,18 +367,21 @@ cmd_check() {
361
367
  echo "Device: ${ACTIVE_DEVICE} (${SSH_USER}@${SSH_HOST}:${SSH_PORT})"
362
368
  echo ""
363
369
 
364
- if run_timeout 10 ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5 "$ACTIVE_DEVICE" "echo connected"; then
370
+ if run_timeout 10 ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5 -o BatchMode=yes "$ACTIVE_DEVICE" "echo connected" 2>/dev/null; then
365
371
  info "Koneksi OK"
366
372
  echo ""
367
373
  info "Gunakan ssh $ACTIVE_DEVICE untuk koneksi"
374
+ elif run_timeout 10 ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5 -o PasswordAuthentication=no "$ACTIVE_DEVICE" "echo connected" 2>/dev/null; then
375
+ info "Koneksi OK (key-based)"
376
+ echo ""
377
+ warn "Key $SSH_KEY memiliki passphrase. Agar tidak ditanya tiap kali:"
378
+ echo " ssh-add $SSH_KEY"
368
379
  else
369
380
  error "Koneksi GAGAL"
370
- echo " Penyebab umum:"
371
- echo " - HP mati/dalam keadaan sleep"
372
- echo " - Termux di-swipe (close) dari recent apps"
373
- echo " - sshd crash atau berhenti"
374
- echo ""
375
- echo " Di HP: buka Termux, jalankan: sshd"
381
+ echo " Penyebab:"
382
+ echo " - HP mati/sleep buka Termux, jalankan: sshd"
383
+ echo " - Key bermasalah setup ulang: termux-connect-pc connection"
384
+ echo " - Password berubah cek password di HP: passwd"
376
385
  echo ""
377
386
  telegram_alert "🚨 *Koneksi Termux PUTUS*%0ADevice: ${ACTIVE_DEVICE}%0AHost: ${SSH_USER}@${SSH_HOST}:${SSH_PORT}%0AWaktu: $(date)"
378
387
  echo ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termux-connecting",
3
- "version": "1.1.33",
3
+ "version": "1.1.34",
4
4
  "description": "CLI setup Termux + koneksi SSH dari PC/Mac dengan Telegram alert",
5
5
  "bin": {
6
6
  "termux-connecting": "bin/termux-connecting",