请给我一个线索,它在哪里? 它不在/etc/udev/rules.d下 # find / -name "*persistent-net.rules"找不到任何东西…
我想: 删除外部networking中除80和443之外的所有传入连接 允许192.168.0.0/16上的内部机器连接到:9000:8080 以下是我通过firewall-cmd设置我的drop区的过程: echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf sysctl -p systemctl start firewalld.service systemctl enable firewalld firewall-cmd –set-default-zone=drop firewall-cmd –permanent –zone=drop –add-service=ssh firewall-cmd –permanent –zone=drop –add-port=80/tcp firewall-cmd –permanent –zone=drop –add-port=443/tcp firewall-cmd –zone=drop –permanent –add-rich-rule='rule source address="192.168.0.0/16" port port="9000" protocol="tcp" accept' firewall-cmd –zone=drop –permanent –add-rich-rule='rule source address="192.168.0.0/16" port port="8080" protocol="tcp" accept' firewall-cmd –reload 以下是活动drop区的外观: [root@machine ~]# […]
我一直在努力通过一些奇怪的 (对我)firewalld错误,但现在看到我想要的防火墙行为。 但是,对我来说,有什么作品似乎是drop区和trusted [root@douglasii ~]# firewall-cmd –get-active-zones drop interfaces: eth0 veth879317c vethaff7c39 vethb2fec6e trusted sources: 192.168.0.0/16 [root@douglasii ~]# firewall-cmd –zone=drop –list-all drop (default, active) interfaces: eth0 veth879317c vethaff7c39 vethb2fec6e sources: services: ssh ports: 443/tcp 80/tcp masquerade: no forward-ports: icmp-blocks: rich rules: [root@douglasii ~]# firewall-cmd –zone=trusted –list-all trusted interfaces: sources: 192.168.0.0/16 services: ssh ports: 443/tcp 80/tcp […]
我正在使用这个OpenLDAP一步一步的教程 : http : //www.server-world.info/en/note? os = CentOS_7&p = openldap& f =1 重要:我正在使用CentOS 7 但是当我在第一部分中尝试启动slapd : systemctl start slapd ,它会抛出一个我无法解决的错误 。 我在网上寻找,StackOverflow和服务器故障,但任何人都有同样的问题。 这是错误的 : # systemctl start slapd Job for slapd.service failed. See 'systemctl status slapd.service' and 'journalctl -xn' for details. 这里的堆栈跟踪或错误,当我检查systemctl status 。 [root@localhost openldap]# systemctl status slapd -l slapd.service – OpenLDAP Server Daemon […]
我用ssh连接到我的服务器(Centos 7),我尝试ping到localhost: ping 127.0.0.1但是不起作用: ping 127.0.0.1 PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. ^C — 127.0.0.1 ping statistics — 78 packets transmitted, 0 received, 100% packet loss, time 76999ms 在这里我的文件。 networking : default 0.0.0.0 loopback 127.0.0.0 link-local 169.254.0.0 主持人 : # nameserver config # IPv4 127.0.0.1 localhost.localdomain localhost 1xx.xxx.xxx.xxx server # # IPv6 ::1 ip6-localhost […]
我在SELINUX上遇到了一些问题。 当试图访问我的网站时,我得到了来自nginx的403禁止,服务器popup一个错误,并说使用grep NGINX /var/log/audit/audit.log | audit2allow -M mypol我做了,但是, 当试图加载页面,现在说拒绝访问,并要求使用命令grep PHP-FPM /var/log/audit/audit.log | audit2allow -M mypol,当我这样做,它然后回到403禁止访问,并要求我再次使用第一个命令。 就好像grep NGINX覆盖了php-fpm和反之。 如何解决这个问题,而不禁用selinux? 我有权访问服务器上的gnome桌面,SELinux安全警报告诉我使用这些命令来解决问题,第一个命令确实解决了这个问题,但是却引发了另一个问题,当使用第二个命令时,它会覆盖第一个命令并返回到一个方。 我知道,如果我禁用selinux它将工作,但它是不安全的,把服务器的风险。 谢谢。
我们的服务器离线运行,我们需要安装很多yum软件包,比如oracle-jdk,elasticsearch,nginx等。 有什么办法可以下载rpm的依赖关系,所以我们可以在服务器上离线安装它们?
最近我一直在玩Cobbler(在CentOS 7发行版中),而且在导入CentOS 7 iso时遇到了错误。 我已经find了解决问题的办法,我认为分享我所学到的知识会很酷。 这是有问题的问题: $ sudo mount -t iso9660 -o loop,ro CentOS-7-x86_64-DVD-1503-01.iso /mnt $ sudo cobbler import –name=centos7 –arch=x86_64 –path=/mnt task started: 2015-05-29_144409_import task started (id=Media import, time=Fri May 29 14:44:09 2015) Exception occured: <class 'cobbler.cexceptions.CX'> Exception value: 'Command failed' Exception Info: File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 87, in run rc = self._run(self) File "/usr/lib/python2.7/site-packages/cobbler/remote.py", […]
我在装有KVM和virt-manager的Centos 7上。 我有一个虚拟(客户)机器上的Debian 8.1。 guest虚拟机上的networking使用NAT(使用默认设置)configuration了virt-management。 所以现在我的虚拟机有Internet访问和本地IP 192.168.122.227。 在我的主机系统上,我有1个物理networking接口,1个主要的公共IP地址和3个额外的公共IP地址。 我的公共ips(例子):85.0.0.1,85.0.0.2,85.0.0.3,85.0.0.4 广播也是例子。 我的主机的ifconfig: enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 85.0.0.1 netmask 255.255.255.192 broadcast 85.0.0.127 ether d4:3d:7e:ec:b3:55 txqueuelen 1000 (Ethernet) RX packets 4920 bytes 416179 (406.4 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2298 bytes 392837 (383.6 KiB) TX errors 0 dropped 0 overruns […]
问题简介:当创build新/自定义文档根目录时,SELinux不会保护标记为httpd_sys_content_t的文件和目录不被写入,删除或更改。 我已经在不同的服务器版本上重复了两次这种行为。 环境干净,新鲜安装的CentOS 7.完全通过百胜补丁。 epl回购安装。 Apache,PHP,MySQL(mariadb),phpmyadmin安装。 SELinux在CentOS 7上默认启用。getenforce和sestatus都确认SELinux正在运行。 我在apache中创build了一个简单的虚拟主机,其文档根目录设置为:/ web / sites / test1 起初,一切都按预期工作。 SELinux将不允许Apache显示该网站,直到我做了以下事情: semanage fcontext –add –type httpd_sys_content_t "/web(/.*)?" semanage fcontext –add –type httpd_sys_content_t "/web/sites(/.*)?" restorecon -Rv /web 正如所料,这样做后,虚拟主机工作。 然而,奇怪的行为是,在该虚拟主机中安装WordPress,即使httpd_sys_content_t上下文不应允许(根据我的理解),我可以通过WordPress上传图像等。 我已经确认,wordpress目录中的所有文件都被正确标记为:httpd_sys_content_t 然而wordpress仍然可以写入目录(只要老式文件权限允许)。 我提出了一个解决scheme:在执行完整的文件系统重新标记后,恢复典型/预期的行为: touch /.autorelabel reboot 重新启动后,我必须使用httpd_sys_rw_content_t上下文。 但是我想更清楚地理解为什么这样一个步骤是必要的,因为我已经读过一个完整的重新标记应该很less(如果有的话)是必要的。 有没有更容易,更不激烈的手段让SELinux的行为如预期? 为了更加简洁:我是否应该在这种情况下做一个“touch /.autorelabel”? 有没有更好的办法? 如果它没有做任何事情就可以工作(这也是CentOS 7开箱即用的错误)?