zoukankan      html  css  js  c++  java
  • termux-安装 可拿旧手机当服务器

    termux

    安装termux

    1. 手机上下载termux(Android终端仿真器和Linux环境应用程序)

    网址: https://f-droid.org/en/packages/com.termux/

    1. 安装vim编辑器
    
    pkg install vim #安装vim
    
    export EDITOR=vim #将vim设置成默认编辑器
    
    apt edit-sources #将里面的网址替换为 https://mirrors.tuna.tsinghua.edu.cn/termux/ 清华源速度快
    
    apt-get update #改变了源,要更新apt的资源列表  apt-get upgrade 是更新系统
    
    
    1. 安装sudo软件
    
    pkg install tsu #开始没有sudo,需要安装
    
    
    1. 配置ssh

    4.1. 查看ip地址

    
    ifconfig #查看linux ip地址,192.168开头的是ip
    
    

    4.2. 安装ssh软件

    
    pkg install openssh #安装openssh
    
    passwd #安装完成配置密码,输入两次
    
    pkg install nmap #安装nmap
    
    sshd
    
    nmap [ip地址] 上面sshd与nmap来开启服务
    
    

    4.3. 用xshell连接

    新建会话,名称随意,主机就是手机上的ip地址(ifconfig) ,协议ssh, 端口号8022,连接即可.

    重启termux需要重新输入sshd和nmap命令来开启ssh服务, 否则无法连接

    1. 安装ubuntu
    
    pkg install proot wget -y
    
    pkg installl proot-distro
    
    proot-distro list
    
    这时会列出ubuntu版本
    
    
    
    这时我们选 ubuntu-20.04
    
    运行
    
    proot-distro install ubuntu-20.04
    
    安完之后
    
    proot-distro login ubuntu-20.04
    
    就可以运行了,这时运行 ps -a 可以查看进程
    
    
    1. ubuntu安装mysql

    mysql5.7设置密码:

    
    use mysql;
    
    update user set authentication_string=PASSWORD("密码") where user='root';
    
    update user set plugin="mysql_native_password";
    
    flush privileges;
    
    quit;
    
    
    1. 内网穿透
    
    https://github.com/fatedier/frp/releases
    
    #免费穿透网址
    
    https://frp.starry.tk/
    
    #b站教程
    
    https://www.bilibili.com/read/cv7512606/
    

     
  • 相关阅读:
    sqlserver读取日志以及复制
    SqlServer 2012 清理日志 截断日志的方法
    android Qzone的App热补丁热修复技术
    热修复技术学习总结
    android免root hook框架legend
    Dalvik虚拟机java方法执行流程和Method结构体分析
    Andfix热修复技术使用
    OKHttp概览
    B-tree B+tree适合文件系统索引和MySQL索引
    B-tree B+tree B*Tree
  • 原文地址:https://www.cnblogs.com/jscs/p/15441294.html
Copyright © 2011-2022 走看看