SSH question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

SSH question

Sean P. DeNigris
Administrator
I'm using expect to send commands to my seaside server from within the image:

        arguments := {
                self expectFile fullName.
                'ssh'.
                ipAddress.
                username.
                password }.
        process := PipeableOSProcess command: '/usr/bin/expect' withArguments: arguments.

        "Must be non-blocking, or #upToEnd hangs the image"
        process setNonBlockingOutput.

Where PipeableOSProcess class>>#command: aString withArguments: aCollection

        | env pwd desc instance |
        env := CommandShell new environment.
        pwd := '/'.
        desc := (Array with: nil with: nil with: nil).
        instance := PipeableOSProcess
                new: aString
                arguments: aCollection
                environment: env
                descriptors: desc
                workingDir: pwd
                errorPipelineStream: nil.
        ^ instance value.

The problem is that I can't easily identify errors because expect delivers commands' stderr onto its stdout. I was wondering if I could do an initial login via expect, setting up to use a security key, and then use regular OSProcess (without expect), but that seems less flexible (would I ALWAYS want to use keys when you SSH? probably not). Any ideas?

Thanks,
Sean_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Cheers,
Sean