Using juju ssh from windows clients
John Meinel
john at arbash-meinel.com
Sat Oct 29 04:40:56 UTC 2016
I thought you could change the properties of a file handle so that it would
be in binary mode, instead of text mode.
https://msdn.microsoft.com/en-us/library/ktss1a9b.aspx
says that you can use "_setmode" to change the stdin descriptor
https://msdn.microsoft.com/en-us/library/tw4k6df8.aspx
I haven't found anything that actually exposes that into Go, though. Is it
something that we need to fall into CGO for?
(It seems better to set the file mode, rather than injecting code into
stripping the bytes, but maybe that's not true if we have to depend on cgo.)
John
=:->
On Fri, Oct 28, 2016 at 6:13 PM, Martin Packman <
martin.packman at canonical.com> wrote:
> Looking at juju ssh session from windows client bug:
>
> <https://bugs.launchpad.net/juju-core/+bug/1468752>
>
> The core issue is simple. We pass stdin straight over the ssh
> connection, without coping with it being a windows text stream. So
> lines are terminated with '\r\n' rather than just '\n', which then
> confuses bash on the remote machine.
>
> I have made a test build that basically wraps stdin with a translation
> that strips \r characters before passing it through to the native go
> ssh implementation. Obviously this doesn't give us full terminal
> capabilities, but may be good enough. Are there any pitfalls I'm
> missing here?
>
> Background is juju traditionally, and still in practice on most nix
> systems, will shell out to openssh client to connect to machines.
> That's not an option on windows, but the fallback golang crypto
> library can be used instead. That lacks a bunch of capabilities, and
> is somewhat undertested.
>
> What doesn't work:
> * interactive sessions
> * --proxy argument
> * scp
>
> What does work:
> * single commands over ssh
> * interactive sessions from cygwin
>
> Amusingly, installing python, then doing `juju ssh $MACHINE python -i`
> and ending every line with a comment sort of gets you a working remote
> shell. Fixing this bug means the basic bash session is more usable
> from the windows cmd prompt, though without all the nice bash features
> exposed.
>
> Martin
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20161029/bb2bcb1c/attachment.html>
More information about the Juju-dev
mailing list