FAQ Database Discussion Community


Transfer folder from one SFTP server to another every day

sftp
I have two different servers. I use WinSCP to transfer a folder manually: I connect to SFTP on SVR-01 -> Transfer folder to my local machine I connect to SFTP on SVR-02 -> Transfer folder from my local machine to SVR-02 What I want?: I would like to do it...

Cloud9 workspace using S3 bucket as source?

amazon-s3,ftp,sftp,cloud9-ide
Given the popularity of hosting static sites from AWS S3 buckets it would be great to be able to do that from Cloud9 too. Is there any way I can set up an FTP-based workspace that uses an S3 bucket as the source? Transmit and other FTP apps have the...

how to run custom commands using sftp or ssh or paramiko

python,ssh,sftp,paramiko
t I have the following code which uses ssh and sftp to ssh to a buildserver on the network and run the native mkdir and chdir commands,how do I run any custom commands with some executables i have installed locally on the build server? import paramiko ssh = paramiko.SSHClient() ssh.load_system_host_keys()...

download file sftp with curl running out of memory [duplicate]

php,curl,sftp
This question already has an answer here: Downloading a large file using curl 4 answers How to avoid this error Fatal error: Allowed memory size of 209715200 bytes exhausted The files are very large (over 5gb) $host = 'domain.com'; $pass = 'xxx'; $remote = "sftp://root:[email protected]$host/var/www/test.txt"; $local = 'C:\wamp\www\test.txt'; $curl...

SFTP Processbuilder

java,unix,sftp,processbuilder,ssh2-sftp
I have to invoke unix commands from Java and I have to use ProcessBuilder. I want to login through SFTP using key authentication and I want to SFTP the file from local directory to remote location. ProcessBuilder pb = new ProcessBuilder("sftp","-oIdentityFile=privateKey","-b","commands.txt","[email protected]"); Content in commands.txt is put localFileDirectory remoteDirectory exit Is...

How to upload the file to another SFTP server from shell channel by using Jsch?

shell,unix,sftp,jsch
Step 1: Session connect .... session.connect() Step 2: Shell channel channel = session.openChannel("shell"); Step 3: Execute ssh commands to login Unix server and go to the required path cd /logs/server PrintStream shellStream = new PrintStream(channel.getOutputStream()); // printStream for convenience channel.connect(); shellStream.println(command); shellStream.flush(); step 4: Get the file from Unix server...

How can I use Jenkins to detect the presence of a file on an SFTP server?

jenkins,sftp
I want to use Jenkins to monitor an SFTP site, and fire off a build when a given file type appears on that site. How can I do this?...

Create a copy of the folder within same remote server with SFTP

scala,sftp,jsch
I am using JSch API to connect to remote server through SFTP. I need to get a copy of a folder which is exist in the remote server into the same server. Is there any method implemented to do this kind of things in JSch? Or be kind to give...

Passing in batch file with parameters as parameter in sftp command

batch-file,parameters,command,sftp
I am attempting to automate a upload/download from a sftp depot. The password is piped into the sftp command. I want the batch to execute as follows: batch1.bat: @ECHO OFF SET usernameHost=%1 SET password=%2 SET inputLoc=%3 SET outputLoc=%4 (echo %2) | sftp -b (batch2.bat %3 %4) %1 A batch2.bat will...

download file with curl via sftp

php,curl,sftp
This only creates an empty file.. No content in the file $host = 'domain.com'; $pass = 'xxx'; $remote = 'sftp://var/www/test.txt'; $local = 'C:\wamp\www\test.txt'; $curl = curl_init(); $file = fopen($local, 'w'); curl_setopt($curl, CURLOPT_URL, $remote); curl_setopt($curl, CURLOPT_PROTOCOLS, CURLPROTO_SFTP); curl_setopt($curl, CURLOPT_USERPWD, "root:$pass"); curl_setopt($curl, CURLOPT_FILE, $file); curl_exec($curl); curl_close($curl); fclose($file); solution $host = 'domain.com'; $pass...

Can I negatively close a SFTP file transfer from the client side?

sftp,ibm-sterling
I am interacting with a SFTP server that deletes files once they are downloaded. To prevent data loss, I need to read the file, land it on persistent storage and then close the connection to indicate I have received it. What's not obvious to me is what happens if I...

Is this safe to share private key in JCraft JSch

java,sftp,jsch
In JCraft based SFTP communication is established using JSch library for my project. It works well but my doubt is why we have to share the private key like below? JSch jsch=new JSch(); jsch.addIdentity(ex. ~/.ssh/id_dsa); I knew when communication happens, the client has to produce public key, but here we...

Transfer a large file/directory with SFTP via an intermediate SSH server

ssh,sftp
I want to transfer some data from another site. They have a SSH server through which I connect to that site. Once connected, I use a SFTP command to an internal machine (which I cannot access directly from my machine) and get the data. I now want to transfer a...

Downloading file matching pattern using phpseclib

php,filenames,sftp,phpseclib
I am trying to download a file from a SFTP server. I have managed to connect to it and download the files. The problem is that the file in the server will be updated daily and part of the filename is the exact time when it is generated which is...

Ruby Net::SFTP upload hangs

ruby,ftp,sftp,net-sftp
I am using the net-sftp gem to upload a file to an ftp server. Here's my code: require "net/sftp" Net::SFTP.start(url, username, password: password) do |sftp| sftp.upload!(file_path, "/") end It just hangs at the upload line, and eventually times out with the error Net::SSH::Disconnect: connection closed by remote host. I am...

how to use emacs tramp with ssh remote to server

emacs,sftp,freebsd
I want use emacs remote server(freebsd use sftp with ssh). I already read this and write (require 'tramp) (setq tramp-default-method "ssh") in my .emacs. I use C-c C-f RET /sftp:[email protected]/. But it does not work

Pygtk mount file through sftp without username and password dialog?

gtk,sftp,pygtk
I am trying to mount a directory via sftp in pygtk. Since I already have the username and password stored in variables, I don't want to get a dialog box asking for the username and password. I am using the following code: def error_printer(o,r) try: o.mount_enclosing_volume_finish(r) except gio.Error, e: print...

JSch SFTP security with session.setConfig(“StrictHostKeyChecking”, “no”);

sftp,jsch,public-key,key-pair
I use JSch with private key to FTP file jsch.addIdentity(privatekeyfile); Session session = jsch.getSession( "user", "domain.com" ,22); session.setConfig("StrictHostKeyChecking", "no"); Line 3 is in question. Without this line, JSch does not work. My question is: Will line 3 make SFTP transfer insecure?...

What does -2 do when using psftp.exe?

sftp,putty
I've just come across this line of code in a .bat file: psftp -2 -l XXXXX 195.2.37.69 -pw XXXXX -P 10022 -b c:\sftp\sendfile.bat -v -bc -be The help tells me what all the parameters do except for the -2. Can anybody tell me what the -2 does?...

python script that connects with vsftpd

python,ftp,sftp,paramiko
I have the following issue... i need to connect to sftp(vsftpd) through python script, upload a file and download it. So far i have created ftp server with vsftpd but i cannot connect. If i use the terminal(ftp localhost) i can log in without any problems. Please advise how i...

Cannot create bean when start the application

java,spring,javabeans,sftp,job-scheduling
I am facing some issue while creating the bean it gives error. Can someone please assist me. I will retrieve the files from sftp resource and will read those file with a spring task scheduler job. App-Config.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:task="http://www.springframework.org/schema/task"...

Load/save documents to SFTP Linux server with VB.NET

linux,vb.net,sftp,winscp-net
So I am using Visual Studio 2013 (Community) And so far I've build a program that can create files using textboxes and so forth. It saves to XML, and hopefully reads from XML (Even if I am getting access denied) The time has come for the Application to talk to...

Moving files only if matching file exists

c#,file-io,sftp
I have an application that requires two files to process data. A zip file containing the actual data then a control file that says what to do with said data. These files are downloaded via sftp to a staging directory. Once the zip file is complete, I need to check...

Use of sftp with shell_exec php

php,passwords,sftp,shell-exec
I'm trying to get a file from a remote host but it asks me the password and the script is supposed to run without me to type the password. How can I send the password? I have to use shell_exec. <?php $command="sftp [email protected] adress"; shell_exec($command); ?> ...

How to downlad only the latest file from SFTP server with Paramiko?

python,sftp,paramiko
I want to write script that connects to my university SFTP server and downloads the latest file with exercises. So far I've changed a little bit the code from Paramiko example but I do not know how to download the latest file. Here is my code : import functools import...

WindowsError when using os.listdir and os.stat of the result

python,windows,sftp
I have the following snippet of code that just gets the Timestamp of the file. files_list = os.listdir(os.path.join(path, folder)) for files in files_list: stats = os.stat(os.path.join(path, folder, files)) Is it possible for me to ever get the below error as it seems counter intuitive that it is not able to...

How to download file from Sftp server to local machine

php,sftp,phpseclib
I have to download file from Sftp server to local machine. I am creating a connection by using the phpseclib. It is connected with Sftp server. But I have to download a file from server to local machine. How can i do that. I am using this code to download...

JSch Algorithm negotiation fail

java,connection,sftp,jsch
I try to connect SFTP server by Java. I got an error. com.jcraft.jsch.JSchException: Algorithm negotiation fail Here is the POM: <dependency> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> <version>0.1.53</version> </dependency> Here is the log: INFO: Connecting to **"FTP ADRESS"** port 22 INFO: Connection established INFO: Remote version string: SSH-2.0-Maverick_SSHD INFO: Local version string: SSH-2.0-JSCH-0.1.53 INFO:...

Java SFTP specify absolute path

java,sftp,apache-commons-vfs
I have used this code for SFTP Java Upload package com.as400samplecode; import java.io.File; import java.io.FileInputStream; import java.util.Properties; import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileSystemOptions; import org.apache.commons.vfs2.Selectors; import org.apache.commons.vfs2.impl.StandardFileSystemManager; import org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder; public class SendMyFiles { static Properties props; public static void main(String[] args) { SendMyFiles...

How to confirm sftp file delivery?

linux,unix,ssh,sftp
I am sending a file using sftp and public key for non-root user, looks like the file is sent, but I cant find it on the target folder, maybe due to permission. sftp> ls sftp> put /tmp/testx Uploading /tmp/testx to /folder1/target_folder /tmp/testx 100% 5 0.0KB/s 00:01 sftp> get testx Couldn't...

FoundationPress Couldn't delete file: Failure in sftp

php,wordpress,ssh,zurb-foundation,sftp
So I've began doing development for a WP site and have started doing the development on my local machine and then transferring my work over through a sftp to a separate server. For the theme development I tried using FoundationPress for the front-end framework for creating a theme. I worked...

Download website over sftp/ftp in Jenkins

jenkins,sftp
In Jenkins I I would like to have a job that does a one-way sync of a sftp folder with a local folder. The online sftp server content should be downloaded to my local development machine. What is the best way to do this in Jenkins?

Uploading a file via website to SFTP server

sftp,file-transfer
I'm building a website. I have the SFTP login credentials for the server. I'm trying to make it so that a user can select a file on their hard-drive, and upload the file to a remote computer through SFTP. Is this possible? How would I do this?...

FTP Proxy Information not reflected for SFTP connection in Webdrive

sockets,proxy,webclient,sftp,webdav
I am using Webdrive version 9.12. I am trying to connect to a system with SFTP connection type and it requires Proxy information to connect without errors. I gave the proxy information in File -> Program Settings -> Proxy FTP with Proxy type as SOCKS v5. But still i am...

Equivalent settings between WinSCP and FileZilla on Tunnel [closed]

ftp,sftp,scp,filezilla,winscp
I am running Ubuntu 14.04LTS and have FileZilla 3.7.3 installed, I also have a VM running WIN7 with WinSCP 5.5.1. Under WIN7 when using WinSCP, in the editing dialog under the advanced tab there is a category “Connection” with two options, Proxy and Tunnel . The server I need to...

Veryfing fingerprints using SharpSSH while connecting to SFTP Server

ssh,sftp,public-key,sharpssh,rsa-key-fingerprint
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...

Writing path for sftp server python

python,sftp,pysftp
I am using pysftp on Python and am trying to run a loop for a certain directory in the sftp server. I don't know how to write the directory paths on sftp servers. I thought that connecting to the server and just writing the directory as below would work, but...

'No such file' using Tamir.SharpSSH to download file via sftp

c#,asp.net,ftp,sftp
I'm getting error on sftp.GetFileList(ftpHost) with message "No such file". Using the given ip and credentials I've tested they have permissions to all the directories I'm connecting to. string FileName = Label6.Text; string rootPath = Server.MapPath("~"); string FolderName = "\\DL" + DateTime.Now.ToString("yyyyMMddHHmmss"); System.IO.Directory.CreateDirectory(rootPath + FolderName); string rootPath1 = rootPath +...

How to distinguish a directory in SFTP listing retrieved using SharpSSH?

c#,sftp,sharpssh
I need to recursively download files from the server to SFTP by SharpSsh. But I do not understand how to determine that the file name or the directory. Now I do so static void recDir(string remotePath, string localPath) { Sftp _c = this.sftp; ArrayList FileList = _c.GetFileList(remotePath); FileList.Remove("."); FileList.Remove(".."); for...

SFTP inbound channel adapter hangs at PollableChannel receive method

java,spring,sftp,spring-integration
My context xml reads as follows: <bean id="defaultSftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory"> <property name="host" value="${host}"/> <property name="password" value="${password}"/> <property name="port" value="${port}"/> <property name="user" value="${username}"/> </bean> <int-sftp:inbound-channel-adapter id="sftpInbondAdapter" session-factory="sftpSessionFactory" channel="receiveChannel" filename-pattern="*.txt"...

SFTP - JSch rename file being dowloaded

java,sftp,jsch
I am trying to develop a program that is to retrieve a set of files from an SFTP server to another local directory. I use JSch library for this. The files are downloaded with the get method. ChannelSftp connection = connect(host, port, user, password); connection.get(fileName, localFolder, null, mode); The business...

Automatically upload newly created files to an SFTP server

c#,asp.net,iis,sftp,windows-server
An ASP.NET application (running on Windows server/IIS 7) has to transfer big size files uploaded by current user to an external SFTP server. Due to the file size the idea is to do this asynchronously. The idea is that the ASP.NET application stores the uploaded file on a local directory...

Sublime Text SFTP with SecurID authentication

sublimetext2,sftp,sublimetext3
Sublime Text's SFTP works perfect with my work flow. I develop on my local computer, compile it on remote host mapped using sublime SFTP. However, the new machine I'm working on uses SecurID for identification and Sublime's SFTP fails to connect. How do I solve this problem?...

Does JSch allow to understand that I provided wrong credentials?

java,sftp,jsch,ftps
I am novice with JSch library. I need to validate login credentials. How can I make it? connect and check response code? P.S. I cannot find information in doc....

SharpSSH jSCH Algorithm negotiation fail

ssh,sftp,sharpssh
I use SharpSSH .NET library for SFTP. http://www.tamirgal.com/blog/page/sharpssh.aspx When I try to connect the server I get an error Algorithm negotiation fail But when try to connect by FileZilla it works with no problems. I find some with the same error but I do not find how to resolve this...

Check if file exists using Apache Commons VFS2

java,file,sftp,apache-commons-vfs
I would like to ask if there is a way how to check if file already exists in the folder using only Apache Commons. I have method which uploads into the SFTP folder but it overwrites current files anytime the method is running. The method is set to run every...

Upload multiple photos to SFTP in Async

android,multithreading,android-asynctask,ftp,sftp
I want to upload multiple photos to SFTP server but with the following code only one photo is uploaded. Please anybody has any idea where I m getting wrong or have a better approach for this private class uploadFileOnFTPServerAsync extends AsyncTask<Void, Void, Void> { ProgressDialog pdDialog; @Override protected void onPreExecute()...

How to move file from directory A to directory B in remote server?

java,sftp,jsch
I am using JSch to connect to SFTP in a website which is made from GWT. I had read a little example of sftpChannel.get(), sftpChannel.rename(), sftpChannel.rm() But I didn't find a solution that copy a file from remote server a directory to remote server b directory. For example, I want...