Skip to content
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

SSH bastion compatibility #110

Closed
snk33 opened this issue Nov 19, 2020 · 13 comments
Closed

SSH bastion compatibility #110

snk33 opened this issue Nov 19, 2020 · 13 comments
Assignees
Labels
✨ enhancement New feature or request
Projects

Comments

@snk33
Copy link

snk33 commented Nov 19, 2020

Hello again :)

Pseudo-terminal

Some SSH bastion rely on ssh pseudo-terminal capabilities to work, which works on a unix terminal with this "ssh" option :

-t      Force pseudo-terminal allocation.  This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services.  Multiple -t options force tty allocation, even if ssh has no local tty.

We're implementing The Bastion from OVH (open-sourced recently) and it seems that we cannot make it work.

Send command on ssh connection

Also, it seems impossible to send command on ssh connection rather than the connected shell once loaded, using "launch command on connection". OVH dev has tested and replied :

ok, the "launch command on connection" is actually waiting for a bash prompt to manually input the command you have configured (as if you typed it on your keyboard), this is different from specifying a command directly on the ssh command-line, that's why you can't make it work.

Maybe the WebSSH dev could add the feature ;)

The command line equivalent would be :

ssh -i ~/.ssh/myprivatekey -t user@bastion -- COMMAND

Example of command in case of OVH The Bastion :

root@host

That will connect to the remote server via bastion.

I know this feature request is about specific use case but I hope SSH bastion will be more frequently used (thanks to open-source project like this one), security being a critical concern in the Internet jungle :)
And of course it'll be a good one for pro version.

Related issue on The Bastion project : ovh/the-bastion#54

Have a good day !

@isontheline isontheline self-assigned this Nov 19, 2020
@isontheline isontheline added the ✨ enhancement New feature or request label Nov 19, 2020
@isontheline isontheline added this to the 15.0 milestone Nov 19, 2020
@isontheline
Copy link
Owner

Re @snk33👋

Thank you a lot for this great issue!

I will check how I can improve pseudo terminal support inside WebSSH, asap

@snk33
Copy link
Author

snk33 commented Nov 19, 2020

You’re welcome.

I hope it won’t be too much work to achieve this but it would be so nice to promote that kind of open-source solution (cocorico ^^).

@snk33
Copy link
Author

snk33 commented Nov 20, 2020

To follow message on the-bastion issue, it seems that "-t" option is already used by default, at least now I can connect to the bastion and use it normally.

Only the send command on ssh connect part could be added then.

@isontheline
Copy link
Owner

I'm working on it right now.

Getting some glitches but I'm confident 😇

@isontheline
Copy link
Owner

isontheline commented Nov 21, 2020

Hello @snk33

After a lot of bad tries :
image

I'm now able to send commands :
Capture d’écran 2020-11-21 à 21 49 24

Even interactive mode :
Capture d’écran 2020-11-21 à 21 51 52

😇

I don't think that I will implement this enhancement inside "macros" / "launch command on connection" because this enhancement is more related to the terminal settings :
Capture d’écran 2020-11-21 à 21 56 33

So I will add this terminal settings option :

  • Start connection with
    • Shell (default)
    • Custom command

You will then be able to add any custom command, like :

  • --osh info
  • info
  • etc...

I'm now working on the UI

@snk33
Copy link
Author

snk33 commented Nov 21, 2020

Wow that’s awesome thanks !

Indeed my first thought was to check terminal settings to do this, it does make sense.

I hope it’ll help people to use this kind of solutions (including you ? 🙃)

@isontheline
Copy link
Owner

Yes including me 😁

I will release this beta version in a few hours :
Capture d’écran 2020-11-23 à 08 08 14

@isontheline isontheline added this to In progress in SSH Nov 23, 2020
@isontheline isontheline modified the milestones: 15.0, 14.7 - Tractor Nov 23, 2020
@isontheline
Copy link
Owner

Now available for beta testing :
https://testflight.apple.com/join/QSrBK59z

☀️ Have a nice day

@snk33
Copy link
Author

snk33 commented Nov 23, 2020

I've tested the beta version, it works as expected. I was able to send --osh command on login and mostly set a connection to specific server by giving a command "user@host".

Just one detail, when I want to edit the custom command I must disable it then select "Custom" again. No need to implement complicated list of command or anything, just be able to edit the command by clicking another time on "Custom" would be nice :)

@isontheline
Copy link
Owner

Thanks for your feedback @snk33!

No problem I will fix this glitch asap 😇

I will come back to you shortly.

@isontheline
Copy link
Owner

A new TestFlight release is now available

@snk33
Copy link
Author

snk33 commented Nov 24, 2020

Tested, everything's fine now ! :)

@isontheline
Copy link
Owner

Thank you again for your feedback 👍

@isontheline isontheline moved this from In progress to Done in SSH Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
No open projects
SSH
Done
Development

No branches or pull requests

2 participants