AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[rhel6](server)

Martin Hope
zpangwin
Asked: 2021-12-17 12:37:45 +0800 CST

在 Fedora 上,如何配置 selinux 以允许新的未定义服务类型的端口?

  • 1

我有几件事希望能够在 Fedora 上作为服务器站起来。我知道我至少可以运行其中的一些,podman或者docker但我已经知道如何做到这一点。我也已经知道如何将其用于现有服务,例如ssh我只想通过以下方式使用自定义端口:

sudo semanage port -a -t ssh_port_t -p tcp 2222

但我的问题是 selinux 已经定义了ssh_port_t类型。如果我有一些由于某种原因我不能或不想在容器中运行的自定义应用程序怎么办,我将如何允许端口用于没有预定义类型的东西semanage port --list?

对于此示例,假设我正在尝试运行 /path/myNiftyGameServer 并希望允许它连接到 udp 端口​​ 12345(目前在我的系统上未使用)。我怎样才能做到这一点?

背景方面,我并不声称自己是大师,但总体上我感觉对 bash 和 Linux 相对精通,但在 SELinux 方面我仍然是一个新手(我知道标签、restorecon. 和一些基本semanage命令,但我仍然学习)。

请假设我不愿意简单地禁用 SELinux(因为我是)。如果这个问题看起来不切实际,可以提出其他建议,但我之所以问主要是因为我很好奇这个问题在 SELinux 中将如何解决,并且除了像我的 ssh 这样的现有类型之外,我自己无法找到解决方案上面的例子。请随时为 SELinux 新手推荐其他相关的阅读主题。

编辑:根据我在 Centos 上找到的 Starbound 服务器和Soldat Dedicated server policy的额外搜索,我猜我可能需要学习如何编写 SELinux 策略?当一项服务根本没有名称但我仍然想学习如何做时,我需要这么多真是太疯狂了。

编辑 2:在花了一些时间阅读它们之后,Starbound 链接似乎不是我所追求的;唯一的 SELinux 策略编写是针对单独的 Apache 服务器(Apache 已经定义)而不是游戏服务器。Soldat 似乎与我所追求的非常接近,但我认为我需要一本关于政策写作的入门书才能到达那里。特别是,我真的只对如何为自定义服务器/Web 服务打开端口感兴趣。设置文件路径访问听起来也不错,但是我可以使用用户帐户来管理它,而即使我在 firewall-cmd(firewalld)中打开一个网络端口,如果我没记错的话,它仍然会被 SELinux 阻止(我知道我有这个过去的问题,但我想我可以重新测试以确定)。

centos security fedora selinux rhel6
  • 1 个回答
  • 210 Views
Martin Hope
Darin Beaudreau
Asked: 2020-12-23 07:04:37 +0800 CST

百胜更新清理挂起

  • 0

我很难找到我正在使用的软件版本中遇到的问题的原因安装它的机器的初始映像。

这次更新没有什么特别之处。我们在 Raspberry Pi 上有一个 yum 存储库,连接到网络上的机器,这个存储库包含所有 RPM 包,以便在基础映像上更新。应用了一个简单的 yum update -y。如果我使用相同的 Raspberry Pi 并上传了不同版本的软件,则此相同的更新过程目前有效。

问题发生在一个包 ntp 上,在应用了所有更新后,yum 尝试清理旧版本的 ntp 包,但它只是挂起......我已经把它放在那里好几天了,它永远不会完成。

ntp 包的 RPM 与我们在软件的每个其他版本中使用的 RPM 相同,并且在任何其他版本中从未出现过此问题。存储库本身没有区别,正如我所说,安装程序只需调用 yum update -y。

我使用以下命令进行了检查: sudo lsof -p $(pgrep yum) | head -10 如另一个 StackExchange 线程中所建议的那样,并且正在运行的 yum 进程正在查看多个 DB 文件。不过,担心运行过程是没有意义的,因为安装向导应该是自动化的,并且它以前可以工作。

所以我想我想知道的是......由于我们的安装向导非常庞大,而且我在这里没有线索,有哪些可能会改变的事情会导致旧 ntp 包的清理挂起?我假设在安装过程中一定发生了一些变化,但我找不到与 NTP 或 yum 相关的明显差异。

有任何想法吗?如果重要的话,这是带有 2.6.32-754 内核的 Scientific Linux 6.4。

yum rhel6 scientific-linux
  • 1 个回答
  • 859 Views
Martin Hope
alexus
Asked: 2020-06-27 13:03:50 +0800 CST

应设置为 65000 以避免操作中断

  • 6

我正在关注将 Solr 投入生产 Apache Solr 参考指南 8.5solr ,但是在重新启动服务时无法克服警告:

# service solr restart
*** [WARN] *** Your open file limit is currently 1024.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] ***  Your Max Processes Limit is currently 1024.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Sending stop command to Solr running on port 8983 ... waiting up to 180 seconds to allow Jetty process 16065 to stop gracefully.
Waiting up to 180 seconds to see Solr running on port 8983 [\]
Started Solr server on port 8983 (pid=16320). Happy searching!

# 

我的系统:

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.10 (Santiago)
# uname -a
Linux X.X.X 2.6.32-754.30.2.el6.x86_64 #1 SMP Fri May 29 04:45:43 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux
# 

之后man 5 limits.conf:

# cat /etc/security/limits.d/498-solr.conf
solr    hard    nofile  65000
solr    hard    nproc   65000
#

但是,在重新启动 solr 服务时,我仍然收到该警告消息。

请指教)

提前致谢!


@MirceaVutcovici:

# grep 'Max processes' /proc/$(pgrep solr)/limits
grep: /proc//limits: No such file or directory
# pgrep solr
# echo $?
1
# ps ax | grep solr
 1926 ?        Sl     2:37 java -server -Xms512m -Xmx512m -XX:+UseG1GC -XX:+PerfDisableSharedMem -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=250 -XX:+UseLargePages -XX:+AlwaysPreTouch -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/var/solr/logs/solr_gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M -Dsolr.jetty.inetaccess.includes= -Dsolr.jetty.inetaccess.excludes= -Dsolr.log.dir=/var/solr/logs -Djetty.port=8983 -DSTOP.PORT=7983 -DSTOP.KEY=solrrocks -Dhost=rlos.uftwf.local -Duser.timezone=UTC -Djetty.home=/opt/solr/server -Dsolr.solr.home=/var/solr/data -Dsolr.data.home= -Dsolr.install.dir=/opt/solr -Dsolr.default.confdir=/opt/solr/server/solr/configsets/_default/conf -Dlog4j.configurationFile=/var/solr/log4j2.xml -Xss256k -Dsolr.jetty.https.port=8983 -Dsolr.log.muteconsole -XX:OnOutOfMemoryError=/opt/solr/bin/oom_solr.sh 8983 /var/solr/logs -jar start.jar --module=http
 9029 pts/0    S+     0:00 grep solr
# grep 'Max processes' /proc/1926/limits
Max processes             1024                 65000                processes
#
ulimit solr rhel6
  • 1 个回答
  • 9048 Views
Martin Hope
user1174838
Asked: 2020-03-12 17:37:44 +0800 CST

只有 oracle 用户可以运行 sqlplus

  • 0

我有几个带有 Oracle 12.2 服务器和 11.2 客户端的 RHEL 6 机器。这是供应商的要求。

在一台服务器上,我可以以任何用户身份运行 sqlplus,而在另一台服务器上,我只能以 oracle 用户身份运行 sqlplus。像任何其他用户一样运行会给出: ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

当我说 oracle 用户时,我指的是名为 oracle 的操作系统用户。

我检查了 listener.ora 和 tnsnames.ora(在客户端和服务器 ORACLE_HOME 结构中),两者都是相同的,除了主机名。

文件/目录权限(所有权和模式)看起来不错。

tnsping 和 lsnrctl 状态看起来都很好。

关于问题可能是什么的任何想法?

谢谢

- 编辑 -

这些环境变量已设置并且功能相同。

set | awk -F= '/ORA/ {print $1}' ORACLE_BASE ORACLE_HOME ORACLE_SID ORACLE_TERM ORACLE_UNQNAME ORA_SDTZ

oracle rhel6
  • 2 个回答
  • 67 Views
Martin Hope
GP92
Asked: 2018-03-09 02:54:28 +0800 CST

如何确定 RHEL 服务器中是否正在使用 haldaemon 或 udev?

  • 0

如果 hal 真的在使用还是只是 udev,我很困惑。

我的理解:

  • 一般来说,HAL 是一个抽象层,它允许操作系统与硬件设备进行交互。

  • daemon hald 与 HAL 不同。它是一种提供 HAL 的服务,用于识别设备,然后安装它们(以及它们将在哪里,在 /dev 下?)或自动配置它们以供应用程序使用。

  • 它现在被 udev 弃用,它也做了类似的事情,即通过读取来自内核的消息并根据预定义的规则命名来自动挂载连接的设备。

  • 目前只有少数基于 GUI 的应用程序,如 GNOMe 使用暂停,以获取有关新连接设备的通知(而安装仍然由 udev 负责?)

    所以我的问题是,如果 hal 仅用于通知基于 GUI 的应用程序有关新连接的硬件,因为它可以通过 DBUS 进行通信,但 udev 没有 dbus 实现。而对于自动挂载设备,只有 udev 这样做,而没有使用 hal?

我特别在谈论 Redhat 5,6 和 7。

谢谢。

rhel6
  • 1 个回答
  • 670 Views
Martin Hope
Arun Krishnan
Asked: 2017-02-07 02:04:53 +0800 CST

mount.cifs:挂载错误(112):主机已关闭

  • 4

我正在尝试在 CentOS 和 RHEL 6 机器上挂载 Windows samba 共享,但出现以下错误。

~]# mount.cifs //example.com/Linux_Support /mnt -o credentials=/root/cifsauth,noserverino,vers=3.0

mount error(112): Host is down 请参考 mount.cifs(8) 手册页(例如 man mount.cifs)

消息日志有这个错误:

CIFS VFS:cifs_mount 失败,返回码 = -112

上面的命令同样适用于 rhel7 和 centos7。关于如何使这项工作的任何线索?

mount cifs host centos6 rhel6
  • 4 个回答
  • 35425 Views
Martin Hope
raju
Asked: 2017-01-04 10:44:24 +0800 CST

什么是 red hat linux 的公共 yum 存储库

  • 2

我有一台red hat linux机器,当我尝试安装任何软件时,它说我的系统没有注册我应该如何安装

[root@JMNGD1BLT230V01 yum.repos.d]# yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
No package gettext-devel available.
No package openssl-devel available.
No package perl-CPAN available.
No package perl-devel available.
Nothing to do

以下是我的 repolist

[root@JMNGD1BLT230V01 yum.repos.d]# yum repolist
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id             repo name                                             status
rsyslog-v7-stable   Adiscon Rsyslog v7-stable for CentOS-6Server-x86_64     896
rsyslog-v8-stable   Adiscon Rsyslog v8-stable for CentOS-6Server-x86_64   1,071
repolist: 1,967
linux redhat installation rhel6
  • 2 个回答
  • 13268 Views
Martin Hope
bmaupin
Asked: 2016-11-10 09:29:58 +0800 CST

安装过时的包而不删除过时的包

  • 1

有没有办法在使用 yum 过时的软件包旁边安装过时的软件包?有几个冲突的文件,但这些包可以与这些文件的最新版本共存。

过时软件包的正常安装会删除过时的软件包:

# rpm -qa | grep tc-server
vfabric-tc-server-standard-2.9.7-RELEASE.noarch

# yum -y install pivotal-tc-server-standard vfabric-tc-server-standard
---> Package pivotal-tc-server-standard.noarch 0:3.2.1-RELEASE will be obsoleting
---> Package vfabric-tc-server-standard.noarch 0:2.9.7-RELEASE will be obsoleted
...
================================================================================
 Package                     Arch    Version           Repository          Size
================================================================================
Installing:
 pivotal-tc-server-standard  noarch  3.2.1-RELEASE     pivotal-app-suite   34 M
     replacing  vfabric-tc-server-standard.noarch 2.9.7-RELEASE
...
Running Transaction
  Installing : pivotal-tc-server-standard-3.2.1-RELEASE.noarch              1/2
  Erasing    : vfabric-tc-server-standard-2.9.7-RELEASE.noarch              2/2

Installed:
  pivotal-tc-server-standard.noarch 0:3.2.1-RELEASE

Replaced:
  vfabric-tc-server-standard.noarch 0:2.9.7-RELEASE

# rpm -qa | grep tc-server
pivotal-tc-server-standard-3.2.1-RELEASE.noarch

我试过了:

yum -y --setopt=obsoletes=0 install pivotal-tc-server-standard vfabric-tc-server-standard

yum -y install pivotal-tc-server-standard --exclude=vfabric-tc-server-standard

这似乎与正常安装没有什么不同。

我也试过:

# yum install pivotal-tc-server-standard --setopt=protected_packages=vfabric-tc-server-standard
---> Package pivotal-tc-server-standard.noarch 0:3.2.1-RELEASE will be obsoleting
---> Package vfabric-tc-server-standard.noarch 0:2.9.7-RELEASE will be obsoleted
Error: Trying to remove "vfabric-tc-server-standard", which is protected
linux yum redhat rhel6
  • 1 个回答
  • 2087 Views
Martin Hope
alexus
Asked: 2016-11-02 08:21:43 +0800 CST

httpd 作为上下文运行 unconfined_u:system_r:httpd_t:s0(SELinux 处于许可状态)

  • 0

我在开始时遇到问题httpd:

# service httpd status
httpd is stopped
# service httpd start
Starting httpd: [Tue Nov 01 12:02:53 2016] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
                                                           [FAILED]
# tail /var/log/httpd/error_log
[Tue Nov 01 12:59:57 2016] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Tue Nov 01 13:00:11 2016] [notice] SELinux policy enabled; httpd running as context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[Tue Nov 01 13:00:11 2016] [info] Init: Initialized OpenSSL library
[Tue Nov 01 13:00:49 2016] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Tue Nov 01 13:05:15 2016] [notice] SELinux policy enabled; httpd running as context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[Tue Nov 01 13:05:15 2016] [info] Init: Initialized OpenSSL library
[Tue Nov 01 14:38:56 2016] [notice] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Tue Nov 01 14:40:38 2016] [notice] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Tue Nov 01 14:59:55 2016] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Tue Nov 01 15:00:40 2016] [notice] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
# cat /var/log/httpd/error_log | grep -v 'SELinux policy enabled'
[Tue Nov 01 12:30:07 2016] [info] Init: Initialized OpenSSL library
[Tue Nov 01 12:30:52 2016] [info] Init: Initialized OpenSSL library
[Tue Nov 01 12:31:17 2016] [info] Init: Initialized OpenSSL library
[Tue Nov 01 12:31:35 2016] [info] Init: Initialized OpenSSL library
[Tue Nov 01 12:31:43 2016] [info] Init: Initialized OpenSSL library
[Tue Nov 01 12:32:10 2016] [info] Init: Initialized OpenSSL library
[Tue Nov 01 12:38:22 2016] [info] Init: Initialized OpenSSL library
[Tue Nov 01 13:00:11 2016] [info] Init: Initialized OpenSSL library
[Tue Nov 01 13:05:15 2016] [info] Init: Initialized OpenSSL library
# getenforce 
Permissive
# httpd -t
Syntax OK
# httpd -e debug -k start
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module authz_host_module
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module log_config_module
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module setenvif_module
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module mime_module
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module autoindex_module
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module negotiation_module
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module dir_module
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module alias_module
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module rewrite_module
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module proxy_module
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module proxy_http_module
[Tue Nov 01 12:32:10 2016] [debug] mod_so.c(246): loaded module ssl_module
# echo $?
1
# run_init service httpd start
Authenticating root.
Password: 
Starting httpd:                                            [FAILED]
# 

我的环境:

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.8 (Santiago)
# uname -a
Linux X 2.6.32-642.6.1.el6.x86_64 #1 SMP Thu Aug 25 12:42:19 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
# rpm -q httpd
httpd-2.2.15-54.el6_8.x86_64
#

请指教。

redhat httpd selinux rhel6
  • 1 个回答
  • 9717 Views
Martin Hope
embedded
Asked: 2016-09-21 03:52:54 +0800 CST

已挂载时将 NFS 挂载添加到 auto.direct

  • 0

我有一个生产服务器,它通过 fstab 安装了 NFS 共享。我们现在需要将其切换到 autofs 以减少一些启动依赖。

是否可以在不卸载文件系统的情况下删除 fstab 条目并添加 autofs 条目?

我猜想只要我访问文件系统,autofs 就会尝试在同一个挂载点挂载,但我不完全确定。

由于有一个应用程序服务器正在访问文件系统,因此在添加 autofs 条目之前不可能卸载共享。

linux nfs rhel6
  • 1 个回答
  • 187 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve