Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经设置了 env.user 和 env.password,但是当我使用时:
run('ssh-copy-id -i $HOME/.ssh/id_rsa.pub server1')
它仍然要求我输入密码,为什么?
env.user并env.password用于 ssh 到远程服务器,然后在run ()远程服务器上运行命令。
env.user
env.password
run ()
它们不用于远程命令本身(在远程服务器中运行)。
所以ssh-copy-id对用户或密码一无所知。
ssh-copy-id
如果这不是您的意思,我建议您编辑问题并使事情更清楚,例如提供更多关于您要完成的任务的上下文:例如粘贴包含此“运行”的函数。