音乐播放器
Dustin Blog
 
文章 标签
9

Powered by Dustin | Theme: Fog

安卓 Termux 软件

👏 欢迎使用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
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

👇 设置用户密码

  • 输入 passwd,输入两次要设置的密码。开启 ssh 服务并查看当前内网地址。
sshd
ifconfig

👇 设置 Storage 软链接

  • 在 Termux 中输入以下命令,应该会弹框确认是否授权。成功拿到存储权限后,会在 home 目录生成 storage 目录,并且生成若干目录,软连接都指向外置存储卡的相应目录。
  • 值得注意的是,storage 目录下有一个 shared 的目录,在这个 shared 目录中映射到我们手机内部存储的目录。

👇 SSH 远程登录

ssh -p 8022 root@192.168.85.137

👇 内网穿透实现

  • 它会创建一个 DNS 解析文件,路径在 $PREFIX/etc/resolv.conf,里面有配置 DNS 解析服务器地址,默认已经加了 8.8.8.8
apt install dnsutils
  • 下载最新的 cpolar 客户端。
curl -O -L https://www.cpolar.com/static/downloads/cpolar-stable-linux-arm.zip
unzip cpolar-stable-linux-arm.zip
  • 官网下获取认证的 token
./cpolar authtoken NmJmMTgwMzYtOTE5ZS00YmE0LWE1MDctYjUxYTQ3MDkyZGY2
  • 映射 8000 端口到外网。
./cpolar http -region=cn 8000

👇 安装 Ubuntu

  • 安装 proot-distrot 及 Ubuntu。
apt install proot-distro
proot-distro install ubuntu
  • 登录 Ubuntu。
proot-distro login ubuntu
  • 安装一些必要工具。
apt update
apt install vim python3 openssh-server -y
  • 配置一下 ssh 的配置,主要是端口,用于区分外部的 ssh
vi /etc/ssh/sshd_config
######文件修改内容如下######
PermitRootLogin yes
Port 2222
######文件修改内容结束######
service ssh start

😘 Thank you for browsing,Enjoy~