I have Jenkins running on my local machine trying to figure out remote ssh problem I\'m having on a server. I\'m getting this permission denied error which indicates a probl
Jenkins run shell scripts is slight different with cmd line on environment
there are some environment difference in your case, which we didn't notice. like initial script, path setting.
besides the method provided by @coffeebreaks, try below
env