摘要: # 帮助限制 Nginx 进程的权限,从而减少系统遭受恶意攻击的风险 # 通常,出于安全考虑,推荐不使用 root 用户运行网络服务 # user <username> [groupname]; # 设置 Nginx 将启动的工作进程数目(默认为 1) # worker_processes 7; # 阅读全文
posted @ 2024-04-25 23:30 op-timistic 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 场景:让用户输入 yes 再执行下一步 read -p "Please type 'yes' to continue: " input if [ "$input" != "yes" ]; then echo "You did not enter 'yes'. Exit..." exit 1 fi 阅读全文
posted @ 2024-04-25 23:29 op-timistic 阅读(17) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env bash set -xeuo pipefail # 需要以 root 运行,或者 sudo if [ `id -u` -ne 0 ] then echo Please run this script as root or using sudo! exit fi User 阅读全文
posted @ 2024-04-25 23:24 op-timistic 阅读(12) 评论(0) 推荐(0) 编辑