[Bug]: Git clone failed (SSH only, HTTP is OK)
Problem description
Cloning a Git repo would fail if using SSH. HTTP cloning does NOT have this issue. I have tried this on another phone (arm) and I had the same issue.
What steps will reproduce the bug?
~ $ git clone [email protected]:termux/termux.github.io.git Cloning into 'termux.github.io'... remote: Enumerating objects: 1378, done. remote: Counting objects: 100% (341/341), done. remote: Compressing objects: 100% (156/156), done. remote: Total 1378 (delta 252), reused 185 (delta 185), pack-reused 1037 (from 3) Receiving objects: 100% (1378/1378), 1.84 MiB | 2.54 MiB/s, done. Resolving deltas: 100% (688/688), done. error: ssh died of signal 6 fatal: remote transport reported error
However, when cloning with HTTP (success): ~ $ git clone https://github.com/termux/termux.github.io.git Cloning into 'termux.github.io'... remote: Enumerating objects: 1378, done. remote: Counting objects: 100% (341/341), done. remote: Compressing objects: 100% (156/156), done. remote: Total 1378 (delta 251), reused 185 (delta 185), pack-reused 1037 (from 3) Receiving objects: 100% (1378/1378), 1.84 MiB | 2.99 MiB/s, done. Resolving deltas: 100% (687/687), done.
What is the expected behavior?
Git cloning should succeed with SSH or HTTP.
System information
~ $ termux-info
Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=4383
TERMUX_APP__DATA_DIR=/data/user/0/com.termux
TERMUX_APP__LEGACY_DATA_DIR=/data/data/com.termux
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c151,c256,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.3
TERMUX__HOME=/data/data/com.termux/files/home
TERMUX__PREFIX=/data/data/com.termux/files/usr
TERMUX__ROOTFS_DIR=/data/data/com.termux/files
TERMUX__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c151,c256,c512,c768
TERMUX__USER_ID=0
Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://mirror.mwt.me/termux/main stable main
Updatable packages:
All packages up to date
termux-tools version:
1.45.0
Android version:
11
Kernel build information:
Linux localhost 3.10.108-ge773f94621d #1 SMP PREEMPT Sun Nov 28 12:47:34 CET 2021 armv8l Android
Device manufacturer:
samsung
Device model:
SM-G903W
Supported ABIs:
SUPPORTED_ABIS: armeabi-v7a,armeabi
SUPPORTED_32_BIT_ABIS: armeabi-v7a,armeabi
SUPPORTED_64_BIT_ABIS:
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec-ld-preload.so
Installed termux plugins:
com.termux.boot versionCode:1000
Just wanted to add some additional info. On the same device, if I run git within a proot-distro, git can clone successfully.
root@localhost:~# git clone [email protected]:termux/termux.github.io.git Cloning into 'termux.github.io'... remote: Enumerating objects: 1378, done. remote: Counting objects: 100% (341/341), done. remote: Compressing objects: 100% (156/156), done. remote: Total 1378 (delta 251), reused 185 (delta 185), pack-reused 1037 (from 3) Receiving objects: 100% (1378/1378), 1.84 MiB | 3.19 MiB/s, done. Resolving deltas: 100% (687/687), done.
This might be a dumb question but I gotta ask it anyway...
The openssh package is installed on both devices you tried this on, correct?
You can't use the SSH protocol for cloning without an ssh client.
Yep, openssh was installed in Termux and proot-distro (ubuntu).
~ $ apt -qq list openssh openssh/stable,now 10.2p1 arm [installed]
root@localhost:~# apt -qq list openssh-client openssh-client/questing,now 1:10.0p1-5ubuntu5 armhf [installed,automatic]
Unfortunately, I am not able to reproduce this on Samsung Galaxy S III SPH-L710. Therefore, there must be an unknown device-specific factor involved with this issue.
This is what I see
~/code $ git clone [email protected]:termux/termux.github.io.git
Cloning into 'termux.github.io'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
~/code $ git clone [email protected]:termux/termux.github.io.git
Cloning into 'termux.github.io'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
~/code $ gh auth login
The program gh is not installed. Install it by executing:
pkg install gh
~/code $ pkg i gh
Checking availability of current mirror:
[*] https://packages.termux.dev/apt/termux-main: ok
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
gh
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.2 MB of archives.
After this operation, 56.3 MB of additional disk space will be used.
Get:1 https://packages.termux.dev/apt/termux-main stable/main arm gh arm 2.83.1-1 [12.2 MB]
Fetched 12.2 MB in 5s (2510 kB/s)
Selecting previously unselected package gh.
(Reading database ... 191844 files and directories currently installed.)
Preparing to unpack .../archives/gh_2.83.1-1_arm.deb ...
Unpacking gh (2.83.1-1) ...
Setting up gh (2.83.1-1) ...
Processing triggers for mandoc (1.14.6-6) ...
~/code $ gh auth login
? Where do you use GitHub? GitHub.com
? What is your preferred protocol for Git operations on this host? SSH
? Generate a new SSH key to add to your GitHub account? Yes
? Enter a passphrase for your new SSH key (Optional):
? Title for your SSH key: GitHub CLI
? How would you like to authenticate GitHub CLI? Paste an authentication token
Tip: you can generate a Personal Access Token here https://github.com/settings/tokens
The minimum required scopes are 'repo', 'read:org', 'admin:public_key'.
? Paste your authentication token: ****************************************- gh config set -h github.com git_protocol ssh
✓ Configured git protocol
! Authentication credentials saved in plain text
✓ Uploaded the SSH key to your GitHub account: /data/data/com.termux/files/home/.ssh/id_ed25519.pub
✓ Logged in as robertkirkman
~/code $ git clone [email protected]:termux/termux.github.io.git
Cloning into 'termux.github.io'...
remote: Enumerating objects: 1378, done.
remote: Counting objects: 100% (341/341), done.
remote: Compressing objects: 100% (156/156), done.
remote: Total 1378 (delta 251), reused 185 (delta 185), pack-reused 1037 (from 3)
Receiving objects: 100% (1378/1378), 1.84 MiB | 1.19 MiB/s, done.
Resolving deltas: 100% (687/687), done.
~/code $ uname -a
Linux localhost 3.4.112-Lineage-g716f00ee2e8 #1 SMP PREEMPT Sun Oct 13 11:16:54 CDT 2019 armv7l Android
~/code $
Samsung Galaxy S III SPH-L710 is 32-bit ARM and has Android 7.
I have just tested the same steps again on Samsung Galaxy A70 SM-A705FN, which is 64-bit ARM and has Android 13, and the problem is also not occurring on that device either.
Thanks for looking into it @robertkirkman . I think you are just missing a public key setup on Github.
In the meantime, I'll try the gh command to see if that works for me.
EDIT: sorry I mis-read your message earlier, you did use git to clone.
Unfortunately, that the gh repo clone does not work for me either.
~ $ gh repo clone termux/termux.github.io
Cloning into 'termux.github.io'...
remote: Enumerating objects: 1378, done.
remote: Counting objects: 100% (341/341), done.
remote: Compressing objects: 100% (156/156), done.
remote: Total 1378 (delta 251), reused 185 (delta 185), pack-reused 1037 (from 3)
Receiving objects: 100% (1378/1378), 1.84 MiB | 2.63 MiB/s, done.
Resolving deltas: 100% (687/687), done.
error: ssh died of signal 6
fatal: remote transport reported error
failed to run git: exit status 128
I am not sure what I am missing...
My phone is a Galaxy S5 Neo (running LineageOS 18.1):
~ $ uname -a Linux localhost 3.10.108-ge773f94621d #1 SMP PREEMPT Sun Nov 28 12:47:34 CET 2021 armv8l Android
Does the ssh command work for you to connect to a normal SSH server, or is it possible for you to reproduce the same problem by just using the ssh command to connect to a normal SSH server without involving git?
The ssh command works for me. I am able to login and get shell access.
I did notice something:
If I ssh to GitHub from my phone, I get this extra line that says "Aborted":
~ $ ssh -T [email protected]
Hi brianwoo! You've successfully authenticated, but GitHub does not provide shell access.
Aborted ssh -T [email protected]
From my computer, I do not have that line showing in my terminal.
From logcat:
11-19 18:07:47.849 12529 12529 W bash : type=1400 audit(0.0:9268): avc: granted { execute } for name="ssh" dev="mmcblk0p23" ino=2809 scontext=u:r:untrusted_app_27:s0:c151,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c151,c256,c512,c768 tclass=file app=com.termux.boot
11-19 18:07:49.364 12529 12529 I scudo : Scudo ERROR: invalid chunk state when deallocating address 0xe6b55af0
11-19 18:07:49.364 12529 12529 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 12529 (ssh), pid 12529 (ssh)
11-19 18:07:49.400 12535 12535 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
11-19 18:07:49.409 12535 12535 I crash_dump32: performing dump of process 12529 (target tid = 12529)
11-19 18:07:49.412 12535 12535 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-19 18:07:49.413 12535 12535 F DEBUG : LineageOS Version: '18.1-20211128-UNOFFICIAL-s5neolte'
11-19 18:07:49.413 12535 12535 F DEBUG : Build fingerprint: 'samsung/s5neoltevl/s5neoltecan:6.0.1/MMB29K/G903WVLU1BQA1:user/release-keys'
11-19 18:07:49.413 12535 12535 F DEBUG : Revision: '0'
11-19 18:07:49.413 12535 12535 F DEBUG : ABI: 'arm'
11-19 18:07:49.413 12535 12535 F DEBUG : Timestamp: 2025-11-19 18:07:49-0700
11-19 18:07:49.414 12535 12535 F DEBUG : pid: 12529, tid: 12529, name: ssh >>> ssh <<<
11-19 18:07:49.414 12535 12535 F DEBUG : uid: 10151
11-19 18:07:49.414 12535 12535 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
11-19 18:07:49.414 12535 12535 F DEBUG : Abort message: 'Scudo ERROR: invalid chunk state when deallocating address 0xe6b55af0
11-19 18:07:49.414 12535 12535 F DEBUG : '
11-19 18:07:49.414 12535 12535 F DEBUG : r0 00000000 r1 000030f1 r2 00000006 r3 ffbcf3d8
11-19 18:07:49.414 12535 12535 F DEBUG : r4 ffbcf3ec r5 ffbcf3d0 r6 000030f1 r7 0000016b
11-19 18:07:49.414 12535 12535 F DEBUG : r8 ffbcf3d8 r9 ffbcf3e8 r10 ffbcf408 r11 ffbcf3f8
11-19 18:07:49.414 12535 12535 F DEBUG : ip 000030f1 sp ffbcf3a8 lr e6cbf811 pc e6cbf824
11-19 18:07:49.425 12535 12535 F DEBUG : backtrace:
11-19 18:07:49.425 12535 12535 F DEBUG : #00 pc 00038824 /apex/com.android.runtime/lib/bionic/libc.so (abort+172) (BuildId: 5f11d11806ced6e016edcbac728d2b98)
11-19 18:07:49.425 12535 12535 F DEBUG : #01 pc 0002e42f /apex/com.android.runtime/lib/bionic/libc.so (scudo::die()+2) (BuildId: 5f11d11806ced6e016edcbac728d2b98)
11-19 18:07:49.425 12535 12535 F DEBUG : #02 pc 0002e81d /apex/com.android.runtime/lib/bionic/libc.so (scudo::ScopedErrorReport::~ScopedErrorReport()+16) (BuildId: 5f11d11806ced6e016edcbac728d2b98)
11-19 18:07:49.425 12535 12535 F DEBUG : #03 pc 0002e993 /apex/com.android.runtime/lib/bionic/libc.so (scudo::reportInvalidChunkState(scudo::AllocatorAction, void*)+46) (BuildId: 5f11d11806ced6e016edcbac728d2b98)
11-19 18:07:49.425 12535 12535 F DEBUG : #04 pc 0002f673 /apex/com.android.runtime/lib/bionic/libc.so (scudo::Allocator<scudo::AndroidConfig, &(scudo_malloc_postinit)>::deallocate(void*, scudo::Chunk::Origin, unsigned long, unsigned long)+242) (BuildId: 5f11d11806ced6e016edcbac728d2b98)
11-19 18:07:49.425 12535 12535 F DEBUG : #05 pc 0002f573 /apex/com.android.runtime/lib/bionic/libc.so (scudo_free+18) (BuildId: 5f11d11806ced6e016edcbac728d2b98)
11-19 18:07:49.426 12535 12535 F DEBUG : #06 pc 000749db /data/data/com.termux/files/usr/bin/ssh
11-19 18:07:49.469 12529 12529 W ssh : type=1701 audit(0.0:9292): auid=4294967295 uid=10151 gid=10151 ses=4294967295 subj=u:r:untrusted_app_27:s0:c151,c256,c512,c768 reason="memory violation" sig=6 app=com.termux.boot