自学内容网 自学内容网

termux安装openssh+nginx

如何将你的android手机变成一台服务器

首先安装termux应用

下载地址

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

安装openssh
pkg up

pkg Install openssh

sshd //启动查看是否安装成功

如果失败
更新ssl
pkg install openssl
添加密钥
ssh-keygen -A

重启
sshd

开启读写权限
termux-setup-storage

查看ssh用户名
whoami

修改密码
passwd

比如 passwd 123

查看自己手机的ip地址
ifconfig

用你的笔记本连接你的手机

ssh -p8082 u0_a1583@192.168.31.148

安装nginx

pkg install nginx

启动nginx 

nginx

默认端口 8080

nginx 默认html地址
/data/data/com.termux/files/usr/share/nginx/html

nginx.conf 地址

使用sftp

sftp 连接命令

sftp -P 8022 u0_a1583@192.168.31.148 


传文件 
put 要上传文件 remote-dir

传文件夹

put -r


原文地址:https://blog.csdn.net/sun_weitao/article/details/136027878

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!