使用 putty gen 我生成了一个公钥和私钥,并将私钥放在(C:\Users\toto\.ssh
)上,但是当我尝试连接时,我遇到了(权限被拒绝)以下是命令执行后终端上的显示
Microsoft Windows [version 6.3.9600]
(c) 2013 Microsoft Corporation. Tous droits r‚serv‚s.
C:\Users\toto>ssh instance@ipaddr
instance@ipaddr: Permission denied (publickey).
C:\Users\toto>ssh -v instance@ipaddr
OpenSSH_for_Windows_8.9p1, LibreSSL 3.4.3
debug1: Connecting to ipaddr [ipaddr] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\toto/.ssh/id_rsa type -1
debug1: identity file C:\\Users\\toto/.ssh/id_rsa-cert type -1
debug1: identity file C:\\Users\\toto/.ssh/id_ecdsa type -1
debug1: identity file C:\\Users\\toto/.ssh/id_ecdsa-cert type -1
debug1: identity file C:\\Users\\toto/.ssh/id_ecdsa_sk type -1
debug1: identity file C:\\Users\\toto/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file C:\\Users\\toto/.ssh/id_ed25519 type -1
debug1: identity file C:\\Users\\toto/.ssh/id_ed25519-cert type -1
debug1: identity file C:\\Users\\toto/.ssh/id_ed25519_sk type -1
debug1: identity file C:\\Users\\toto/.ssh/id_ed25519_sk-cert type -1
debug1: identity file C:\\Users\\toto/.ssh/id_xmss type -1
debug1: identity file C:\\Users\\toto/.ssh/id_xmss-cert type -1
debug1: identity file C:\\Users\\toto/.ssh/id_dsa type -1
debug1: identity file C:\\Users\\toto/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubunt
u-3
debug1: compat_banner: match: OpenSSH_8.9p1 Ubuntu-3 pat OpenSSH* compat 0x04000
000
debug1: Authenticating to ipaddr as 'instance'
debug1: load_hostkeys: fopen C:\\Users\\toto/.ssh/known_hosts2: No such file or
directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file
or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file
or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: [email protected] MAC: <implicit
> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit
> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:rAcaUaTH9l7EIAtwkIhtCTWEHLji57CSdkKi
AS64cWU
debug1: load_hostkeys: fopen C:\\Users\\toto/.ssh/known_hosts2: No such file or
directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file
or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file
or directory
debug1: Host 'ipaddr' is known and matches the ED25519 host key.
debug1: Found key in C:\\Users\\toto/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: get_agent_identities: ssh_get_authentication_socket: No such file or dir
ectory
debug1: Will attempt key: C:\\Users\\toto/.ssh/id_rsa
debug1: Will attempt key: C:\\Users\\toto/.ssh/id_ecdsa
debug1: Will attempt key: C:\\Users\\toto/.ssh/id_ecdsa_sk
debug1: Will attempt key: C:\\Users\\toto/.ssh/id_ed25519
debug1: Will attempt key: C:\\Users\\toto/.ssh/id_ed25519_sk
debug1: Will attempt key: C:\\Users\\toto/.ssh/id_xmss
debug1: Will attempt key: C:\\Users\\toto/.ssh/id_dsa
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.
com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nis
tp384,ecdsa-sha2-nistp521,[email protected],webauthn-sk-ecdsa-s
[email protected]>
debug1: kex_input_ext_info: [email protected]=<0>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\toto/.ssh/id_rsa
debug1: Trying private key: C:\\Users\\toto/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\toto/.ssh/id_ecdsa_sk
debug1: Trying private key: C:\\Users\\toto/.ssh/id_ed25519
debug1: Trying private key: C:\\Users\\toto/.ssh/id_ed25519_sk
debug1: Trying private key: C:\\Users\\toto/.ssh/id_xmss
debug1: Trying private key: C:\\Users\\toto/.ssh/id_dsa
debug1: No more authentication methods to try.
instance@ipaddr: Permission denied (publickey).
C:\Users\toto>
我都是在文件中C:\Users\toto\.ssh
,key_private.ppk
我关闭了继承,然后我将继承的权限转换为该对象上的明确权限,然后我全部删除(包括管理员、用户、用户组),然后我添加我的用户,他没有完全控制并注册修改,但是当我执行命令时, ssh nameinstance@ipaddr
我始终被拒绝授权(公开)请注意,以下C:\Users\toto\.ssh
文件
key_private.ppk
known_hosts