Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Sudo threw scriptable task is not working

$
0
0



Hi ,


I am trying to run a command using the scriptable task which requires SU to root, I notice I can't sudo and then run the command since its not the same shell, so I tried using the sudo -S command that will pull the password from the stdout:


session.connectWithPassword(password);



System.log("Connected!");


     var cmd="echo 123456 | sudo -S sed -i '
''s/export TMOUT=120/export TMOUT=2400/g'
'' /etc/profile";

     System.log("Executing "cmd"");


session.executeCommand(cmd,false) ;



If I am running this command on the server itself its working perfect.



Any idea whay?



Thanks,



Avi



Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>