Comments (3)
[deleted comment]
from janalyse-ssh.
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.
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)
- ssh keys HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from janalyse-ssh.