0

我已经通过 ssh 设置了无密码登录到 localhost,它可以工作并且不需要我输入任何密码。

justinwu@ubuntu:~$ ssh root@localhost
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-110-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

2 packages can be updated.
0 updates are security updates.

New release '16.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Last login: Tue Mar  7 10:08:22 2017 from localhost

但是在运行一个脚本并且它需要通过 ssh 以 root 身份登录时,它会返回错误“权限被拒绝(公钥)”。

...
  Launching 20 processes.
    Starting test client: 0 Host:  localhost    Workload:      VDI  Workdir: /mnt/share
Permission denied (publickey).

我不知道为什么脚本在不输入密码的情况下无法通过 root 自动登录。

请帮忙!谢谢!

4

0 回答 0