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

推荐订阅源

S
Secure Thoughts
P
Privacy International News Feed
T
Tenable Blog
L
Lohrmann on Cybersecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threat Research - Cisco Blogs
S
Securelist
C
CXSECURITY Database RSS Feed - CXSecurity.com
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Cyberwarzone
Cyberwarzone
月光博客
月光博客
T
The Blog of Author Tim Ferriss
Scott Helme
Scott Helme
爱范儿
爱范儿
Stack Overflow Blog
Stack Overflow Blog
C
Cisco Blogs
aimingoo的专栏
aimingoo的专栏
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Proofpoint News Feed
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
T
Tor Project blog
Security Latest
Security Latest
Blog — PlanetScale
Blog — PlanetScale
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
博客园 - 三生石上(FineUI控件)
I
InfoQ
Spread Privacy
Spread Privacy
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
S
SegmentFault 最新的问题
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog
C
CERT Recently Published Vulnerability Notes
A
About on SuperTechFans
博客园_首页
Engineering at Meta
Engineering at Meta
Project Zero
Project Zero
Latest news
Latest news

CentOS

vscode 的 remote-ssh 还支持 centos7 吗? - V2EX CentOS Stream 10 正式 GA, RHEL 10 Beta 也上路了 CentOS 采用 stream 升级以后,真的会有人选择 Rocky 或者 Alma Linux 吗 使用迁移工具迁移 centos7 会有什么坑? - V2EX CentOS 将于 6 月 30 全面停服。 - V2EX Linux 小白求助 swap 占用问题 - V2EX 求助,如何在 Centos9 文本安装模式下对 root 分区进行 luks 加密? - V2EX 为什么 CENTOS crontab 的 PATH 不包含/usr/sbin? Centos7 资源没怎么占用,执行各种命令都很卡,求大佬帮忙解决下 - V2EX centos7 网络无法启动,无法理解缘由 - V2EX 改完 root 密码后 SSH 无法登录了 - V2EX [求助]centos 6.5 配置多个公网 ip - V2EX 如果 centos7 版本也停更了,替代方案还有哪些 - V2EX [实在是高] redha 直接消灭了免费的二进制兼容的 rhel 发行版 - V2EX Centos 7.9 firewall 报错 - V2EX Linux 字体不定期失效问题 - V2EX [求助] 系统中毒了,找到了进程和文件,无法杀死和删除 - V2EX centos 不维护后,还有哪些好的 server 端 os 可以替代 centos? - V2EX 请教 vps 内外网卡均显示内网 ip 地址问题, 如何修改 - V2EX Cockpit 自动登录二级服务器问题 - V2EX centos 如何做个端口映射? - V2EX centos 8 rc.local 不能正常工作 - V2EX CentOS 如何创建一个用户,只允许该用户(只读)访问特定文件夹下的文件,其他文件均对其不可见 - V2EX AlmaLinux 8.5 发布了 - V2EX CentOS 8 即将在本年年底停止维护,最近有各种各样的基于 CentOS 的二次发行版出现,大家如何看待。 - V2EX 有感于 CentOS 停止维护 - V2EX CentOS 装 smb 无法在 macOS 和 Windows 里的网络里显示? - V2EX centos 防火墙关闭后端口依旧无法访问 - V2EX centos swap 内存不被使用问题 - V2EX i7-10700 不支持 centos7.6 吗,安装直接黑屏 - V2EX 急! centos7 安装过程中卡住 - V2EX 请教一个 centos8 命令 brctl 问题 - V2EX CentOS 悄悄的走了? - V2EX Rocky Linux [CentOS 后续] - V2EX 更新到了 centos stream,然后 vnc 挂了 - V2EX RIP CentOS - V2EX CentOS 8, 21 年底 EOF,以后就变滚动更新了。 以后也没 CentOS 9 了 - V2EX centos7 系统 hp gen 系列服务器,两块 ssd 做了 raid1,如何远程查看硬盘是否损坏? - V2EX 一拨号默认路由就断了 这个怎么解决 - V2EX bt 的同步时间好像有问题了? - V2EX 求助一个关于 CentOS 8 防火墙 Firewalld 的问题 - V2EX CentOS 7.7 系统,数据库放数据盘有什么危害?数据库比较大,现在数据盘还剩 6G,更换麻烦 - V2EX www.hop5.in 这个源可靠么 - V2EX centos7 内核 3.10 升级到 5.72 无法识别网卡 - V2EX 因为弱口令服务器遭到 dota3 木马攻击,病毒脚本供大家研究 - V2EX 求教 nfs 服务器挂载报 Connection refused 的问题 - V2EX CentOS 8 为什么有这么大坑? - V2EX 多网段互联互通问题? - V2EX podman pod create 遇墙 - V2EX
求助: ssh 远程无法登陆提示: Permission denied, please try again - V2EX
qping · 2021-06-04 · via CentOS

使用密钥登陆是可以的,但是在别的机器上使用密码登陆就不行了。服务器系统版本是 Centos 7.8.2003.

尝试过以下的步骤:

  1. 当 ssh 上服务器后,su - root 输入密码是可以的,排除密码错误的问题
  2. /etc/ssh/sshd_config 里面的 # PermitRootLogin yes 的 # 去掉并重启 systemctl restart sshd,还是不行
  3. /etc/ssh/sshd_config 里面的 PasswordAuthentication 值原来就是 yes
  4. setenforce 0 也不行
  5. 尝试查看安全日志 :/var/log/secure 发现不管是登陆成功还是失败,在里面都没有生成新的日志
  6. 查看 /etc/hosts.allow 和 /etc/hosts.deny 里面都没有配置东西
  7. 查看登陆日志:执行 last 命令发现有个 roo 用户(我没有打错,就是少一个 t),是不是有可能被攻击了?
root     pts/1        170.3.69.2       Fri Jun  4 15:49   still logged in
root     pts/1        170.3.69.2       Fri Jun  4 15:47 - 15:49  (00:01)
root     pts/1        170.3.69.2       Fri Jun  4 15:46 - 15:47  (00:00)

...省略一些差不多的 ...

roo      pts/0        :0               Wed Mar 24 12:23 - 12:24  (00:01)
roo      pts/0        :0               Wed Mar 24 12:16 - 12:23  (00:07)
roo      :0           :0               Wed Mar 24 12:10 - down   (00:14)
reboot   system boot  3.10.0-1127.el7. Wed Mar 24 12:00 - 12:24  (00:24)

既然使用密钥可以登陆的话,那网络问题应该排除了。实在没有办法了,有没有大佬能帮忙鉴定下问题出现在哪里?

这个是使用密钥成功能登陆的日志( ssh -v -p 22 <ip 地址>):

OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /root/.ssh/config
debug1: /root/.ssh/config line 40: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 2
Last login: Fri Jun  4 15:59:42 2021

这个是在别的电脑上使用密码登陆失败的日志( ssh -v -p 22 <ip 地址>):

OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /root/.ssh/config
debug1: /root/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: auto-mux: Trying existing master
debug1: Control socket "/root/.ssh/<这里是 ip>-22-root" does not exist
debug1: Connecting to <这里是 ip> [<这里是 ip>] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/<这里是 key 名称>.key type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/<这里是 key 名称>.key-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to <这里是 ip>:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: [email protected] need=64 dh_need=64
debug1: kex: [email protected] need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:sQeFN1/GfQqAohAXEyndzeCStwG4wEcawUl3vZhwniw
debug1: Host '<这里是 ip>' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:23
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: KEYRING:persistent:0)

debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: KEYRING:persistent:0)

debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/<这里是 key 名称>.key
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: password
root@<这里是 ip>'s password:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
root@<这里是 ip>'s password:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
root@<这里是 ip>'s password:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)