Termux
Termux
sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list
ssh
pkg install openssh
Termux
密码passwd
ssh
服务sshd
pkg update
ssh-keygen -A
然后再尝试使用sshd
启动服务
ssh
使用常见的 ssh
连接工具 xshell
等 连接时 ip
就是手机的 ip
端口是 8022
用户名是 user
密码就是上面设置的
debian
(同理也可以安装别的系统)proot-distro
pkg install proot-distro
# 查看帮助
proot-distro help
# 查询支持哪些发行版本
proot-distro list
debian
中间可能需要连接到国际互联网
proot-distro install debian
等待跑码完成.
debian
运行
proot-distro login debian
即可进入 debian
啦~
debian
系统Debian
的软件源配置文件是 /etc/apt/sources.list
进行修改 默认自带的文本编辑器是 nano
, 居然连 vi
都没有(小声)
vi /etc/apt/sources.list
添加上下面这几段(推荐把自带源注释掉, 在前面加上#即可)
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
修改完成后记得刷新一下
apt update
locales
apt-get install locales
dpkg-reconfigure locales
选中zh_CN.UTF-8 UTF-8
(用上下切换, 空格选中, 回车继续) 把默认也改成zh_CN.UTF-8 UTF-8
等待一会儿就切换完成了
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
使用 date
查看是否生效
记得给 Termux
后台上锁, 然后设置无限制, 防止被杀后台