I want to run shell command from rails app controller. My app code is:
cmd = "openssl genrsa -des3 -out testfolder/testkey.key 1024"
system cmd
than shell will ask me password, so if you run this command from terminal you can input password, but if I run from controller I can't.
I don't want to use rails OPENSSL, for some reasons.
I tried to google but I have no result.
Also I tried something like this:
cmd = "openssl genrsa -des3 -out testfolder/testkey.key 1024"
system cmd
system 'echo', '111111Passs'
This is not solution of my problem.
My question is: how to pass password from controller to shell? Than how I can submit this command? (simulate press on ENTER on my keyboard)
Thanks