安卓5.0的termux搭建及基本使用
一、termux的下载与安装
下载termux
二、更换国内镜像源
在更换镜像源之前先安装好vim编辑工具
pkg install vim
需要注意的是termux的根目录路径略有不同
系统默认使用以下变量代替路径,也可以根据个人习惯进行更改
HOME="data/data/com.termux/files/home"
PREFIX="data/data/com.termux/files/home"
- 添加国内镜像源
cd $PREFIX/etc/apt
vim sources.list
注释原内容添加
deb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main
cd /sources.list.d
同理
vim science.list
注释原内容添加
deb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable
vim game.list
注释原内容添加
deb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable
- 更换完镜像源后进行软件更新
pkg update
pkg upgrade
三、SSH搭建
由于手机屏幕太小,使用起来不方便,所以我们可以通过搭建SSH进行远程操作
- 安装SSH
pkg install openssh
- 设置密码
passwd
- 查询本机IP
ifconfig
- 开启SSH
sshd
利用SSH工具进行连接,termux的SSH默认端口是8022
SSH工具推荐使用MobaXterm
- 安装termux-services,设置SSH自启动
pkg install termux-services
sv-enable sshd
同样也可以设置其他服务自启动
四、超级管理员权限
termux的root权限有两种方法
- 手机没有root,利用proot模拟root
pkg install proot
termux-chroot //进入root
exit //退出
- 手机已经root,可以安装tsu
pkg install tsu
tsu //进入root
exit //退出
五、建立手机存储的软连接
termux-setup-storage
$HOME目录下会新建一个storage目录,里面是手机一些文件目录的软连接
推荐教程:Termux 高级终端安装使用配置教程