Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9296277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:47:52+00:00 2026-06-18T21:47:52+00:00

I am trying to connect to a SFTP remote server using JSCH library version

  • 0

I am trying to connect to a SFTP remote server using JSCH library version 0.1.49. Every time I run the program I receive the following error :

Initializing...
Connection to SFTP server is successfully
com.jcraft.jsch.JSchException: Unable to connect to SFTP server.com.jcraft.jsch.JSchException: failed to send channel request
at shell.MainClass.JschConnect(MainClass.java:95)
at shell.MainClass.main(MainClass.java:30)

line 30 is : sftpChannel.connect() from the code below :

    System.out.println("Initializing...");
    JSch jsch = new JSch();

    Session session = null;
    try {   
        session = jsch.getSession(ProjectConstants.rmUsername,ProjectConstants.rmHost, 22);
        session.setPassword(ProjectConstants.rmPassword);

        java.util.Properties config = new java.util.Properties(); 
        config.put("StrictHostKeyChecking", "no");
        session.setConfig(config);

        session.connect();
        if (session.isConnected() == true) {
            System.out.println("Connection to SFTP server is successfully");
        }

        ChannelSftp sftpChannel = (ChannelSftp) session.openChannel("sftp");
        try {
            sftpChannel.connect();
        } catch (Exception e) {
            throw new JSchException("Unable to connect to SFTP server. "
                    + e.toString());
        }

the credentials I am using are correct ( it connects through FileZilla using the same data ), and I also disabled the proxy for that server ( either way I get the same error with or without proxy )

If anyone could help me I would greatly appreciate it as I am stuck with this error for about a week now …

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:47:53+00:00Added an answer on June 18, 2026 at 9:47 pm

    Check if SFTP server is started and running.

    I had encountered the same issue – I was not able to open SFTP channel to my server, but I could connect with WinSCP. It took me some time to notice that WinSCP would fallback to SCP hence confusing me. Starting the server solved this issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to connect to remote sftp server over ssh with JSch (0.1.44-1)
I am using Paramiko and trying to connect to my SFTP server. Here is
I'm trying to connect to a SSH2 server through SFTP in PHP using PHPSecLib.
I am getting following error while trying to connect to a sftp server:- ncftpput:
I'am trying to connect to a remote server over ssh2 using the lib ch.ethz.ssh2.Connection
Im trying to connect my project via sFTP. and everytime I run the project
When I am trying to connect to my SVN repository on some remote server
I am trying to connect to a MySQL Server using JDBC tool in java
Trying to connect to sql server 2005 with delphi 2010 gives me the following
Trying to connect to a SQL Server 2005 instance remotely but getting the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.