Git Product home page Git Product logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 23, 2024
[deleted comment]

from janalyse-ssh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 23, 2024
Code:
    val ssh = SSH("10.140.1.1", "test", "testpwd")
    println(ssh.jschsession.isConnected)
    val cmd = ssh.execute("cmd /c cd")

Log:
true
Exception in thread "main" java.lang.ExceptionInInitializerError
    at Tes.main(Tes.scala)
Caused by: com.jcraft.jsch.JSchException: session is down
    at com.jcraft.jsch.Channel.sendChannelOpen(Channel.java:762)
    at com.jcraft.jsch.Channel.connect(Channel.java:151)
    at fr.janalyse.ssh.SSHExec.<init>(SSHExec.scala:17)
    at fr.janalyse.ssh.SSH.execOnceWithStatus(SSH.scala:301)
    at fr.janalyse.ssh.SSH.execOnce(SSH.scala:283)
    at fr.janalyse.ssh.SSH.execute(SSH.scala:273)
    at Tes$.Con(Tes.scala:60)
    at Tes$.<init>(Tes.scala:18)
    at Tes$.<clinit>(Tes.scala)

environment:
Scala 2.10.3
JASSH 0.9.13
Windows 8.1
JRE 7

Original comment by [email protected] on 7 Jul 2014 at 4:36

from janalyse-ssh.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 23, 2024
 additional note - going directly through jsch works fine:

val session = jsch.getSession("test", "10.140.1.1", 22);

            session.setPassword("testpwd")

            val config = new java.util.Properties();

            config.put("StrictHostKeyChecking", "no");

            session.setConfig(config);

            session.connect();
            val cmd="cmd /c dir"
            val ch = session.openChannel("exec").asInstanceOf[ChannelExec]
    ch.setCommand(cmd)
    val res = ch.getInputStream()

    ch.connect
    println (session.isConnected())
    println (scala.io.Source.fromInputStream(res).mkString)

Original comment by [email protected] on 7 Jul 2014 at 4:48

from janalyse-ssh.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.