惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
Blog — PlanetScale
Blog — PlanetScale
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
U
Unit 42
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
B
Blog RSS Feed
Vercel News
Vercel News
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
T
Troy Hunt's Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
Jina AI
Jina AI
小众软件
小众软件
T
Threatpost
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
Scott Helme
Scott Helme
B
Blog
腾讯CDC
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
S
Schneier on Security
N
News and Events Feed by Topic
Microsoft Security Blog
Microsoft Security Blog
K
Kaspersky official blog
G
Google Developers Blog
T
Tor Project blog
PCI Perspectives
PCI Perspectives
S
Secure Thoughts
Google Online Security Blog
Google Online Security Blog
Latest news
Latest news
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
罗磊的独立博客

Rat's Blog - Python

Python 3.6一键安装脚本 for CentOS/Debian - Rat's Blog Linux VPS出现 “-bash: python: command not found”错误的解决方法 Linux CentOS升级Python 3.6版本方法 - Rat's Blog Linux CentOS 6升级Python 2.6至Python 2.7的方法
Linux VPS使用Python/Caddy快速搭建文件分享平台 - Rat's Blog
博主: Rat's · 2018-03-08 · via Rat's Blog - Python

说明:刚刚提到过Linux VPS快速分享文件方法,查看:Transfer.sh:Linux VPS使用命令行快速的分享文件,除了这个方法,我们还可以自建文件分享平台,由于Python内置了一个简单的HTTP服务器,而Caddy也是一个简单的HTTP服务器,所以这里可以分别使用PythonCaddy搭建文件分享平台。

Python

使用Python搭建是超级快的,就是界面有点不好看。

使用命令:

#进入要分享的文件目录
cd /moerats
#后面的端口随便填,注意防火墙设置
python -m SimpleHTTPServer 8080

建议配合screen一起使用,参考:使用screen来实现多任务不断线操作命令

然后我们可以打开http://IP:端口进入界面了。
请输入图片描述

Caddy

觉得Python搭建的界面不好看的,可以使用Caddy搭建,这里用的是逗比的脚本。

使用命令:

wget -N --no-check-certificate https://raw.githubusercontent.com/iiiiiii1/doubi/master/caddy_install.sh && chmod +x caddy_install.sh && bash caddy_install.sh
#备用地址
wget -N --no-check-certificate https://www.moerats.com/usr/shell/Caddy/caddy_install.sh && chmod +x caddy_install.sh && bash caddy_install.sh

创建IP访问,使用命令:

#以下一整条命令,直接复制即可,80为端口,可以随便修改,且/MOERATS为要分享的文件目录
echo ":80 {
 root /MOERATS
 gzip
 browse
}" > /usr/local/caddy/Caddyfile

然后我们可以打开http://IP:端口进入界面了。
请输入图片描述
如果打不开,重新启动下Caddy即可。

/etc/init.d/caddy start

版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/533/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。