Linux 从ssh登录中删除公钥

Linux 从ssh登录中删除公钥,linux,authentication,ssh,passwords,Linux,Authentication,Ssh,Passwords,我正在尝试通过ssh连接到我的嵌入式板。但是在尝试通过ssh-v-l root连接时user@xx.xx.xx.xx,我得到了一系列调试注释: dico@lithya:~$sudo ssh-v-l rootdico@foxboard2 OpenSSH_5.9p1 Debian-5ubuntu1,OpenSSL 1.0.1 2012年3月14日 debug1:读取配置数据/etc/ssh/ssh\u config debug1:/etc/ssh/ssh\u配置第22行:应用* debug1:连接到

我正在尝试通过ssh连接到我的嵌入式板。但是在尝试通过ssh-v-l root连接时user@xx.xx.xx.xx,我得到了一系列调试注释:

dico@lithya:~$sudo ssh-v-l rootdico@foxboard2

OpenSSH_5.9p1 Debian-5ubuntu1,OpenSSL 1.0.1 2012年3月14日

debug1:读取配置数据/etc/ssh/ssh\u config

debug1:/etc/ssh/ssh\u配置第22行:应用*

debug1:连接到foxboard2[10.251.145.180]端口22

debug1:已建立连接

debug1:永久\u设置\u uid:0/0

debug1:identity file/root/.ssh/id_rsa type-1

debug1:identity file/root/.ssh/id\u rsa-cert类型-1

debug1:标识文件/root/.ssh/id_dsa类型-1

debug1:identity file/root/.ssh/id_dsa-cert类型-1

debug1:identity file/root/.ssh/id_ecdsa type-1

debug1:identity file/root/.ssh/id_ecdsa-cert type-1

debug1:远程协议版本2.0,远程软件版本OpenSSH_5.5p1 Debian-6

debug1:匹配:OpenSSH_5.5p1 Debian-6 pat OpenSSH*

debug1:启用协议2.0的兼容模式

debug1:本地版本字符串SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1

debug1:SSH2\u MSG\u KEXINIT已发送

debug1:SSH2\u MSG\u KEXINIT已收到 debug1:kex:server->client aes128 ctr hmac-md5无

debug1:kex:客户端->服务器aes128 ctr hmac-md5无


debug1:SSH2\u MSG\u KEX\u DH\u GEX\u请求(1024您可以使用以下命令将公钥复制到服务器:

ssh-copy-id user@xx.xx.xx.xx

使用密钥总是比使用密码好。

确保您的
~/.ssh
目录设置为模式700(
chmod 700~/.ssh
),并且您的
~/.ssh/authorized_keys
设置为模式600(
chmod 600~/.ssh/authorized_keys


在您的
/etc/ssh/sshd_config
文件中设置
PasswordAuthentication no
以关闭密码登录。

谢谢您的回复。但是,我在更新中提到我删除了公钥验证。但现在我收到了密码请求。在任何情况下,我都无法连接到主板,甚至无法复制id。当我键入t时他
ssh拷贝iduser@xx.xx.xx.xx
,我得到:
/usr/bin/ssh copy id:ERROR:找不到任何身份信息
。如果您没有可用的密钥或密码,那么您的运气就太差了(但当我禁用公钥身份验证且从未设置密码时,为什么它会要求我这样做呢?有没有办法删除后者?请记住,PubkeyAuthentication=no位于客户端,而不是服务器端。主板是一台独立的计算机,因此您在没有实际登录的情况下无法更改任何配置。哦,我明白了。But这是什么错误:
/usr/bin/ssh copy id:error:No identifications found
?因为如果我无法向板发送任何内容,也无法连接,我几乎无法解决此问题吗?它正在尝试使用您的公钥对root的私钥进行身份验证,并且失败。要解决此问题,请将~/sh.id_rsa.pub文件需要附加到您尝试连接到的服务器上的/root/.ssh/authorized_密钥。执行此操作需要您已经有某种方式以root身份连接,或者可以让某人为您进行连接。