【Termux专题】(一)变废为宝,将你淘汰的旧手机变为专属服务器。
in 学习记录 with 67 comments

【Termux专题】(一)变废为宝,将你淘汰的旧手机变为专属服务器。

in 学习记录 with 67 comments

神器Termux简介

下载termux

打开我的电脑输入并访问这个地址
这样就访问到了手机文件,将安装包复制到手机安装即可
2024-01-07T04:40:37.png

安装配置termunx

手机上找到你上传的安装包并安装,成功后的界面如下
2024-01-07T05:14:24.png

自 2021 年 5 月 1 日起,以前托管在 JFrog Bintray 上的所有 Termux 存储库都已关闭。这意味着域上托管的所有存储库都不再可用。
因此对于我们用户来讲 首先需要进行换源 (仅适用于 Android 7+)

方法也很简单,手机终端执行:

termux-change-repo sources.list

1、通过点击“空格”并通过向上/向下箭头键在列表中导航来选择要更改镜像的一个或多个存储库。点击回车确认选择。
2024-01-07T05:14:33.png

2、选择一个,建议从Grimler托管的镜像开始。与之前相同,通过箭头键浏览列表,通过空格键选择镜像,然后按“Enter”确认选择。
2024-01-07T05:14:51.png
强烈建议在更换镜像后运行。 pkg upgrade

3、访问本机存储。
手机 App 默认只能访问自己的数据,如果要访问手机的存储,需要请求权限。

termux-setup-storage

开启ssh访问

由于自己在手机上打字效率堪忧,所以我决定先在 Termux 上配置个 SSH 服务,让 PC 端能够远程连接到手机。

# 安装SSH服务
$ pkg install openssh

# 设置密码
$ passwd

# 启动sshd服务
$ sshd

配置完成后,确认下 SSH 连接的相关信息。需要注意的是,Termux 的 sshd 服务默认监听在 8022 端口上。

# 查询手机ip,以实际手机ip为准
$ ifconfig
=> 192.168.10.222

# 查询当前用户
$ whoami
u0_a131

# 确认ssh服务的监听端口
netstat -ntlp | grep sshd
tcp        0      0 0.0.0.0:8022            0.0.0.0:*               LISTEN      28618/sshd          
tcp6       0      0 :::8022                 :::*                    LISTEN      28618/sshd

然后通过你的shell工具 就可以通过电脑操作了
2024-01-07T05:58:15.png

Responses
  1. 1

    555

    Reply
    1. 1
      @1

      1

      Reply
      1. 1
        @1

        1

        Reply
      2. 1
        @1

        1

        Reply
      3. 1
        @1

        1

        Reply
      4. 1
        @1

        1

        Reply
      5. 1
        @1

        1

        Reply
      6. 1
        @1

        1

        Reply
      7. 1
        @1

        1

        Reply
      8. 1
        @1

        1

        Reply
      9. 1
        @1

        1

        Reply
      10. lxbfYeaa
        @1

        1

        Reply
      11. lxbfYeaa
        @1

        1

        Reply
      12. lxbfYeaa
        @1

        1

        Reply
      13. lxbfYeaa
        @1

        1

        Reply
      14. lxbfYeaa
        @1

        1

        Reply
      15. lxbfYeaa
        @1

        1

        Reply
      16. lxbfYeaa
        @1

        1

        Reply
      17. lxbfYeaa
        @1

        1

        Reply
    2. 1
      @1

      1

      Reply
      1. 1
        @1

        1

        Reply
      2. 1
        @1

        1

        Reply
      3. 1
        @1

        1

        Reply
      4. 1
        @1

        1

        Reply
      5. 1
        @1

        1

        Reply
      6. 1
        @1

        1

        Reply
      7. 1
        @1

        1

        Reply
      8. 1
        @1

        1

        Reply
      9. 1
        @1

        1

        Reply
      10. lxbfYeaa
        @1

        1

        Reply
      11. lxbfYeaa
        @1

        1

        Reply
      12. lxbfYeaa
        @1

        1

        Reply
      13. lxbfYeaa
        @1

        1

        Reply
      14. lxbfYeaa
        @1

        1

        Reply
      15. lxbfYeaa
        @1

        1

        Reply
      16. lxbfYeaa
        @1

        1

        Reply
      17. lxbfYeaa
        @1

        1

        Reply
      18. lxbfYeaa
        @1

        1

        Reply
      19. lxbfYeaa
        @1

        1

        Reply
      20. lxbfYeaa
        @1

        1

        Reply
      21. lxbfYeaa
        @1

        1

        Reply
      22. lxbfYeaa
        @1

        1

        Reply
      23. lxbfYeaa
        @1

        1

        Reply
      24. lxbfYeaa
        @1

        1

        Reply
      25. lxbfYeaa
        @1

        1

        Reply
      26. lxbfYeaa
        @1

        1

        Reply
      27. lxbfYeaa
        @1

        1

        Reply
      28. lxbfYeaa
        @1

        1

        Reply
    3. 1
      @1

      1

      Reply
    4. 1
      @1

      1

      Reply
    5. 1
      @1

      1

      Reply
    6. lxbfYeaa
      @1

      1

      Reply
    7. lxbfYeaa
      @1

      1

      Reply
    8. 1
      @1

      1

      Reply
    9. lxbfYeaa
      @1

      1

      Reply
    10. 1
      @1

      1

      Reply
    11. lxbfYeaa
      @1

      1

      Reply
    12. lxbfYeaa
      @1

      555

      Reply
  2. 1

    1

    Reply
  3. 1

    1

    Reply
  4. 1

    1

    Reply
  5. 1

    1

    Reply
  6. 博主真是太厉害了!!!

    Reply
  7. 看的我热血沸腾啊

    Reply
  8. 叼茂SEO.bfbikes.com

    Reply
  9. 看的我热血沸腾啊https://www.237fa.com/

    Reply
  10. 不错不错,我喜欢看 www.jiwenlaw.com

    Reply