-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to chain logins? #7
Comments
This is something I haven't tried yet and isn't officially supported. |
i need to login to a local account that does not allow ssh. so, i need to ssh into the machine (initial connection) and from it login to the local account. a use case you can use for testing:
looking at the source code, it seems like a command is run as a single transaction, and then closes the connection. you can still run several commands seperated by semi-colon (cd /home/ehud/dir/; ls -la) but that does not work for login, as the console expects an interactive response. it occuered to me one way that might work is to create a MultiCommand class which extends (or expands) Command, or which will hold a set of commands, and change SshClient.exec, to run through all the commands sequentially (in val channel = session.exec(command.command)). don't know if that is the right way, but i thought i might fork and try it... |
Is this supported now? |
i need to log in to one ssh, and from it i need to log to another. how do i pass the username and password for the seond login? when i pass "; " after the second login command, it just grinds and time out eventually with nothing.
The text was updated successfully, but these errors were encountered: