SFTP File Transfer using Java JSch

Поділитися
Вставка
  • Опубліковано 6 січ 2025

КОМЕНТАРІ • 19

  • @swetadas9530
    @swetadas9530 2 роки тому +2

    Very simple and effective code with good explanation.. thanks sir 🙏

  • @amitsaini2240
    @amitsaini2240 2 роки тому +2

    very simple and direct code thanks

  • @pavanvhsn
    @pavanvhsn 2 роки тому +1

    Awesome explanation. I get Auth Fail from Jsch library when the password contains "+". Any solution for this?

  • @nandhuvenkat1198
    @nandhuvenkat1198 Рік тому

    How to get the file in another server instead of local?

  • @rathinakumarr6285
    @rathinakumarr6285 2 роки тому

    Same code NOT working for RHEL 8 server, May i know how to connect RHEL8 server with Java code JSch

  • @suhaschavan8406
    @suhaschavan8406 3 роки тому +2

    Can you show us how to login with private key?

  • @hanumansays3725
    @hanumansays3725 2 роки тому

    How to specify the localPath if we are developing on windows machine.
    Somehow C:\\Users\\file.txt - This isn't working

    • @ggaur10
      @ggaur10 Рік тому +1

      Hi Hanuman,
      If the remote machine is windows:
      For sftpPath use: "/C:/Users/file.txt"
      For local path based on your OS, you can use windows style or Linux style path:
      For Windows: "C:\\Users\\file.txt" or "C:/Users/file.txt" both will work
      For Linux: "/home/users/user1/file1.txt" will work.
      Let me know if it worked or not?
      Thanks,
      Gaurav

    • @hanumansays3725
      @hanumansays3725 Рік тому

      @@ggaur10 Thanks Gaurav, this worked on windows machine. Appreciate your response.

  • @vorugantikamalika4455
    @vorugantikamalika4455 2 роки тому

    How can we transfer files from one path to another path in the same Unix server using SFTP. can we follow the same process??

    • @emadsamir6092
      @emadsamir6092 2 роки тому

      did you get an answer for this question?

    • @vorugantikamalika4455
      @vorugantikamalika4455 2 роки тому

      @@emadsamir6092 noo

    • @ggaur10
      @ggaur10 Рік тому

      Hi Voruganti,
      I don't know about Linux but for windows, you can do it. But you have to give the local path as "/C:/". Note the "/" before C:
      One tip to understand the structure of local and remote side paths for SFTP, use the popular software WinSCP and notice the remote and local paths there.
      Thanks,
      Gaurav

  • @sivakrishnat5471
    @sivakrishnat5471 3 роки тому

    how to move a file instead of copying?

    • @atomicengineering
      @atomicengineering  3 роки тому +1

      You can first copy the file then check the checksum in source and target. Then delete the file from SFTP server

  • @miggyjang4476
    @miggyjang4476 Рік тому

    java version 6 error com.jcraft.jsch.JSchException: Algorithm negotiation fail
    at com.jcraft.jsch.Session.receive_kexinit(Session.java:582)

    • @monikaveeramalla3381
      @monikaveeramalla3381 11 місяців тому

      How did you resolve the error I am also facing the same issue please help