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
    • 最新
    • 标签
主页 / user-950211

Sebastian's questions

Martin Hope
Sebastian
Asked: 2024-07-25 06:50:12 +0800 CST

尽管配置正确,ssh root@host 仍无法工作 - 缺少什么?

  • 5

我需要暂时在 Fedora 40 工作站上使用密钥启用 root SSH。SSH 客户端日志确认已发送并接受了正确的密钥(复制如下)。sshd调试日志(也在下面)显示相同内容,但不知何故ROOT LOGIN REFUSED FROM ...仍在发生。

我做过的事情:

  • 在/etc/ssh/sshd_config: PermitRootLogin yes+AllowUsers root ...
  • DenyUsers|DenyGroups在同一个文件中没有设置。
  • root 用户未被锁定sudo passwd -S root,并且也拥有有效的 shell。
  • 暂时设置sudo setenforce 0为排除 SELinux。
  • ls -l /root/.ssh/authorized_keys(和父目录)确认正确的权限(600,700)-(StrictModes no无论如何,以防万一使用)
  • /etc/security/access.conf显示对 root 没有限制(所有行均已注释)
  • 没有添加自定义配置cat /etc/pam.d/

客户端日志:

ssh -v -t -o IdentitiesOnly=yes -o PreferredAuthentications=publickey [email protected]
...
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Will attempt key: /Users/.../.ssh/id_ed25519 ED25519 SHA256:4ZMC... explicit agent
debug1: Offering public key: /Users/.../.ssh/id_ed25519 ED25519...
debug1: Server accepts key: /Users/.../.ssh/id_ed25519 ED25519...
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

服务器日志:

Jul 25 08:37:05 n1 sshd[110058]: debug1: PAM: initializing for "root"
Jul 25 08:37:05 n1 sshd[110058]: debug1: PAM: setting PAM_RHOST to "192.168.1.23"
Jul 25 08:37:05 n1 sshd[110058]: debug1: PAM: setting PAM_TTY to "ssh"
Jul 25 08:37:05 n1 sshd[110058]: debug1: userauth-request for user root service ssh-connection method publickey [preauth]
Jul 25 08:37:05 n1 sshd[110058]: debug1: attempt 1 failures 0 [preauth]
Jul 25 08:37:05 n1 sshd[110058]: debug1: userauth_pubkey: publickey test pkalg ssh-ed25519 pkblob ED25519 SHA256:4ZMC4... [preauth]
Jul 25 08:37:05 n1 sshd[110058]: debug1: temporarily_use_uid: 0/0 (e=0/0)
Jul 25 08:37:05 n1 sshd[110058]: debug1: trying public key file /root/.ssh/authorized_keys
Jul 25 08:37:05 n1 sshd[110058]: debug1: fd 5 clearing O_NONBLOCK
Jul 25 08:37:05 n1 sshd[110058]: debug1: /root/.ssh/authorized_keys:1: matching key found: ED25519 SHA256:4ZMC4....
Jul 25 08:37:05 n1 sshd[110058]: debug1: /root/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
Jul 25 08:37:05 n1 sshd[110058]: Accepted key ED25519 SHA256:4ZMC4.... found at /root/.ssh/authorized_keys:1
Jul 25 08:37:05 n1 sshd[110058]: debug1: restore_uid: 0/0
Jul 25 08:37:05 n1 sshd[110058]: Postponed publickey for root from 192.168.1.23 port 50995 ssh2 [preauth]
Jul 25 08:37:05 n1 sshd[110058]: debug1: userauth-request for user root service ssh-connection method [email protected] [preauth]
Jul 25 08:37:05 n1 sshd[110058]: debug1: attempt 2 failures 0 [preauth]
Jul 25 08:37:05 n1 sshd[110058]: debug1: temporarily_use_uid: 0/0 (e=0/0)
Jul 25 08:37:05 n1 sshd[110058]: debug1: trying public key file /root/.ssh/authorized_keys
Jul 25 08:37:05 n1 sshd[110058]: debug1: fd 5 clearing O_NONBLOCK
Jul 25 08:37:05 n1 sshd[110058]: debug1: /root/.ssh/authorized_keys:1: matching key found: ED25519 SHA256:4ZMC4j....
Jul 25 08:37:05 n1 sshd[110058]: debug1: /root/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
Jul 25 08:37:05 n1 sshd[110058]: Accepted key ED25519 SHA256:4ZMC4jv... found at /root/.ssh/authorized_keys:1
Jul 25 08:37:05 n1 sshd[110058]: debug1: restore_uid: 0/0
Jul 25 08:37:05 n1 sshd[110058]: debug1: auth_activate_options: setting new authentication options
Jul 25 08:37:05 n1 sshd[110058]: ROOT LOGIN REFUSED FROM 192.168.1.23 port 50995
Jul 25 08:37:05 n1 sshd[110058]: Failed publickey for root from 192.168.1.23 port 50995 ssh2: ED25519 SHA256:4ZMC4jv....
Jul 25 08:37:05 n1 sshd[110058]: debug1: auth_activate_options: setting new authentication options [preauth]
Jul 25 08:37:05 n1 sshd[110058]: ROOT LOGIN REFUSED FROM 192.168.1.23 port 50995 [preauth]
Jul 25 08:37:05 n1 sshd[110058]: Connection closed by authenticating user root 192.168.1.23 port 50995 [preauth]

还:

cat /etc/securetty                                                                                                                                                    
ssh
pts/0
pts/1
pts/2
pts/3
ssh
  • 1 个回答
  • 57 Views
Martin Hope
Sebastian
Asked: 2024-02-22 15:24:19 +0800 CST

服务器通过 WiFi 接口回复 ping 很慢,但发送流量时则不然

  • 5

服务器是 amd64 上的 Fedora。它有一个 eth 接口和一个 wifi 接口,5GHz。

从同一 LAN 中的计算机,当我 ping 服务器时,我看到:

  1. Ping 192.168.2.20(eth) 给出 <1 毫秒
  2. Ping 192.168.2.21(wifi,同一服务器)给出 80-200 毫秒

...这表明路由器/Wifi 设置有问题。

但是,从服务器:

  1. ping -I wlp1s0 google.com给出~6ms
  2. ping -I enp2s0 google.com给出~3ms

...这表明 3 毫秒的惩罚(似乎合理),但使先前的假设无效。此外,从两台机器(WiFi 接口)对路由器执行 ping 操作的时间约为 3 毫秒。

通过 WiFi 接口与服务器的 SSH 连接会出现延迟,但使用 Eth 连接的情况则不会。尽管服务器可以使用相同的 WiFi 接口以合理的延迟(出口流量)与互联网通信,但 WiFi 接口上的传入流量受到某些干扰

为了了解问题,我应该执行哪些命令或调查领域?

router
  • 1 个回答
  • 23 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