sftp

Ubuntu 18.04安装SFTP服务

僤鯓⒐⒋嵵緔 提交于 2019-12-20 17:17:00
1.安装sftp服务 sudo apt-get install openssh-server 2.修改配置文件 vim /etc/ssh/sshd_config ##下面这行注释掉 #Subsystem sftp /usr/libexec/openssh/sftp-server ##后面加入 Subsystem sftp internal-sftp 找到PermitRootLogin no一行,改为PermitRootLogin yes 让root用户可以登录SFTP 3.重启sshd服务 service ssh restart 来源: CSDN 作者: pegasusliuyong 链接: https://blog.csdn.net/pegasusliuyong/article/details/103629793

How do configure Coda to work for my Amazon EC2 instance?

戏子无情 提交于 2019-12-20 15:13:24
问题 I can not connect to my EC2 instane. I have opened port 21 in the AWS Console. I think there is no way of input my SSH Key pair in Coda. Is there a way of connecting Coda to my EC2 instance? 回答1: Coda should pick up settings from your ssh config so you can configure this fairly easily. If you've saved your EC2 ssh keypair in ~/.ssh/ec2_rsa then simply edit ~/.ssh/config to look like: IdentityFile ~/.ssh/ec2_rsa You can also restrict the IdentityFile directive to just your AWS resource with:

inputstream is closed error while uploading zip file through jsch to sftp site

心不动则不痛 提交于 2019-12-20 06:32:23
问题 While uploading a zip file to SFTP, we are getting the below error. The same code is working fine for another application. We are using jsch-0.1.44.jar for SFTP connection. java.io.IOException: inputstream is closed at com.jcraft.jsch.ChannelSftp._put(ChannelSftp.java:571) at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:431) at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:398) aused by: java.io.IOException: inputstream is closed at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java

Unix sftp - mput command - transfer all files with a specific prefix

限于喜欢 提交于 2019-12-19 11:41:14
问题 I have bunch of files in a directory. But I would like to transfer to SFTP server only files starting with either ABC or XYZ . How do I filter these in my mput command? 回答1: If your files all in current directory: sftp user@server << EOF cd /destination $(for i in ABC* XYZ*; do echo "put $i"; done) EOF Output (example): Connected to server. sftp> cd /destination sftp> put ABCfoo.txt Uploading ABCfoo.txt to /destination/ABCfoo.txt ABCfoo.txt 100% 0 0.0KB/s 00:00 sftp> put XYZfoo.txt Uploading

Renci.SshNet : “server response does not contain ssh protocol identification”

和自甴很熟 提交于 2019-12-19 10:28:03
问题 I'm working with the Renci SSH.Net library on a WPF application and I'm having an issue with using the SFTP client. When the user tries to connect to download some files from the SFTP server he gets the message shown below: Server response does not contain ssh protocol identification It doesn't appear to be something specific with the server as I'm able to connect and download the files just fine on my development desktop and a secondary laptop. The same application is able to connect over

Reading end of huge and dynamic file via SFTP from server

最后都变了- 提交于 2019-12-19 10:09:00
问题 I am trying to find a way to read just end of huge and dynamic log file (like 20-30 lines from end) via SFTP from server and to save the point until where I read, and if I need more lines, to read more from this point upper. Everything I've tried takes too long time, I've tried to copy this file on machine and after this to read from end using ReversedLinesFileReader because this method need the File object, when via SFTP you will get only InputStream , takes a lot to download file. Also

paramiko.SSHException: Error reading SSH protocol banner

佐手、 提交于 2019-12-19 05:58:31
问题 I am using Paramiko and trying to connect to my SFTP server. Here is the code I wrote: class SFTPUploader: def __init__(self, host, username, password, port): transport = paramiko.Transport((host, port)) print transport transport.connect(username = username, password = password) self.sftp = paramiko.SFTPClient.from_transport(transport) I can connect to my server from the terminal. This thread didn't help since our scenario is different. 回答1: That error is generated when paramiko doesn't

Copying a file in sftp with jsch library

巧了我就是萌 提交于 2019-12-19 05:48:30
问题 import com.jcraft.jsch.*; public class App { public static void main(String args[]) { JSch jsch = new JSch(); Session session = null; try { session = jsch.getSession("Username", "Host", PORT NO); session.setConfig("StrictHostKeyChecking", "no"); session.setPassword("Password"); session.connect(); Channel channel = session.openChannel("sftp"); channel.connect(); ChannelSftp sftpChannel = (ChannelSftp) channel; sftpChannel.get("remotefile.txt", "localfile.txt"); sftpChannel.exit(); session

Copying a file in sftp with jsch library

◇◆丶佛笑我妖孽 提交于 2019-12-19 05:48:05
问题 import com.jcraft.jsch.*; public class App { public static void main(String args[]) { JSch jsch = new JSch(); Session session = null; try { session = jsch.getSession("Username", "Host", PORT NO); session.setConfig("StrictHostKeyChecking", "no"); session.setPassword("Password"); session.connect(); Channel channel = session.openChannel("sftp"); channel.connect(); ChannelSftp sftpChannel = (ChannelSftp) channel; sftpChannel.get("remotefile.txt", "localfile.txt"); sftpChannel.exit(); session

How do I copy or move remote files with phpseclib?

允我心安 提交于 2019-12-19 04:45:13
问题 I've just discovered phpseclib for myself and would like to use it for my bit of code. Somehow I can't find out how I could copy files from one sftp directory into an other sftp directory. Would be great if you could help me out with this. e.g.: copy all files of /jn/xml/ to /jn/xml/backup/ 回答1: $dir = "/jn/xml/"; $files = $sftp->nlist($dir, true); foreach($files as $file) { if ($file == '.' || $file == '..') continue; $sftp->put($dir."backup".'/'.$file, $sftp->get($dir.'/'.$file); } This