I am trying to create a program which connects to remote server over ssh and executes commands given by user.i use os.TeeReader on os.stdin to log all user inputs but this is breaking tty.
var bufferRead bytes.Buffer
sshstring:=user+"@"+host
cmd := exec.Command("ssh",sshstring,"-o StrictHostKeyChecking=no")
cmd.Stdout = os.Stdout
cmd.Stdin =io.TeeReader(os.Stdin,&bufferRead)
cmd.Stderr = os.Stderr
cmd.Run()
fmt.Printf("
History: %s", &bufferRead)
I am getting following warning on execution with broken tty
Pseudo-terminal will not be allocated because stdin is not a terminal