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

推荐订阅源

博客园_首页
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
B
Blog
The Register - Security
The Register - Security
L
LangChain Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
F
Full Disclosure
The GitHub Blog
The GitHub Blog
Recorded Future
Recorded Future
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Blog — PlanetScale
Blog — PlanetScale
Jina AI
Jina AI
美团技术团队
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
阮一峰的网络日志
阮一峰的网络日志
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
D
DataBreaches.Net
Martin Fowler
Martin Fowler
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
The Cloudflare Blog
博客园 - 【当耐特】
U
Unit 42
月光博客
月光博客
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
博客园 - 聂微东
I
InfoQ
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
Cyberwarzone
Cyberwarzone
V
V2EX
S
Securelist
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Security @ Cisco Blogs
PCI Perspectives
PCI Perspectives
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Heimdal Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Hacker News
The Hacker News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tor Project blog

问题库 on 打工人日志

k8s master 节点 Unauthorized kindle 邮件发送失败,错误代码E999 linux服务器进程打开文件过多导致服务异常 解决Elasticsearch索引只读(read-only) Linux 系统收包流程以及内核参数优化 Vue3 + vite + nginx项目部署后404问题 githubAction set-output弃用错误 k8s CNI 问题 连接认证失效 k8s.gcr.io国内无法连接解决方法 K8S 问题排查:cgroup 内存泄露问题 docker 问题处理 安装 docker 出现 ERROR: Unsupported distribution 'ol' 问题
SELinux 问题:导致端口无法创建,无法访问
2024-08-02 · via 问题库 on 打工人日志

背景

今天有同事在使用nginx部署一个服务,部署完成后发现无法访问,nginx创建端口无法创建,无法访问
nginx-error

nginx: [emerg] bind() to 0.0.0.0:8081 failed (13: Permission denied)

解决方法

查看日志发现是SELinux导致的,SELinux是Linux系统的安全机制,它会限制进程访问文件和网络端口等资源。
查看SELinux状态

当 SELinux 处于 enforcing 模式时,会阻止进程访问不允许的资源。有三种方法可以解决

1. 临时关闭SELinux

2. 永久关闭SELinux

1sudo vim /etc/selinux/config
2# 修改SELINUX=enforcing 为 SELINUX=disabled

重启服务器

3. 设置为宽容模式

1semanage permissive -a http_port_t

这个命令会将 http_port_t 类型的端口设置为宽容模式(permissive mode),使得 semanage 不再对该类型的端口进行访问控制。

总结

SELinux 是 Linux 系统的安全机制,它会限制进程访问文件和网络端口等资源。在使用 SELinux 时,需要根据实际情况选择合适的解决方案。