情况是这样的:我家里有一台机器(我们称之为家用机器),办公室里有另一台机器(称之为家用机器)。im使用ssh和dsa密钥身份验证,而不使用密码身份验证从office计算机访问home_machine。我已经在home_machine上设置了一个ssh服务器,并将office_machine上生成的公钥添加到home_machine上的authorized_keys文件中。这工作得很好-我可以从office计算机ssh到home计算机,只需使用密钥而不使用密码。
现在的问题是:当我访问其他办公室时,我希望能够使用属于office_machine的公钥访问home_machine。ie我想把公钥(id_dsa.pub)放在一个usb驱动器上,然后复制到另一个办公室的.ssh目录。从我在这个网站上看到的情况来看,其他人似乎能够做到这一点,但这并不管用。当我试着把id_dsa.pub放在一台新机器上
ssh -v user@home_machine
调试消息以以下内容结尾:
debug1: Offering public key: .ssh/id_dsa
debug1: Server accepts key: pkalg ssh-dss blen 433
debug1: read PEM private key done: type DSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
我的临时解决方案是在home_machine上的sshd_配置中设置“PasswordAuthentication yes”,然后使用密码进入home_machine。但是,这会使使用密钥授权的点无效。