Questions tagged [sftp]

GENERAL SFTP SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com. SSH File Transfer Protocol, a network protocol designed to provide secure file transfer and manipulation facilities over SSH (Secure Shell protocol).

The SSH File Transfer Protocol (also Secret File Transfer Protocol, Secure FTP, or SFTP) is a network protocol that provides file access, file transfer, and file management functionality over any reliable data stream. It was designed by the Internet Engineering Task Force (IETF) as an extension of the Secure Shell protocol (SSH) version 2.0 to provide secure file transfer capability, but is also intended to be usable with other protocols. The IETF of the Internet Draft states that even though this protocol is described in the context of the SSH-2 protocol, it could be used in a number of different applications, such as secure file transfer over Transport Layer Security (TLS) and transfer of management information in VPN applications.

This protocol assumes that it is run over a secure channel, such as SSH, that the server has already authenticated the client, and that the identity of the client user is available to the protocol.

This should not be confused with FTPS. For questions regarding FTPS, see the corresponding tag .

5135 questions
41
votes
3 answers

Permissions for /var/www/html

I have a virtual CentOS server with GoDaddy, and I'm having trouble setting up the permissions for /var/www/html. Users are not allowed to log in as root, or even add themselves to the root group, so here's the corner I've painted myself into: I…
dicaeopolis
  • 429
  • 1
  • 4
  • 4
39
votes
5 answers

Error: No such file (sftp liximomo extension)

I have this problem when I upload a file on the server using the extension liximomo/vscode-sftp for visual studio code. [error] Error: No such file at SFTPStream._transform at SFTPStream.Transform._read at SFTPStream._read How I…
Michele Cerruto
  • 414
  • 1
  • 5
  • 10
39
votes
14 answers

Directory transfers with Paramiko

How do you use Paramiko to transfer complete directories? I'm trying to use: sftp.put("/Folder1","/Folder2") which is giving me this error - Error : [Errno 21] Is a directory
fixxxer
  • 15,568
  • 15
  • 58
  • 76
39
votes
9 answers

Are there any good free .Net network libraries? (FTP, SFTP, SSH, etc.)

I'm a bit surprised I haven't found a good open source library for performing common network tasks. There are a few very good commercial libraries, but they're too expensive to use on an open source project. Anyone know of any?
Kilhoffer
  • 32,375
  • 22
  • 97
  • 124
37
votes
7 answers

Upload files using SFTP in Python, but create directories if path doesn't exist

I want to upload a file on a remote server with Python. I'd like to check beforehand if the remote path is really existing, and if it isn't, to create it. In pseudocode: if(remote_path not exist): create_path(remote_path) upload_file(local_file,…
franzlorenzon
  • 5,845
  • 6
  • 36
  • 58
36
votes
3 answers

"Renci.SshNet.Common.SshException: Invalid private key file" when loading SSH private key from configuration string using SSH.NET

I'm trying to send a file to some server using SFTP. During this process I'm getting the exception Renci.SshNet.Common.SshException: Invalid private key file. at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase) Generated the…
Konduri Vikram
  • 360
  • 1
  • 3
  • 9
34
votes
4 answers

Unable to upload a file SFTP using SSH.NET in C# - Permission Denied

I am trying to upload a file using SFTP protocol using C# using SSH.NET library. Below is the code I am using FileInfo f=new FileInfo("C:\\mdu\\abcd.xml"); string uploadfile=f.FullName; …
Timothy Rajan
  • 1,947
  • 8
  • 38
  • 62
34
votes
5 answers

Linux shell to restrict sftp users to their home directories?

I need to give SFTP access to a directory within my webroot on my server. I've set up ben_files as a user and have set his home directory to /var/www/vhosts/mydomain.example/files That's all fine if he connects with plain old FTP - he's restricted…
MrFidge
  • 2,107
  • 11
  • 40
  • 63
33
votes
2 answers

'put' in SFTP using Paramiko

I've installed and written the following Paramiko which is unable to put the file. It is easily able to 'get' a file and execute ls commands on it. #set username & password username='runaway' password='runaway' port=22 source= '/Unzip.sh'…
fixxxer
  • 15,568
  • 15
  • 58
  • 76
32
votes
3 answers

Best Method to SFTP or FTPS Files via SSIS

This question originally asked which is the best method for uploading files via SFTP or FTPS in SSIS. It now just lists the pros and cons of each solution. I personally use CozyRoc's SFTP library these days, but I've used each of the below…
Registered User
  • 8,357
  • 8
  • 49
  • 65
32
votes
14 answers

Use subprocess to send a password

I'm attempting to use the python subprocess module to log in to a secure ftp site and then grab a file. However I keep getting hung up on just trying to send the password when it is requested. I so far have the following code: from subprocess import…
The Jug
  • 1,105
  • 3
  • 12
  • 26
31
votes
5 answers

Why is 22 the default port number for SFTP?

Why is 22 the default port number for SFTP? Is there any specific reason for this?
trilawney
  • 1,786
  • 6
  • 28
  • 36
30
votes
9 answers

Notepad++ NppFTP plugin fails to connect via SFTP

So, i've been having this problem for a while now. Notepad++ NppFTP plugin fails to connect to server via SFTP with "[SFTP] Error during authentication: Invalid private key file". But the key file is 100% correct and i'm connecting fine with…
Pavel Lint
  • 3,252
  • 1
  • 18
  • 18
30
votes
3 answers

SFTP file transfer using Java JSch

Here is my code, which retrieves content of the file, on the remote server and display as output. package sshexample; import com.jcraft.jsch.*; import java.io.*; public class SSHexample { public static void main(String[] args) { String user…
MAHI
  • 9,263
  • 11
  • 36
  • 47
29
votes
1 answer

pysftp vs. Paramiko

I have a simple requirement to drop a file on an SFTP server. I have found pysftp and Paramiko libraries that seem to allow me to this and developed a simple application using Paramiko but I can't find a proper source that compares the two so I can…
Jorjani
  • 827
  • 1
  • 16
  • 31