sftp

How to enter a remote directory on Ruby NET:SFTP?

半城伤御伤魂 提交于 2019-12-24 07:47:36
问题 How to enter a directory like the command - cd, thus operate remote files without a path prefix ? Here is my current code. Net::SFTP.start do |sftp| sftp.rename!(REMOTE_PATH + "latest.zip", REMOTE_PATH + "latest.back.zip") sftp.upload!("latest.zip", REMOTE_PATH + "latest.zip") end I would like to have: sftp.cd REMOTE_PATH sftp.rename!("latest.zip", "latest.back.zip") sftp.upload!("latest.zip", "latest.zip") 回答1: I found a solution, which is use the SSH connect instead. . Not works. SFTP path

SFTP using Expect

房东的猫 提交于 2019-12-24 07:21:00
问题 I have tried the script below to SFTP using bash script. But it does not work. Always error at password. /usr/local/bin/expect <<EOF spawn sftp PG1@dev1.dummy.com expect "Password:" send "abc123\r" expect "sftp>" send "cd /tmp\r" send "get Data.dat\r" send "get List.dat\r" send "bye\r" EOF Here's the log file when I run the script above, after taking in all the suggestions from responders. ######### StartJob ######### Sun Apr 19 09:59:08 MYT 2015 spawn sftp PG1@dev1.dummy.com^M Connecting to

SFTP using Expect

大憨熊 提交于 2019-12-24 07:20:04
问题 I have tried the script below to SFTP using bash script. But it does not work. Always error at password. /usr/local/bin/expect <<EOF spawn sftp PG1@dev1.dummy.com expect "Password:" send "abc123\r" expect "sftp>" send "cd /tmp\r" send "get Data.dat\r" send "get List.dat\r" send "bye\r" EOF Here's the log file when I run the script above, after taking in all the suggestions from responders. ######### StartJob ######### Sun Apr 19 09:59:08 MYT 2015 spawn sftp PG1@dev1.dummy.com^M Connecting to

Copy files from SFTP Server to Blob Storage with Logic App

一个人想着一个人 提交于 2019-12-24 06:55:32
问题 I want to copy files from an SFTP server to an blob storage by using a logic app. The logic app is triggered by a "recurrence" block every 3 minutes and checks which files are on the server in order to copy them. To check which files are on the server I use the "list files in folder" block. The copying itself is performed by a pipeline run. This works fine so far, but I'm facing one problem. In case one file is still in the uploading process on the sftp server during the logic app is

Copy files from SFTP Server to Blob Storage with Logic App

放肆的年华 提交于 2019-12-24 06:53:07
问题 I want to copy files from an SFTP server to an blob storage by using a logic app. The logic app is triggered by a "recurrence" block every 3 minutes and checks which files are on the server in order to copy them. To check which files are on the server I use the "list files in folder" block. The copying itself is performed by a pipeline run. This works fine so far, but I'm facing one problem. In case one file is still in the uploading process on the sftp server during the logic app is

Implementing SFTP in 2.0

橙三吉。 提交于 2019-12-24 03:55:16
问题 I want to write SFTP clients and servers in .NET 2.0. Is that possible? Please give me some suggestions 回答1: Take a look at SharpSSH. It has an open source BSD-style license and supports SCP and SFTP. 回答2: The .NET Framework 2.0 does not include any support for SSH/SFTP. You probably have to try one of third party solutions. Our Rebex SFTP for .NET can be worth checking. Check the samples and tutorials to see if it fits your needs. 回答3: If you want a commercial package, take a look at

Read a file from the another location using JSch

一世执手 提交于 2019-12-24 01:53:13
问题 Here is my code to read a file from the another location using JSch import com.jcraft.jsch.*; import java.io.BufferedReader; import java.io.*; import java.util.Vector; public class SftpClient { public static void main(String args[]) { JSch jsch = new JSch(); Session session = null; FileReader reader =null; BufferedReader buffer = null; try { . session = jsch.getSession("userName", "Ip Address"); java.util.Properties config = new java.util.Properties(); config.put("StrictHostKeyChecking", "no"

Secure FTP Connection using PHP

穿精又带淫゛_ 提交于 2019-12-23 22:42:43
问题 I have an secure FTP Server with the login details and from PHP, am trying to connect to that secure FTP Server using ftp_ssl_connect/ftp_connect and ftp_login function and passing all the parameters properly to the function but I am amazed to see that it does not connect. If I try to connect to that secure FTP Server from command line using ssh than I am able to do so but when I am trying to connect through php code, it does not connect and so I am not sure why this is happening ? Also what

Restricting SFTP user to home directory

血红的双手。 提交于 2019-12-23 22:15:34
问题 I'm trying to set up a client SFTP space on an EC2 ubuntu server, with access restricted to just that user's home directory. There's only about six thousand other threads on this, and I've got most of them open in other tabs. It would appear to be straightforward. I've done: $ sudo groupadd loginsftp $ sudo groupadd loginssh $ sudo adduser sftpuser $ sudo gpasswd -a sftpuser loginsftp $ sudo chown root:root home/sftpuser $ sudo su sftpuser $ groups > sftpuser loginsftp The bottom of my /etc

Laravel Forge + DigitalOcean - Adding a SFTP user with restricted access only to a directory

▼魔方 西西 提交于 2019-12-23 15:23:18
问题 I am using Laravel Forge in a DigitalOcean droplet. I need to grant SFTP access to a specific directory on the server to one of my clients. He needs read/write access to only that directory, and I am having problems with the setup. I have followed the steps in https://bensmann.no/restrict-sftp-users-to-home-folder/, but I am stuck because Forge does not permit password authentication, only through public/private SSH keys... Has someone done something similar? What would be the best approach