Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

com.jcraft.jsch.JSchException: java.net.ConnectException: Connection refused: connect  RSS feed

 
kelly seo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, im really new to socket programming. i am making use of JSch (http://www.jcraft.com/jsch/) to try to connect to a remote server (later stage)
currently, this is the code i use and im trying to connect to my local computer and execute a command (ls to be exact) to do a test. However, i keep hitting the connection refused. I googled and i noticed that there are some articles that mentions on "having a server listening" but I have no idea what it means. Please view my code as below.

 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need a SSH server up on the target box (sure you have one ?), I'd look for port 22 listening on that box. Do you have a server on the target eg OpenSSH ?

If you have ...
Have you tested your ssh session out with Putty/ WinSCP or the like first ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!