Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssh 如何打开TTY与git推钩交互?_Ssh_Githooks_Git Push_Post Commit - Fatal编程技术网

Ssh 如何打开TTY与git推钩交互?

Ssh 如何打开TTY与git推钩交互?,ssh,githooks,git-push,post-commit,Ssh,Githooks,Git Push,Post Commit,我使用git deploy Ruby gem将应用程序交付给临时服务器。部署是使用SSH密钥执行的 在我的after_push脚本中,我想用sudo运行一个命令,该命令随后会询问我的密码,因为sudo权限有限(没有密码不能运行sudo) 实际上,我的sudo命令在以下情况下失败: sudo: no tty present and no askpass program specified 我尝试添加一个askpass程序,并根据git手册指定它 在推送脚本之后,如何在我的中的git push过程

我使用git deploy Ruby gem将应用程序交付给临时服务器。部署是使用SSH密钥执行的

在我的
after_push
脚本中,我想用
sudo
运行一个命令,该命令随后会询问我的密码,因为sudo权限有限(没有密码不能运行sudo)

实际上,我的sudo命令在以下情况下失败:

sudo: no tty present and no askpass program specified
我尝试添加一个askpass程序,并根据git手册指定它


在推送脚本之后,如何在我的
中的
git push
过程中打开TTY以执行交互式命令?

到目前为止,我所寻求的似乎是不可能的。没有tty可用,这是我从阅读和

对于如何在post receive中执行受密码保护的sudo操作,有什么更好的建议吗

更新:答案在


不可能实现我在这里尝试实现的目标。

我想在服务器上执行一些设置,类似于我可以使用Capistrano进行的设置,但我没有找到实现这一点的方法。