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

推荐订阅源

W
WeLiveSecurity
T
Tenable Blog
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
S
Schneier on Security
Scott Helme
Scott Helme
S
Securelist
Know Your Adversary
Know Your Adversary
Vercel News
Vercel News
IT之家
IT之家
V
V2EX
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
K
Kaspersky official blog
博客园_首页
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
有赞技术团队
有赞技术团队
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
S
SegmentFault 最新的问题
AWS News Blog
AWS News Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost

error 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 error 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 时,需要根据实际情况选择合适的解决方案。