question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SSH bastion compatibility

See original GitHub issue

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 : https://github.com/ovh/the-bastion/issues/54

Have a good day !

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
isonthelinecommented, 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

1reaction
snk33commented, Nov 24, 2020

Tested, everything’s fine now ! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSH to remote hosts through a proxy or bastion with ProxyJump
The ssh command first creates a connection to the bastion host bastion-hostname (the host referenced, by nickname, in the remote host's ProxyJump settings) ......
Read more >
Bastion Host Servers Explained - Twingate
Commonly used as SSH proxy servers to support system administration, bastions provide a convenient, securable path through a protected network ...
Read more >
Ansible: orchestrating ssh access through a bastion host
Ansible uses ssh to configure its target host inventory, but for on-premise datacenters as well as hyperscalers like EC2/GCP/Azure, ...
Read more >
Building a secure bastion host, or, 50 ways to kill your server
The two most common ways methods are to use a VPN, or to ssh through a bastion host (also known as a jump...
Read more >
Azure Bastion FAQ - Microsoft Learn
Azure Bastion offers support for file transfer between your target VM and local computer using Bastion and a native RDP or SSH client....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found