删除 ~/.ssh 文件夹后如何 SSH

删除 ~/.ssh 文件夹后如何 SSH

我被提示输入密码,而不是使用 SSH 密钥进行身份验证。我以为如果我删除 ~/.ssh 中的所有内容,我就可以从笔记本电脑生成新密钥,手动复制公钥,并使用我的 SFTP 客户端(Transmit)将其添加到服务器上的 authorized_keys 中。不幸的是,这行不通。我可以在 ~/.ssh 中读写,但无法通过 SFTP 客户端编辑 /etc/ssh/sshd_config 来启用 PasswordAuthentication。我尝试将服务器(名为“ubuntu”)连接到显示器,输出以下内容:

Ubuntu 23.04 ubuntu ttyl ubuntu 登录:

我尝试过的所有方法都输出错误。这可以修复吗?任何建议都将不胜感激。

链接到:/var/log/auth.log https://drive.google.com/file/d/14adetEqSXUmM9-eh5ZSrvQvgP6n3ESYA

以下是 ssh -vvv -i id_rsa 的输出[电子邮件保护] https://drive.google.com/file/d/1Ue1RS0_5JQl6_lnE65mpuscqxWfej16e

chrishall in ~/.ssh via ⬢ v19.8.1
➜ ssh -o "IdentitiesOnly=yes" -i id_ed25519 [email protected]
[email protected]: Permission denied (publickey).

chrishall in ~/.ssh via ⬢ v19.8.1
➜ ssh -o "IdentitiesOnly=yes" -i id_rsa [email protected]
[email protected]: Permission denied (publickey).

chrishall in ~/.ssh via ⬢ v19.8.1
➜ ssh -v id_ed25519 [email protected]
OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to id_ed25519 port 22.
ssh: Could not resolve hostname id_ed25519: nodename nor servname provided, or not known

chrishall in ~/.ssh via ⬢ v19.8.1
➜ ssh -v id_rsa [email protected]
OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include 
/etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to id_rsa port 22.
ssh: Could not resolve hostname id_rsa: nodename nor servname provided, or not known

相关内容