SSH执行远程命令infacmd.sh失败

sshpass -p "xxx" ssh -t -t abc@usllpz107.net.com 'cd /opt/tools/informatica/ids/Informatica/10.2.0/isp/bin;infacmd.sh oie importObjects -dn Domain_IDS_Dev -un abc -pd "xxx" -rs MRS_IDS_DEV -sdn LDAP_NP -fp /opt/tools/informatica/ids/Informatica/10.2.0/tomcat/bin/source/mapping_import.xml -cp /opt/tools/informatica/ids/Informatica/10.2.0/tomcat/bin/source/import_control_file.xml'| tee -a logfile.log

我正在Buildspec中的容器中运行上述命令,并在ec2实例中进行了测试,命令失败,并显示错误:sh: infacmd.sh: command not found

但是,当我只尝试命令sshpass -p "xxx" ssh -t -t abc@usllpz107.net.com并在ec2中手动执行其他命令时,该命令就起作用了。

lishuangw 回答:SSH执行远程命令infacmd.sh失败

确保文件位于路径中。 确保您有权访问该文件。 确保文件是可执行文件或将命令更改为

  

; / bin / bash infacmd.sh ...

本文链接:https://www.f2er.com/3138268.html

大家都在问