在 Hudson,我创建了一个作业,尝试在 Ubuntu Hudson Slave 中执行此命令行:
sudo mount -t cifs //path/to/network/directory /path/to/local/directory -o username=<Account>,password=<AccountPassword>,domain=<DomaineName>
但我得到这个错误:
sudo: no tty present and no askpass program specified
然后,我尝试在 Hudson 作业中执行此命令行:
mount -t cifs //path/to/network/directory /path/to/local/directory -o username=<Account>,password=<AccountPassword>,domain=<DomaineName>
然后,我收到此错误:
mount: only root can do that
然后我尝试了这个命令行(我尝试过是因为这个命令在 putty 中工作):
ssh "sudo mount -t cifs //path/to/network/directory /path/to/local/directory -o username=<Account>,password=<AccountPassword>,domain=<DomaineName>"
但我因这个错误而失败:
ssh: Could not resolve hostname ,domain=<DomaineName>: Name or service not known
阅读此内容后,我尝试通过在 Ubuntu 终端中执行此命令行来解决先前的错误:
sudo chmod a+s /sbin/mount.cifs
但这并没有解决我的问题。
这也不起作用:
mount.cifs //path/to/network/directory /path/to/local/directory -o username=<Account>,password=<AccountPassword>,domain=<DomaineName>
我是否应该在 Hudson 作业中以 root 身份进行身份验证(密码应自动设置)?或者我应该给 Hudson 用户 root 权限?
我该如何解决这个问题?
十分感谢!