Giter Site home page Giter Site logo

Comments (6)

nzlosh avatar nzlosh commented on June 18, 2024 1

If this is not explicitly documented then it's a documentation bug and ideally a PR opened against https://github.com/StackStorm/st2docs to fix it.

from st2.

fdrab avatar fdrab commented on June 18, 2024
REMOTE_RUNNER_PRIVATE_KEY_HEADER = "PRIVATE KEY-----".lower()

    def _is_private_key_material(self, private_key):
        return private_key and REMOTE_RUNNER_PRIVATE_KEY_HEADER in private_key.lower()

Does this help? Your key does not appear to contain the above header

from st2.

nzlosh avatar nzlosh commented on June 18, 2024

Could this https://docs.stackstorm.com/reference/runners.html?highlight=private%20key#id2 be any more explicit or is it sufficient?

from st2.

philipphomberger avatar philipphomberger commented on June 18, 2024

Hi, thank you both. Yes but than I add begin and end of the ssh key this error happen:
[ecordk_adm@testserver ~]$ st2 run core.remote cmd=ls hosts=testserver username=test_adm private_key=$KEY
usage: st2 [-h] [--version] [--url BASE_URL] [--auth-url AUTH_URL] [--api-url API_URL] [--stream-url STREAM_URL] [--api-version API_VERSION] [--cacert CACERT] [--basic-auth BASIC_AUTH] [--config-file CONFIG_FILE] [--print-config] [--skip-config] [--debug]
{run,action,action-alias,auth,login,whoami,apikey,execution,inquiry,key,pack,policy,policy-type,rule,webhook,timer,runner,sensor,trace,trigger,trigger-instance,rule-enforcement,workflow,service-registry,role,role-assignment} ...
st2: error: unrecognized arguments: -----END RSA PRIVATE KEY-----

So Iam confused at the moment what I did wrong here :/

from st2.

fdrab avatar fdrab commented on June 18, 2024

try to wrap the variable $KEY in ""

from st2.

philipphomberger avatar philipphomberger commented on June 18, 2024

@fdrab Thank you this was a very helpful tip.
Solution:
Read the Private Key so:
KEY=sudo cat /etc/st2/id_rsa | sed 's/\n//g'
(Without the line breaks not work correct for me)
Test with: echo "${KEY}"
st2 run core.remote cmd=ls hosts=tessystem username=test_adm private_key="${KEY}"
Add to Key Value Store:
st2 key set test_ssh_privat_key "$KEY" --encrypt
Use From Key Value Store:
st2 run core.remote cmd=ls hosts=tessystem username=test_adm private_key="{{ st2kv.system.test_ssh_privat_key | decrypt_kv }}"

@nzlosh Should I add it to the documentation? I thin could be interesting for other as well.

from st2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.