01-29-2018 06:43 AM
Running the below script:
ssh email@example.com "if [ -f /data/home/user/datafiles/Test.csv ] ; then echo 1 ; else echo 0 ; fi;"
Set up passwordless ssh for 'user' too.
Getting the below error:
Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code 
Solved! Go to Solution.
01-29-2018 07:05 AM
This is probably related to the fact that the shell action, when run from Oozie, runs as user "yarn" and not as the desired user you're specifying in the ssh command
You can refer to this thread for more information about the issue:
It should all boil down (in case your cluster is not secured with kerberos) to try and set up your environment, specifically the "linux-container-executor" configuration parameter (you go in Cloudera Admin UI --> Yarn --> Configuration).
It's all explained in the linked document. Another alternative could be to grant OS user "yarn" with permissions to execute "ssh" and/or "su" so you can eventually switch user in your script before executing the remote ssh command
01-29-2018 07:16 AM
1. I should uncheck thie below?
01-29-2018 07:26 AM - edited 01-29-2018 07:27 AM
1) Apparently, yes
2) The name of the user you're trying to use to log in to the remote system, I suppose. Pls note that the user you specify here would be the user "oozie" will run as, so you'd eventually get other problems of unpredictable nature when using Oozie
3) I don't really know, sorry about that... The fact is that even if I'm pretty sure to have understood the cause of your issue, I never had to deal with it directly myself. Maybe the easier way could be to follow the additional suggestions I wrote in my previous answer (give permissions to OS User "yarn" to "ssh" and/or "su"). Or, maybe, another possibility would be for you to create a "yarn" user on the remote system and grant this user with the correct permissions to get to the final working directory
I hope you'll manage to get through the problems and make it :)