ubuntu – 为什么RSA SSH身份验证仅在控制台登录后才能运行?

我在我的一个ubuntu服务器上设置了RSA身份验证,但是每次重启后,我都无法通过ssh RSA登录.为了使用ssh登录,我需要先通过控制台登录,然后RSA开始工作.为什么???

下面是我的sshd配置文件以及控制台登录之前和之后ssh -vv命令的输出. .

在控制台登录之前:

debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /Users/smorhaim/.ssh/smorhaim (0x7ff8d8c242c0)
debug2: key: /Users/smorhaim/.ssh/id_rsaadmin (0x7ff8d8c24cf0)
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/smorhaim/.ssh/smorhaim
debug2: we sent a publickey packet,wait for reply
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /Users/smorhaim/.ssh/id_rsaadmin
debug2: we sent a publickey packet,wait for reply
debug1: Authentications that can continue: publickey
debug2: we did not send a packet,disable method
debug1: No more authentication methods to try.
Permission denied (publickey).

控制台登录后:

debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /Users/smorhaim/.ssh/smorhaim (0x7f91c14242c0)
debug2: key: /Users/smorhaim/.ssh/id_rsaadmin (0x7f91c1424ae0)
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/smorhaim/.ssh/smorhaim
debug2: we sent a publickey packet,wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp b1:d5:90:43:be:43:52:a9:7f:05:c7:04:86:57:b3:ff
debug1: Authentication succeeded (publickey).
Authenticated to 10.10.30.151 ([10.10.30.151]:22).

sshd配置:

Port 22
Protocol 2
ListenAddress 10.10.30.151

UsePrivilegeSeparation yes
SyslogFacility AUTHPRIV
PermitRootLogin no
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
我刚遇到同样的问题;原来我的主目录是加密的.有趣的是,我不记得选择它是加密的选项,它似乎只是在最近的升级后开始发生(ubuntu 10.04.4服务器)

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...