Automating Rundeck password MD5 generation

烂漫一生 提交于 2021-02-17 05:36:11

问题


Quick question. I'm using rundeck 3.1.2-20190927 installed via the yum repo on Centos7/RHEL7.

I'm trying to generate the MD5 password using the command line but it looks like its only through the interactive prompts using the WAR file.

ie: java -jar rundeck-3.1.2-20190927.war --encryptpwd Jetty

Is there a way I can feed it the username/password so I can grep out the MD5 hash instead of having to do this interactively? The documentation is a bit of a mess and I'm seeing references to jetty-all JAR being able to do this but that file isn't in the bootstrap directory, just the WAR.


回答1:


You can use expect as inline script or "external" script to do that without any interaction

    #!/usr/bin/expect
    spawn java -jar rundeckpro-cluster-3.1.2-20190927.war --encryptpwd Jetty
    expect -exact "Username (Optional, but necessary for Crypt encoding):"
    send -- "user\r"
    expect -exact "*Value To Encrypt (The text you want to encrypt):"
    send -- "user\r"
    expect eof


来源:https://stackoverflow.com/questions/58495654/automating-rundeck-password-md5-generation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!