http 文件服务器
start_http_server.sh
#!/bin/bash
port=$1
host=127.0.0.1function Usage()
{echo -e "Usage:${0} [port]"exit 0
}if [[ ${port} == "" ]];thenUsage
fi# 检查端口号是否被占用
check_port=`netstat -ant|grep LISTEN|grep ${port}`
if [[ ${check_port} != "" ]];thenecho -e "Error! port:${port} is already in use"Usage
fipython3 -m http.server --bind ${host} ${port}
ftp 服务器
start_ftp_server.sh
#!/bin/bash
has_lib=`pip3 list|grep pyftpdlib|grep -v grep`
if [ -z "${has_lib}" ];thenecho "not find pip3 lib pyftpdlib, try install it"pip3 install pyftplib
fipython3 -m pyftpdlib -i 0.0.0.0 -p 20021 -d /root/shell -D -u ftpcontent -P ftpcontent