当提示输入 Ubuntu 盒子的 SUDO 密码时,Capistrano 挂起
我有一个 capistrano 部署配方,我已经使用了一段时间来部署我的 Web 应用程序,然后使用 sudo 命令重新启动 apache/nginx。 最近,当我尝试执行这些 sudo 命令时,cap 部署挂起。 我看到输出: “[sudo] 的密码” 使用我的服务器名称和远程登录,但这不是安全登录提示。 cap shell 只是挂起等待更多输出,并且不允许我输入密码来完成远程 sudo 命令。
有没有办法解决这个问题或解决这个问题? 我不想删除远程用户的 Web 重新启动命令的 sudo 密码提示。
I have a capistrano deployment recipe I've been using for some time to deploy my web app and then restart apache/nginx using the sudo command. Recently cap deploy is hanging when I try to execute these sudo commands. I see the output:
"[sudo] password for "
With my server name and the remote login, but this is not a secure login prompt. The cap shell is just hanging waiting for more output and does not allow me to type my password in to complete the remote sudo command.
Is there a way to fix this or a decent work around? I did not want to remove the sudo password prompt of my remote user for web restart commands.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
连接到 CentOS 机器时似乎也会发生这种情况。 在您的 capistrano 部署文件中添加以下行:
另外,请确保使用
sudo
帮助程序,而不是直接在运行命令中执行sudo
。 例如:This seems to happen when connecting to CentOS machines as well. Add the following line in your capistrano deploy file:
Also make sure to use the
sudo
helper instead of executingsudo
in your run commands directly. For example:其他建议可能是合理的,但我发现一旦更新到 Capistrano 2.5.3 问题就消失了。 我必须确保停止运行操作系统附带的默认版本的工具。
The other advice may be sound, but I found that once I updated to Capistrano 2.5.3 the problem went away. I have to make sure I stop running the default versions of tools that came with my O/S.