[
https://issues.apache.org/jira/browse/SSHD-1268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17534956#comment-17534956
]
Thomas Wolf commented on SSHD-1268:
-----------------------------------
We can't really help you with implementing your "prod" application. It sounds
like you want to authenticate using password authentication (why you'd do that
in a production system instead on publickey authentication is beyond me), then
open a shell running a script that executes {{sudo su}} and then something
more. So basically you'd have to examine the {{ChannelShell}}'s input and
output streams and feed it the password when you see your prompt. The {{-S}}
option of sudo might help.
> sudo su non interactively entering a password
> ---------------------------------------------
>
> Key: SSHD-1268
> URL: https://issues.apache.org/jira/browse/SSHD-1268
> Project: MINA SSHD
> Issue Type: Story
> Reporter: Harrison
> Priority: Major
>
> I would like some code examples as to how I would achieve the following.
> I have a working Non Prod use case whereby all that is required is pub/priv
> key authentication.
> For Prod, I need
> (a) username/password authentication - which isn't an issue. Once logged in,
> (b) that user needs to run a "sudo su" to a permissioned account in order to
> continue.
> It is (b) that is proving tricky as I need to simulate user interaction (non
> interactively) to enter a password upon seeing a prompt.
>
> I'm aware there are interfaces / classes (UserInteraction,
> UserAuthKeyboardInteractive) that might be able to help with this but I would
> appreciate some code examples if possible.
>
> Thanks!
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]