权限被拒绝(公钥)

权限被拒绝(公钥)

我正在尝试使用公钥加密从 Linux ssh 到 Windows。我在 Windows 机器上运行 freeSSHd 服务器。即使使用密码验证,我也无法登录。以下是我的错误。有人能解释一下为什么会发生这种情况吗?

$ ssh -v [email protected]
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to xx.xx.xx.xx [xx.xx.xx.xx] port 22.
debug1: Connection established.
debug1: identity file /home/myaccunt/.ssh/identity type -1
debug1: identity file /home/myaccunt/.ssh/id_rsa type 1
debug1: identity file /home/myaccunt/.ssh/id_dsa type -1
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version WeOnlyDo 2.1.3
debug1: no match: WeOnlyDo 2.1.3
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host 'xx.xx.xx.xx' is known and matches the RSA host key.
debug1: Found key in /home/myaccunt/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/myaccunt/.ssh/identity
debug1: Offering public key: /home/myaccunt/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/myaccunt/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).

答案1

检查 Windows 机器

  1. 检查 shell 的权限(默认,但检查/etc/passwd文件)

    ls -ltr /bin/bash
    chmod 755 /bin/bash
    
  2. 在一个终端中运行 sshd 服务(检查已完成哪个 ID 安装设置)

    /usr/sbin/sshd -d
    
  3. 在另一个终端中运行 sftp/ssh 命令

    sftp -vvv  userid@host
    ssh  -vvv  userid@host
    

相关内容