我使用的手机是 MI 5。
1、安装并运行 Termux
2、安装 OpenSSH
3、查看当前用户名
u0_a126
4、给当前用户设置密码
5、启动 SSH
6、查看当前 IP
以下操作可以在 SSH 客户端工具(例如:putty、Xshell)中进行。注意,SSH 的连接端口是:8022。
7、访问本机存储(非必须)
此时,在手机上会弹出一个对话框:“要允许 Termux 访问您设备上的照片、媒体内容和文件吗?”,点击“允许”。
8、更换清华大学的镜像源(非必须)
$ sed -i 's@^\(deb.*games stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@' $PREFIX/etc/apt/sources.list.d/game.list
$ sed -i 's@^\(deb.*science stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@' $PREFIX/etc/apt/sources.list.d/science.list
$ pkg update
9、安装 proot-distro
10、查看提供的发行版
目前,支持的发行版本比较少,只有以下几种:
Supported distributions:
* Alpine Linux 3.12.0
Alias: alpine
Status: NOT installed
* Arch Linux
Alias: archlinux
Status: NOT installed
* Debian 10 (Buster)
Alias: debian-buster
Status: NOT installed
* Kali Nethunter
Alias: nethunter
Status: NOT installed
Comment: Minimal version, most of utilities should be installed manually.
* Ubuntu 18.04
Alias: ubuntu-18.04
Status: NOT installed
* Ubuntu 20.04
Alias: ubuntu-20.04
Status: NOT installed
Install selected one with: proot-distro install <alias>
这里,我选择 Ubuntu 20.04:
安装完后,使用如下命令登录:
Copyright © 2005-2023 by www.ricensoftwares.com.cn All Rights Reserved.