ssh icon indicating copy to clipboard operation
ssh copied to clipboard

Question - how to leave the connection open without a tty

Open chazsconi opened this issue 4 years ago • 3 comments

I'm trying to create a installable binary that supports the -T option (no tty) so I can use it to connect to with VSCode's remote option.

VSCode fails to connect with a Failed to parse remote port from server output error - I'm not certain, but I expect this is because it sends the -T option, but then the ssh server immediately closes the connection because there is no command or tty.

What code do I need to leave the connection open without having a tty?

chazsconi avatar Feb 09 '22 12:02 chazsconi

Hi, I have the same problem. Did you solve it?

CaffreyZhang avatar Jul 12 '22 09:07 CaffreyZhang

Hi @ZhangKingsasa. In the end we used https://github.com/openssh/openssh-portable instead for our use case.

chazsconi avatar Jul 12 '22 09:07 chazsconi

You can get that information from the session. Here's a hint from the example:

https://github.com/gliderlabs/ssh/blob/30ec06db4e743ac9f827a69c8b8cfb84064a6dc7/_examples/ssh-docker/docker.go#L17-L30

mohammed90 avatar Jul 12 '22 12:07 mohammed90

Hi @ZhangKingsasa. In the end we used https://github.com/openssh/openssh-portable instead for our use case.

@ZhangKingsasa Could you please close this issue?

gustavosbarreto avatar Aug 25 '22 13:08 gustavosbarreto