#how to read from ssh session
40 messages · Page 1 of 1 (latest)
I’m using the ssh command on my client
To connect to my server
And I get those debug messages
And correctly see the output from my server
oh, I don't know that client, I can't help
The openssh
Command
Ssh
Any ssh client works for connecting tbh
I just wanna do it with golang
like the normal ssh command is what I used
I want an interactive session where I can read from stdout
I’m just running ssh user@myserver
not a single command
I don’t want to execute a command
I just want to have a stdin and stdout I can write and read to
Wdym
With the go ssh library
does go have a ssh client in the std lib? 😮
this looks like you are not using the executable ssh
this looks like you are indeed using the executable ssh
this looks like you are running the default shell in the remote machine
if you share a link to your code that may help as right now it's a bit nebulous what you're trying to do and what help you're seeking
I am
So it works with the ssh executable but fails with golang ssh library
When it works with the ssh executable I get that debug1 output
I’ll show code
it might be looking for the standard input to ask for the password and you didn't propagate it
if it's interactive, it is a shell, sh/bash/something-else
there is always a single command
I can authenticate just fine, in both the ssh executable and in golang, the problem is reading from the shell
btw I’m not home yet :/
so no code yet
then it might be you are actually reading from the ssh output
OMGGGGG
Solved
Ok so I needed to turn on the stdoutpipe before running shell
lol
oh, was I right? 😄