官方默认镜像有问题,需要调整ssh-config
1 调整运行Root 证书登录
PermitRootLogin yes
2 检测目录权限
权限问题:确保/.ssh目录和authorized_keys文件的权限设置正确。通常,/.ssh目录的权限应该是700(即只有所有者有读写执行权限),而authorized_keys文件的权限应该是600(即只有所有者有读写权限)。
3 证书登录开启
PubkeyAuthentication yes
4 登录成功配置
# $OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21 dtucker Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
# Include configuration snippets before processing this file to allow the
# snippets to override directives set in this file.
Include /etc/ssh/sshd_config.d/*.conf
#Port 22
#AddressFamily any
#ListenAddress 0.0.0

最低0.47元/天 解锁文章
995

被折叠的 条评论
为什么被折叠?



