sftp

Bash Script that downloads file from FTP only if it hasn't downloaded it previously

匆匆过客 提交于 2019-12-25 16:54:35
问题 I currently have a bash script that downloads files from an FTP Site. I would like to modify the script to keep a manifest of every file it downloads and only download any new files that are not in the manifest. Is there a way to do this in bash or am I pushing the limitations of what bash can actually do? 回答1: My suggestion would be to go grab the list of files that you might want to download, compare that to your manifest, then download the ones not in the manifest. Something like this

SFTP RSA authentication in Azure VM

徘徊边缘 提交于 2019-12-25 16:53:30
问题 Requirement- Connecting SFTP server from local windows machines using WinSCP with keys Technical- I have Azure VM(Windows 2012 server R2) in which Cygwin64 is installed for SFTP. I want to connect SFTP server using RSA authentication i.e using keys. I have edited the sshd_config file for RSA authentication. In cygwin64 folder I have also created .ssh folder and under that Authorized_keys file. From local machine using putty I have generated Public and private keys and this public key I have

com.jcraft.jsch.JSchException: java.io.IOException: Pipe closed

安稳与你 提交于 2019-12-25 05:13:47
问题 I am trying to copy a file over SFTP to another Host using Jcraft JSch (http://www.jcraft.com/jsch/). I am getting below error: Connecting via SSH to somehost:22 com.jcraft.jsch.JSchException: java.io.IOException: Pipe closed at com.jcraft.jsch.ChannelSftp.start(ChannelSftp.java:315) at com.jcraft.jsch.Channel.connect(Channel.java:152) at com.jcraft.jsch.Channel.connect(Channel.java:145) Relevant code is below: Channel channel = null; ChannelSftp channelSftp = null; Exception cause = null;

Mulesoft SFTP connector <service-overrides messageReceiver=“my.package.mySftpMessageReceiver”/> + JSch not working properly

百般思念 提交于 2019-12-25 03:17:24
问题 I am using Anypoint Studio to upsert product items from SFTP to Salesforce. I created a class mySftpMessageReceiver that extends sftpMessageReceiver and overrides the poll() function. In the poll() function I wrote, I am creating an instance of the class JSchSFTPBrowser I wrote. It uses the JSch Library. In this class, there's a function that takes rootDirectory and fileName as parameters. It looks recursively in all subfolders of rootDirectory for files having name containing fileName and

Veryfing fingerprints using SharpSSH while connecting to SFTP Server

自古美人都是妖i 提交于 2019-12-25 03:14:32
问题 I am using Tamir.SharpSSH to make SFTP connections in my .NET code. I have servers' host, port, username, password and servers' fingerprint. I am able to connect to the server without the fingerprint. Is there any way to match the fingerprint that I have with the servers' before making the connection? Following is my C# code for the connection: string _ftpURL = "ftp.com"; //Host URL or address of the SFTP server string _UserName = "Login_Id"; //User Name of the SFTP server string _Password =

Transfering file for download through SFTP with PHP very slow

无人久伴 提交于 2019-12-25 01:49:55
问题 I want to be able to get a file through SFTP from a server in order for my web server to allow users to download it afterwards. To achieve this, I am using the phpseclib library. Unfortunately, this is really slow as I can only achieve speeds of 300-350kb/s when I could achieve over 1mb/s before when directly downloading from the server hosting the original files. For some internal reasons in our company, we have to relocate these files on an other server which only has the port 22 opened, so

sshpass throwing error 'Failed to get a pseudo terminal: Success'

三世轮回 提交于 2019-12-25 01:44:16
问题 I am trying to run the sshpass tool to automate an sftp action. On another server, the command works, but on this server it just returns one line of error mesage. Here is the command I am using: sshpass -p Password sftp Uname@Host And I get the error: Failed to get a pseudo terminal: Success I've tried it with lots of different hosts and as the root user, and I can sftp in without a problem so I am pretty sure it is either a sshpass or pseudo terminal issue. I don't know a whole lot about

can you run half a script in bash and the other half in expect

耗尽温柔 提交于 2019-12-25 01:34:46
问题 Im trying to make a script to automate ssh login and download of a file for multiple ip addresses that are kept in a file, im using a for i in $(cat /dir/file) , problem is the cat function is working in expect so i cant use it on a script that is interpreted with expect. I wanted to know if it is possible to make half of the script be interpreted by bash and the other half by expect like this #!/bin/bash code........ #!/usr/bin/expect code........ my code now looks like this #!/bin/bash

SFTP file manipulation using shell script

喜夏-厌秋 提交于 2019-12-24 12:48:01
问题 Has anyone tried to access and manipulate files in an SFTP server using shell script Basically, here's what I have to do: 1. Open SFTP, access the designated directory 2. Loop through all .txt files 3. Read filename of each .txt files and only get the file/s that contain/s 'XX' substring (i.e. hello-XX.txt) 4. Rename that file by appending an '-OK' string (i.e.hello-XX-OK.txt) Thanks for your inputs. 回答1: You can script SFTP with a "here document" ( <<EOF , as specified here), but you won't

java jsch SSH_MSG_DISCONNECT Failed to read binary packet data

 ̄綄美尐妖づ 提交于 2019-12-24 11:35:36
问题 So I use a private key to connect to the sftp server ,so it came back error: com.jcraft.jsch.JSchException: SSH_MSG_DISCONNECT: 2 Failed to read binary packet data! Here is the code: JSch jsch = new JSch(); jsch.addIdentity(new File(privateKey).getAbsolutePath()); session = jsch.getSession(ftpUserName, ftpHost, ftpPort); LOGGER.debug("Session created."); if (ftpPassword != null) { session.setPassword(ftpPassword); } Properties config = new Properties(); config.put("StrictHostKeyChecking", "no