sftp

How do I pipe the output of an LS on remote server to the local filesystem via SFTP?

南笙酒味 提交于 2020-01-03 16:57:47
问题 I'm logged into a remote server via SFTP at the command line. The folder I'm in contains hundreds of thousands of files. I need to get a list of these files in a text file so I can access them programmatically, as none of the PHP SFTP clients are able to return such a large list of files. When I run an ls on the directory ( within the SFTP session ), it takes about 20 minutes for the file list to finally display. I don't have write access on this server, so I can't pipe the output to a file

Spring Integration SFTP Example with Spring Boot

拟墨画扇 提交于 2020-01-03 15:35:50
问题 We are using the latest Spring Boot for a Spring app and using the latest Spring Integration for SFTP. I've been to the Spring Integration SFTP documentation site, and I took the Spring Boot Configuration as is: @Bean public SessionFactory<LsEntry> sftpSessionFactory() { DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory(true); factory.setHost("localhost"); factory.setPort(port); factory.setUser("foo"); factory.setPassword("foo"); factory.setAllowUnknownKeys(true); return new

Ant scp task: JSchException: invalid privatekey [duplicate]

徘徊边缘 提交于 2020-01-03 07:03:05
问题 This question already has answers here : “Invalid privatekey” when using JSch (3 answers) Closed 10 months ago . I created a new key pair using ssh-keygen and added the public key on the server. Using sftp -i private_key_file user@server I can successfully open a connection to the server and put files. However, when I try to use the Ant scp task I receive: com.jcraft.jsch.JSchException: invalid privatekey: [B@5e9d5728 The relevant part of the Ant script: <scp file="local-file.zip" trust="true

WinSCP command line - Too many parameters for command 'open' when using -rawtransfersettings switch

和自甴很熟 提交于 2020-01-03 02:23:11
问题 I am getting "Too many parameters for command 'open'." error when trying to connect to a server for below command, option confirm off open sftp://uname:pwd@abc.example.com/ -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx" -timeout=60 -rawsettings SendBuf=0 SshSimple=1 -rawtransfersettings IgnorePermErrors=0 PreserveTimeDirs=0 I have checked lot of other posts mentioning the use of Double-Quotes for text having space and I think my above script is complaint with that. If I remove the last set of

Perl SFTP password authentication issues using Net::SFTP::Foreign. Pyt error. permission deny

点点圈 提交于 2020-01-02 21:02:54
问题 I'm using Net::FTP::Foreign with password authentication. and I get error about pty and permission error. firstly, cannot connect to pty slave. secondly, Foreign seems not use password authentication mode. IO:Pty is installed. the machine is solaris. Code: my %args = (password => 'pwd', user => 'usr', port => 22, more => '-v'); log->info("Starting SFTP...\n"); my $sftp = Net::SFTP::Foreign->new($O->{sftp_server}, %args); is there any wrong with my script or any configuration issue on my

File download from SFTP server on ASP.NET page

一笑奈何 提交于 2020-01-02 20:08:42
问题 I have SFTP server on Ubuntu 16.04 and a site with REST API on ASP Core 2.0. The problem is that I want to provide a straight link to a file on the server, but I don't know how to do it. I suppose it has to be done by API, but what the way? I can download the file by API and give it to the user, but there will be twice time (for download by API from the server and by user from API). And I saw on some sites a link to the file with some access token. May be I should use this way? Any ideas? 回答1

Issue Connection to server using Remote-FTP atom package and Private Keys

安稳与你 提交于 2020-01-02 15:01:08
问题 I'm trying to connect to my server using the atom package "Remote-FTP" and using a private key. I have the SSH keys set up on my server and can connect successfully using putty. The private key is saved in my project folder and I have an existing .ftpconfig file (without a private key) that connects successfully when I replace the information inside the file. The Key has been converted to the necessary ssh format and I have no passphrase at the moment. I have also gave the full path of the

Downloading a directory using SSH.NET SFTP in C#

大憨熊 提交于 2020-01-02 08:56:51
问题 I am using Renci.SSH and C# to connect to my Unix server from a Windows machine. My code works as expected when the directory contents are only files, but if the directory contains a folder, I get this Renci.SshNet.Common.SshException: 'Failure' This is my code, how can I update this to also download a directory (if exists) private static void DownloadFile(string arc, string username, string password) { string fullpath; string fp; var options = new ProgressBarOptions { ProgressCharacter = '.'

Python SFTP download files older than x and delete networked storage

邮差的信 提交于 2020-01-02 07:46:51
问题 I'd like to download some files via sftp that are older than say 2 hours. Then I'd like to delete them from the network site. I can use the following code for sftp but handling objects on the remote machine is giving me problems. The code below fails at the 'timestamp = os.stat" line I believe it is an os module issue? import paramiko, sys, os,time host = 'ftp address' port = 22 transport = paramiko.Transport((host, port)) password = "pass" #hard-coded username = "user" #hard-coded transport

java.io.IOException - End of IO Stream Read

大兔子大兔子 提交于 2020-01-02 02:39:06
问题 Code seems to break at session.connect . com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: End of IO Stream Read Stacktrace com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: End of IO Stream Read at com.jcraft.jsch.Session.connect(Session.java:534) at com.jcraft.jsch.Session.connect(Session.java:162) at session.connect in uploadFile(ftpService.java:280) Code try { JSch jsch = new JSch(); Session session = null; session = jsch.getSession(ftpUserName,