错误提示sudo: no tty present and no askpass program specified Sorry, try again.
php调用shell脚本的svnup.php文件内容:
<?
set_time_limit(0);
//$output = array();
$ret = 0;
exec("/usr/bin/sudo /data0/shell/svnvp.sh", $output, $ret);
echo "Result:{$ret}";
print_r($output);
?>
/data0/shell/svnvp.sh是更新的脚本,主要内容是svn up。
还需要修改sudo配置文件,直接键如visudo命令编辑配置文件:
1. 注释Defaults requiretty
Defaults requiretty修改为 #Defaults requiretty, 表示不需要控制终端。
否则会出现sudo: sorry, you must have a tty to run sudo
2. 增加行 Defaults visiblepw
否则会出现 sudo: no tty present and no askpass program specified
我发现sudo-1.6.9p17-5.el5是不支持这个参数的,sudo-1.7.2p1-10.el5支持。
3. 赋予www用户执行svn权限
如,增加行:www ALL=(ALL) NOPASSWD: /data0/shell/svnvp.sh
注:NOPASSWD可以使在命令执行时不需要交互输入www 用户的密码
www用户为nginx或apache的运行用户
4.重启nginx或apache,让用户重新获得权限。
错误提示sudo: no tty present and no askpass program specified Sorry, try again.的更多相关文章
- sudo: no tty present and no askpass program specified(转)
sudo: no tty present and no askpass program specified 2012-11-30 09:30 5040人阅读 评论(1) 收藏 举报 修改sudo配置文 ...
- How to fix 'sudo: no tty present and no askpass program'以及硬盘序列号的读写
在调用system命令读写硬盘序列号的过程中遇到问题,报错如下: sudo: no tty present and no askpass program 发现此问题是由于帐号并没有开启免密码导致的 . ...
- sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified | 学步园 https://www.xuebuyuan.com/2157339.html 通 ...
- Jenkins服务使用 宿主机的docker、docker-compose (Jenkins 执行sudo命令时出现“sudo: no tty present and no askpass program specified”,以及 docker-compose command not found解决办法)
若要转载本文,请务必声明出处:https://www.cnblogs.com/zhongyuanzhao000/p/11681474.html 原因: 本人最近正在尝试CI/CD,所以就使用了 Jen ...
- 开启Ubuntu php错误提示 ZT
开启Ubuntu php错误提示 在Ubuntu下,LAMP中PHP错误是不提示的,只会出现一个空白页.当然,这对于运行的生产环境来说是必须的.但有时候也需要查看生产环境上错误提示,那么只要通用下面简 ...
- php开启与关闭错误提示
windows系统开关php错误提示 如果不具备修改php.ini的权限,可以将如下代码加入php文件中: 代码如下 复制代码 ini_set("display_errors", ...
- Ubuntu 17.10 用 apt 搭建 lamp 环境、安装 phpmyadmin、redis 服务+扩展、mysql 扩展、开启错误提示、配置虚拟主机
2018-02-24 13:50:30 更新: 个人喜欢相对原生又不太麻烦,所以用 apt 构建环境.不过,最近使用到现在记得出现过了 3 次 apache 或 mysql 服务器无法启动或无法连接的 ...
- 解决Ubuntu的错误提示
如果你是一个Ubuntu用户,也许偶尔甚至经常,遇到这样一个错误提示“System Program problem detected”. Ubuntu有一个内建的实用程序叫做Apport, 当一个程序 ...
- 开启 PHP 错误提示配置步骤详解
PHP编码出错不提示,这对于开发来说,是很不方便的.下面讲解如何开启错误提示步骤: 1. 打开php.ini文件. 以我的ubuntu为例,这个文件在: /etc/php5/apache2 目录下. ...
随机推荐
- mysql启动和关闭外键约束的方法(FOREIGN_KEY_CHECKS)
在MySQL中删除一张表或一条数据的时候,出现 [Err] 1451 -Cannot delete or update a parent row: a foreign key constraint f ...
- randomAccess接口
http://www.blogjava.net/lzqdiy/archive/2007/04/22/112578.html
- jQuery中attr()、prop()、data()用法及区别
.attr(),此方法从jq1.0开始一直存在,官方文档写的作用是读/写DOM的attribute值,其实1.6之前有时候是attribute,有时候又是property..prop(),此方法jq1 ...
- python(28)获得网卡的IP地址
获得第几块网卡的ip地址: def get_ip_address(self,ifname): # ifname = 'eth0' s = socket.socket(socket.AF_INET, s ...
- 本地新建项目提交到github
1.在github上创建项目(可以添加README.md),创建后的地址为 https://github.com/xxx/xxx-demo.git 2.在eclipse上新建个quick-start的 ...
- ADXL3xx: 读取 ADXL3xx 加速度传感器
原文链接:https://www.arduino.cc/en/Tutorial/ADXL3xx ADXL3xx加速度传感器 本教程将为你展示如何读取Analog Devices的ADXL3xx系列加速 ...
- (转)C# 打印PDF文件使用第三方DLL
本文为转载,原文:http://www.cnblogs.com/Yesi/p/5066835.html DLL地址:https://freepdf.codeplex.com 下面是该解决方案的详细代码 ...
- 开源的运维机器人hubot原理
- delphi.指针.PChar
此文是delphi.指针.应用姊妹篇,想细化一下PChar应用,所以有了此文. 注意: 1:此文讲的是PChar与字符串相关操作,其它方法暂不多讲. 2:由于D分开Ansi/Unicode的两种完全不 ...
- setContentType、setCharacterEncoding、pageEncoding和contentType
request.setCharacterEncoding()是设置从request中取得的值或从数据库中取出的值 response.setContentType("text/html;cha ...