一、Oozie java程序执行shell命令行无法执行sudo命令?

cmd error: 
cmd error: We trust you have received the usual lecture from the local System
cmd error: Administrator. It usually boils down to these three things:
cmd error: 
cmd error:     #1) Respect the privacy of others.
cmd error:     #2) Think before you type.
cmd error:     #3) With great power comes great responsibility.
cmd error: 
cmd error: sudo: no tty present and no askpass program specified

Oozie java程序执行shell命令行无法执行sudo命令

 

二、解决

1.查看java 执行命令是centos那个用户

Oozie java程序执行shell命令行无法执行sudo命令

2.修改服务器nobody用户执行sudo的权限

  1. 修改文件读写权限:chmod +w /etc/sudoers
  2. 修改文件,在/etc/sudoers最后一行加:nobody ALL=(ALL) NOPASSWD: ALL

      Oozie java程序执行shell命令行无法执行sudo命令

 

相关文章: