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 / 问题

问题[centos8](server)

Martin Hope
BJaz
Asked: 2022-10-20 00:42:50 +0800 CST

Varnish 7.2 CLI 远程登录日志

  • 5

我升级到 varnish 7.2,现在它将 varnishd 的日志转储到 Centos 8 上的 /var/log/messages 中,并且无法弄清楚如何更改其日志的位置!任何线索将不胜感激。

以下是日志示例: varnishd[2327]: CLI telnet ::1 54416 ::1 38535 Wr 200 Backend name ****

varnish centos8
  • 1 个回答
  • 22 Views
Martin Hope
George Y
Asked: 2022-04-12 06:12:16 +0800 CST

ntpdate 在 CentOS8 上不可用

  • 2

我想像往常一样在 CentOS8 上安装 ntpdate。但是,它不可用:

# cat /proc/version
Linux version 4.18.0-240.1.1.el8_3.x86_64 ([email protected]) (gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)) #1 SMP Thu Nov 19 17:20:08 UTC 2020

# yum install -y ntpdate
Last metadata expiration check: 2:21:14 ago on Mon 11 Apr 2022 07:39:43 PM CST.
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
No match for argument: ntpdate
Error: Unable to find a match: ntpdate

此外,我也发现links lynx不可用。有什么方法可以在 CenOS 8 上安装 ntpdate 吗?

yum ntpdate centos8
  • 1 个回答
  • 2181 Views
Martin Hope
Rashiq
Asked: 2022-02-26 08:36:36 +0800 CST

无法在存在 selinux 的 Almalinux/CentOS 8 上更改 SSH 端口

  • 0

我正在尝试使用 Almalinux 更改 VPS 上的 SSH 端口。我遵循了本指南,但未能做到。

这些是我尝试分别使用 22 和新端口进行 SSH 时收到的输出。

ssh: connect to host XXX.XXX.XXX.XXX port 22: Connection timed out
ssh: connect to host XXX.XXX.XXX.XXX port 23498: Connection timed out

这是我的/etc/ssh/sshd_config.

...
Port 23498 22
...

运行semanage port -l | grep ssh给出以下输出。

ssh_port_t                     tcp      23498, 22

使用新端口重新开始使用service sshd restart会产生以下输出。

Redirecting to /bin/systemctl restart sshd.service
Job for sshd.service failed because the control process exited with error code.
See "systemctl status sshd.service" and "journalctl -xe" for details.

这是 的输出systemctl status sshd.service。

● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2022-02-25 17:26:08 CET; 34s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 25872 ExecStart=/usr/sbin/sshd -D $OPTIONS $CRYPTO_POLICY (code=exited, status=255)
 Main PID: 25872 (code=exited, status=255)

Feb 25 17:26:08 xxx.xxx.xxx systemd[1]: sshd.service: Main process exited, code=exited, status=255/n/a
Feb 25 17:26:08 xxx.xxx.xxx systemd[1]: sshd.service: Failed with result 'exit-code'.
Feb 25 17:26:08 xxx.xxx.xxx systemd[1]: Failed to start OpenSSH server daemon.

更改端口也会导致正常的 SSH 中断。注释掉Port并sshd_config重新启动sshd允许再次通过 SSH 访问。我也尝试过openssh-server更改端口后重新安装,但无济于事。允许端口通过简单的防火墙。非常感谢任何帮助。

linux centos ssh centos8 selinux
  • 1 个回答
  • 477 Views
Martin Hope
Kalvin Klien
Asked: 2022-02-16 11:26:26 +0800 CST

CentOS 9 Stream - 执行 yum 更新时出错

  • 1

我是从使用 Ubuntu 进来的。

刚刚在我的 DEV 服务器上安装了 CentOS,并且在进行更新或安装新软件包时立即遇到问题。

这是错误:

sudo yum update

Last metadata expiration check: 0:41:22 ago on Tue 15 Feb 2022 10:38:21 AM.
Error:

 Problem 1: problem with installed package libidn2-2.3.0-7.el9.x86_64
  - cannot install the best update candidate for package libidn2-2.3.0-7.el9.x86_64
  - nothing provides libunistring.so.0()(64bit) needed by libidn2-2.3.2-1.el7.x86_64

 Problem 2: cannot install the best update candidate for package python3-tracer-0.7.5-4.el9.noarch
  - problem with installed package python3-tracer-0.7.5-4.el9.noarch
  - package python3-tracer-0.7.5-4.el9.noarch requires tracer-common = 0.7.5-4.el9, but none of the providers can be installed
  - cannot install the best update candidate for package tracer-common-0.7.5-4.el9.noarch
  - cannot install both tracer-common-0.7.8-1.el7.noarch and tracer-common-0.7.5-4.el9.noarch

以下是启用的存储库:

yum repolist enabled
repo id       repo name
appstream     CentOS Stream 9 - AppStream
baseos        CentOS Stream 9 - BaseOS
epel          Extra Packages for Enterprise Linux 7 - x86_64
extras-common CentOS Stream 9 - Extras packages
remi-safe     Safe Remi's RPM repository for Enterprise Linux 7 - x86_6

我试图:

sudo yum update --best --allowerasing

但它仍然在抱怨:

Problem 1: problem with installed package libidn2-2.3.0-7.el9.x86_64
  - cannot install the best update candidate for package libidn2-2.3.0-7.el9.x86_64
  - nothing provides libunistring.so.0()(64bit) needed by libidn2-2.3.2-1.el7.x86_64
 Problem 2: cannot install the best update candidate for package python3-tracer-0.7.5-4.el9.noarch
  - problem with installed package python3-tracer-0.7.5-4.el9.noarch
  - package python3-tracer-0.7.5-4.el9.noarch requires tracer-common = 0.7.5-4.el9, but none of the providers can be installed
  - cannot install the best update candidate for package tracer-common-0.7.5-4.el9.noarch
  - cannot install both tracer-common-0.7.8-1.el7.noarch and tracer-common-0.7.5-4.el9.noarch
(try to add '--skip-broken' to skip uninstallable packages)

任何想法如何解决这一问题?

更新:

试过了

yum clean all
yum check
yum check-update
yum update

yum update --nobest

结果相同:

Last metadata expiration check: 0:49:35 ago on Tue 15 Feb 2022 11:30:57 AM.
Dependencies resolved.

 Problem 1: cannot install the best update candidate for package libidn2-2.3.0-7.el9.x86_64
  - nothing provides libunistring.so.0()(64bit) needed by libidn2-2.3.2-1.el7.x86_64
 Problem 2: package python3-tracer-0.7.5-4.el9.noarch requires tracer-common = 0.7.5-4.el9, but none of the providers can be installed
  - cannot install both tracer-common-0.7.8-1.el7.noarch and tracer-common-0.7.5-4.el9.noarch
  - cannot install the best update candidate for package tracer-common-0.7.5-4.el9.noarch
  - cannot install the best update candidate for package python3-tracer-0.7.5-4.el9.noarch
==================================================================================================================================================
 Package                                Architecture                    Version                               Repository                     Size
==================================================================================================================================================
Skipping packages with conflicts:
(add '--best --allowerasing' to command line to force their upgrade):
 tracer-common                          noarch                          0.7.8-1.el7                           epel                           31 k
Skipping packages with broken dependencies:
 libidn2                                x86_64                          2.3.2-1.el7                           epel                          148 k
centos yum centos8
  • 3 个回答
  • 1549 Views
Martin Hope
gen_Eric
Asked: 2022-01-14 09:22:01 +0800 CST

允许 samba 共享访问挂载的远程文件存储

  • 0

我在同一个网络上有两台服务器。一个运行 Windows Server 2016,另一个运行 CentOS 8。Windows 服务器是我的主要文件存储,它是我所有数据的所在。CentOS 服务器安装了 Windows 共享并且可以访问其文件。

在 CentOS 上,我设置了一个 samba 共享。为什么?因为我有一个 webapp 在同一台服务器上运行,我希望 webapp 控制谁可以访问什么文件。因此,与其让我们的(内部)用户直接安装 Windows 共享,他们将安装 CentOS 共享,这将是对文件的“看门人”访问。

在 samba 文件夹中,每个用户都有一个文件夹和一个配置,以允许用户仅访问他们的文件夹。webapp 被配置为将符号链接添加到链接到“真实”文件的这些文件夹中。

这就是问题所在。如果我将“普通”文件添加到用户的文件夹中,他们就可以正常访问它。但是,如果我添加一个符号链接(到已安装的 Windows 共享中的文件),它就不会出现在他们面前。我很确定这是一个 SELinux 问题。

这是设置的方式。

  • Windows 共享已挂载

    sudo mount -t cifs //WindowsShare/data /media/WinShare \ 
      -o ip=192.168.1.5,username=user,gid=sambashare
    
    ls -alhZ /media/WinShare
    drwxr-xr-x. 2 root sambashare system_u:object_r:cifs_t:s0  0 Jan 10 16:57 files
    
  • 创建并使用一个 samba 共享/srv/smb(所有 samba 用户都在sambashare组中)

    ls -alhZ /srv
    drwxrwx---.  2 root sambashare unconfined_u:object_r:samba_share_t:s0    6 Jan 13 11:20 smb
    
  • 具有以下/etc/samba/smb.conf内容:

    [global]
        allow insecure wide links = yes
        unix extensions = no
    
    [adminShare]
        path = /srv/smb
        wide links = yes
        follow symlinks = yes
    
  • 作为测试,我添加了一个符号链接和一个文件

    ln -s /media/WinShare/files/test.pdf /srv/smb/test.pdf
    touch /srv/smb/file.bin
    

然后我尝试安装\\CentOS\adminShare在 Windows VM 中,但我没有看到该test.pdf文件,但我看到了file.bin.

如何让 CentOS samba 共享访问已安装的 Windows Server 数据?在设置 CentOS 服务器时,我运行:

sudo semanage fcontext -a -t samba_share_t "/srv/smb(/.*)?"

这是让我看到file.bin的,但我还是看不到file.pdf。我找到了这个,但我不知道是否要更改所有内容:

sudo setsebool -P samba_export_all_rw=1

如何允许 samba 访问该/media/WinShare文件夹?这行得通吗?

sudo semanage fcontext -a -t samba_share_t "/media/WinShare(/.*)?"
centos samba centos8 selinux
  • 1 个回答
  • 207 Views
Martin Hope
Lesha Pipiev
Asked: 2021-12-09 13:26:04 +0800 CST

从 CentOS 8.5 中全新安装 CentOS 8.4

  • 0

我安装了CentOS 8.4 4.18.0-305.3.1。
一切都很好,直到我跑yum -y update了却不明白这意味着什么。
之后 CentOS 升级到8.5 4.18.0-348.2.1版本,这不适合我的目的。

我尝试天真地尝试将操作系统版本恢复到 8.4 4.18.0-305.3.1:

yum history undo. 
switching to kernel version 4.18.0-305.3.1. 
yum downgrade redhat-release  

但没有任何帮助。

是否可以使用我需要的操作系统版本安装到现有机器 ISO,从该 ISO 启动并在现有操作系统 8.5 上安装 CentOS 8.4 4.18.0-305.3.1?

centos installation centos8
  • 1 个回答
  • 469 Views
Martin Hope
Boppity Bop
Asked: 2021-11-27 07:21:17 +0800 CST

你如何在 CentOS8 上分析 DNS 响应时间?

  • 0

我想知道 DNS 响应解析地址需要多长时间 - 这样我就可以比较不同的服务器(我的机器(我使用named)、GCP DNS、其他公共 DNS 服务器)。

问题是我的应用程序需要解析 IP 刚刚在 CDN 中更改的 URL(例如 Cloud Flare)。我需要这个决心尽可能快。

因此,我想收集有关不同 DNS 服务器将 URL 解析为新 IP 的速度的统计数据。

domain-name-system centos8
  • 1 个回答
  • 49 Views
Martin Hope
Boppity Bop
Asked: 2021-11-26 10:26:46 +0800 CST

为什么在 permissive 模式下会出现 SELinux 错误?

  • 0

我已将 SELinux 设置为 CentOS 8 Stream,permissive但日志中仍有一堆红线,例如:

SELinux is preventing /usr/lib/systemd/systemd from name_connect access on the tcp_socket port 80

这些是真实的还是只是打印出来的——如果它处于restrictive模式会发生什么?

centos8 selinux
  • 1 个回答
  • 187 Views
Martin Hope
Lesha Pipiev
Asked: 2021-11-26 05:10:14 +0800 CST

/bin/false 用户下无法运行命令

  • 0

森托斯 8.

有snowuser:

[snowuser@snowcannon-01 ~]$ cat /etc/passwd | grep snowuser  
snowuser:x:1002:1002::/home/snowuser:/bin/bash   
[snowuser@snowcannon-01 ~]$ groups  
snowuser wheel

有tomcat用户:

[snowuser@snowcannon-01 ~]$ cat /etc/passwd | grep tomcat  
tomcat:x:1003:1003::/opt/tomcat:/bin/false  


cat /etc/group | grep "tomcat\|snowuser"  
wheel:x:10:ydyachuk,amsliusar,snowuser  
snowuser:x:1002:   
tomcat:x:1003:   

尝试在tomcat用户下运行 Tomcat 的启动脚本:

/bin/su tomcat -c /opt/tomcat/bin/startup.sh

但是没有任何意义,既没有出现任何错误消息,也没有执行Tomcat进程。

我只有一个细节是该命令正在执行时出现错误:

[snowuser@snowcannon-01 ~]$ echo $?
1

似乎tomcat用户对脚本执行具有适当的权限:

[snowuser@snowcannon-01 ~]$ ll /opt/tomcat/bin/startup.sh 
-rwxr-xr-x. 1 tomcat tomcat 1904 Nov 11 15:14 /opt/tomcat/bin/startup.sh

如何让 Tomcat 运行?

tomcat centos su centos8
  • 1 个回答
  • 188 Views
Martin Hope
H. Far
Asked: 2021-11-24 23:52:00 +0800 CST

如何在有状态模式下使用firewalld

  • 0

我必须使用 firewalld 在 centos8 上设置状态防火墙。我是firewalld的新手,但有为此目的使用旧式iptables的经验。因为这里
是 Redhat 推荐的,所以我不喜欢结合使用 firewalld 和 iptables 两种方法。 我想知道有没有办法在有状态模式下使用firewalld?如果是怎么回事?

谢谢你

firewall centos centos8 firewalld
  • 1 个回答
  • 217 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