Skip to content

authenticating password for commands #16195

Answered by martinpitt
anthonygwil asked this question in Q&A
Discussion options

You must be logged in to vote

That is indeed a bit tricky -- the cockpit.file() API (like the general cockpit.channel() one does support a host option. This works great if you already have a trust relation to the target, i.e. SSH knows the target's host key and can use an established public/private key pair. In other words, if ssh user@host works, then you can use cockpit.file's { host: "user@host" } option.

But you mentioned that you need to prompt for a password, so supposedly you don't have an SSH key setup. Is it an option for you to use that instead of passwords? If not, then we could look into extending the API to pass a password to the channel options, but this is always a dangerous proposition: The password wo…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@mvollmer
Comment options

@anthonygwil
Comment options

Answer selected by martinpitt
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants