查阅了资料解决方案分两步骤
只是单单配置用户环境变量是没用的!!
具体参考下面的方案
1、为非root用户配置用户变量
vi ~/.bash_profile
配置PATH
在后面加上:/sbin
最终PATH=$PATH:$HOME/bin:/sbin
source .bash_profile
2、程序中set命令之前加上source命令
openChannel.setCommand("source .bash_profile && "+req.getCommand());
查阅了资料解决方案分两步骤
只是单单配置用户环境变量是没用的!!
具体参考下面的方案
1、为非root用户配置用户变量
vi ~/.bash_profile
配置PATH
在后面加上:/sbin
最终PATH=$PATH:$HOME/bin:/sbin
source .bash_profile
2、程序中set命令之前加上source命令
openChannel.setCommand("source .bash_profile && "+req.getCommand());