[GH-ISSUE #197] Post connect expect script #49

Closed
opened 2026-05-07 00:18:08 +02:00 by BreizhHardware · 2 comments

Originally created by @N-Mi on GitHub (Jun 10, 2021).
Original GitHub issue: https://github.com/ovh/the-bastion/issues/197

Hi,

Is there a way to run a script after connection, and before giving the interactive shell to the user ? Typical scenario is an equipment that provides a restricted command line, and needs to enter a command then an administrator password to give full access.

An expect script might be ideal for that, but any other language could be used, provided it can wait for prompt strings, and write the needed commands/passwords in the connection.

Thanks.

Originally created by @N-Mi on GitHub (Jun 10, 2021). Original GitHub issue: https://github.com/ovh/the-bastion/issues/197 Hi, Is there a way to run a script after connection, and before giving the interactive shell to the user ? Typical scenario is an equipment that provides a restricted command line, and needs to enter a command then an administrator password to give full access. An expect script might be ideal for that, but any other language could be used, provided it can wait for prompt strings, and write the needed commands/passwords in the connection. Thanks.
Author
Owner

@speed47 commented on GitHub (Jun 25, 2021):

It's not supported right now, but could be if needed. If your equipments use passwords for logins (as opposed to SSH keys), then The Bastion is already using expect to type the password. In that case, one could imagine supporting to handover control to another custom expect script once the first (SSH) login is done, so that the other script types in "en" and a second password. Would this work for you?

<!-- gh-comment-id:868300161 --> @speed47 commented on GitHub (Jun 25, 2021): It's not supported right now, but could be if needed. If your equipments use passwords for logins (as opposed to SSH keys), then The Bastion is already using expect to type the password. In that case, one could imagine supporting to handover control to another custom expect script once the first (SSH) login is done, so that the other script types in "en" and a second password. Would this work for you?
Author
Owner

@speed47 commented on GitHub (Oct 20, 2021):

Closing for inactivity, please reopen if needed

<!-- gh-comment-id:947642335 --> @speed47 commented on GitHub (Oct 20, 2021): Closing for inactivity, please reopen if needed
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/the-bastion#49
No description provided.