gpt4 book ai didi

linux - 无法设置无密码登录到 localhost 以及使用密码 ssh 到 localhost

转载 作者:太空宇宙 更新时间:2023-11-04 06:05:46 27 4
gpt4 key购买 nike

尝试通过 SSH 连接到本地主机时的调试信息

ssh root@localhost -vvv 输出

OpenSSH_6.6.1、OpenSSL 1.0.1f 2014 年 1 月 6 日debug1:读取配置数据/etc/ssh/ssh_configdebug1:/etc/ssh/ssh_config 第 19 行:应用 * 的选项调试2:ssh_connect:needpriv 0debug1:连接到本地主机 [127.0.0.1] 端口 22。debug1:连接到地址 127.0.0.1 端口 22:连接被拒绝ssh:连接到主机本地主机端口 22:连接被拒绝

最佳答案

忽略无密码登录的影响,

连接被拒绝表明 sshd 未启动。检查 sshd 是否正在运行。

$ netstat -an|fgrep LIST|fgrep :22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN

如果没有:

$ sudo systemctl status sshd
$ sudo systemctl enable sshd
$ sudo systemctl start sshd

关于linux - 无法设置无密码登录到 localhost 以及使用密码 ssh 到 localhost,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28597367/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com