Android 使用 Termux 安装 Git 和 SSH

Android 使用 Termux 安装 Git 和 SSH

背景

在 Android 上使用 Git 客户端。

可选工具:

1.Pocket Git & MGit 客户端

2.Termux 安装 Git(选用)

下面介绍使用 Termux 安装 Git 和通过 SSH 远程连接 Termux。

1.换源

运行 termux-change-repo 命令,通过图形界面替换成 TUNA/BFSU 镜像源即可。

2.ssh

shell 复制代码
# 安装open-ssh
pkg install openssh

# 报错:CANNOT LINK EXECUTABLE "ssh-keygen": library "libcrypto.so.3" not found: needed by main executable
# 解决:安装 openssl1.1-tool。这里必须要指定版本,否则报错 library "libssl.so.1.1" not found
pkg install openssl1.1-tool

# 生成密钥
ssh-keygen -A

# 启动ssh
sshd

# 查看用户名
whoami

# 查看ip
ifconfig

# 设置密码
passwd

# 远程登录ssh连接termux,默认端口8022
ssh -p8022 uxxx@192.168.1.1

3.文件访问权限

shell 复制代码
termux-setup-storage

输出:

复制代码
/data/data/com.termux/files/usr/bin/termux-setup-storage: line 24: 25567 Aborted                 am broadcast --user 0 --es com.termux.app.reload_style storage -a com.termux.app.reload_style com.termux > /dev/null

解决:

shell 复制代码
pkg install termux-am

安装 Git

shell 复制代码
pkg install git

clone 项目。

参考

termux-change-repo换源
mac ssh 连接 android termux
library "libssl.so.1.1" not found解决
termux-setup-storage输出line 24: 25567 Aborted解决
Termux配置教程

相关推荐
无限进步_3 分钟前
【C++】重载、重写和重定义的区别详解
c语言·开发语言·c++·ide·windows·git·github
历程里程碑8 分钟前
1 . Git本地操作:版本控制 跨平台协作 仓库核心
java·开发语言·数据结构·c++·git·gitee·github
芜湖xin17 分钟前
【恒源智享云】pycharm社区版SSH方式使用实例
ssh·云服务器
JJay.23 分钟前
Android App Functions 深入理解
android
华科大胡子38 分钟前
Git + 云原生
git
johnny23340 分钟前
Git拓展:GitButler、Gitnuro、JGit
git
开发_李行1 小时前
简历对应知识点总结--专业技能5
android
corpse20101 小时前
VirtualBox 安装ubuntu-25 ,配置SSH工具登录
linux·ubuntu·ssh
网络安全许木1 小时前
自学渗透测试(1~6天工具使用的回温)
android
匆忙拥挤repeat1 小时前
Android Compose 状态保存的API总结
android