Termux在Andriod安装centos
一、下载Termux1、下载地址:https://f-droid.org/repo/com.termux_106.apk2、在手机端进行安装。二、配置ssh,使用pc远程操作1、更新软件源,使用命令替换为清华源镜像(这里没替换,是在pc连接后才换的)。卡住了就按回车。sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsi
·
一、下载Termux
1、下载地址:https://f-droid.org/repo/com.termux_106.apk
2、在手机端进行安装。
二、配置ssh,使用pc远程操作
1、更新软件源,使用命令替换为清华源镜像(这里没替换,是在pc连接后才换的)。卡住了就按回车。
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
apt update
2、安装openssh-server
pkg install openssh
3、设置ssh连接密码
$passwd
#根据提示设置一个密码
New password:
4、查看手机ip,远程连接ip(192.168.x.x,以192.168开头);查看用户。
ifconfig
whoami
5、重启ssh连接
sshd &
6、pc端创建ssh会话连接,端口号8022
7、挂载储存卡,使得可以用cd命令访问文件目录
termux-setup-storage
8、修改Termux的问候语,测试pc对手机的操作是否成功。
(1)安装vim(如果出现问题,说明清华源没有修改成功,去修改更新)
pkg install vim
(2)修改问候语(手机端执行命令,粘贴banner图)
vim $PREFIX/etc/motd
三、安装centos
1、配置proot,用于模拟sudo权限
pkg install proot
termux-chroot
2、配置wget,用来下载文件
pkg install wget
3、安装centos命令(龟速等待安装下载中······)----=-=-==–【也可以使用Anlinux软件复制命令进行安装】
mkdir CentOS && cd CentOS && pkg install wget openssl-tool proot -y && hash -r && wget https://raw.fastgit.org/EXALAB/AnLinux-Resources/master/Scripts/Installer/CentOS/centos.sh && sed -i 's/githubusercontent.com/fastgit.org/' centos.sh && bash centos.sh && rm centos.sh
附,若安装图形界面linux系统Ubuntu,则使用以下命令
mkdir Ubuntu && cd Ubuntu && pkg install wget openssl-tool proot -y && hash -r && wget https://raw.fastgit.org/EXALAB/AnLinux-Resources/master/Scripts/Installer/Ubuntu/ubuntu.sh && sed -i 's/githubusercontent.com/fastgit.org/' ubuntu.sh && bash ubuntu.sh && rm ubuntu.sh
4、启动centos,进入目录启动centos
ls
./start-centos.sh
更多推荐
已为社区贡献1条内容
所有评论(0)