- Error: Failure
- Error: Connection closed
- Error: Clicking Upload Changed Files does not work
- ENFILE: file table overflow ...
- How do I upload content inside a folder, but not the folder itself?
- How can I upload files as root?
- Automatically sync both ways without user interaction
- Show dotfiles/hidden files in remote explorer
The failure error message comes from the remote side and is more or less the default/generic error message that sftp server sends when a syscall fails or something similar happens. To know what exactly is going wrong you could try to enable debug output for the sftp server and then execute your transfers again and see what (if anything) shows up in the logs there.
Change remotePath
to the actual path if it's a symlink.
The problem could be that your server runs out of file descriptors. You should try to increase the file descriptors limit. If you don't have the permission to do this, set limitOpenFilesOnRemote option in your config.
The problem could be that the SFTP extension keeps closing the connection for those who use more legacy/old systems.
You'll have to Explicitly override the default transport layer algorithms used for the connection to remove the new "diffie-hellman-group-exchange-sha256"
algorithm that cause the problem from the kex
section. Just add this in your sftp.json
configuration file, which should make it work.
{
"algorithms": {
"kex": [
"ecdh-sha2-nistp256",
"ecdh-sha2-nistp384",
"ecdh-sha2-nistp521"
],
"cipher": [
"aes128-gcm",
"aes128-gcm@openssh.com",
"aes256-gcm",
"aes256-gcm@openssh.com",
"aes128-cbc",
"aes192-cbc",
"aes256-cbc",
"aes128-ctr",
"aes192-ctr",
"aes256-ctr"
],
"serverHostKey": [
"ssh-rsa",
"ssh-dss",
"ssh-ed25519",
"ecdsa-sha2-nistp256",
"ecdsa-sha2-nistp384",
"ecdsa-sha2-nistp521",
"rsa-sha2-256",
"rsa-sha2-512"
],
"hmac": [
"hmac-sha2-256",
"hmac-sha2-512"
]
}
}
@PaPa31 added a fix to make the 'Upload Changed Files' command visible and added a default keyboard shortcut to call it.
MacOS have a harsh limit on number of open files.
Run those command:
echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536
ulimit -n 65536
As quoted from raoul2000, "as long as you set the context
property to ./[path]
(e.g., ./build
), it
will work."
Example configuration (where all JS and HTML files in ./build
will be copied to /folder1/folder2/folder3
):
{
"name": "My Server",
"host": "<host_ip_address>",
"protocol": "sftp",
"port": 22,
"username": "user1",
"remotePath": "/folder1/folder2/folder3",
"context": "./build",
"uploadOnSave": false,
"watcher": {
"files": "*.{js,html}",
"autoUpload": true,
"autoDelete": false
}
}
Yevhen-development has a workaround, but it may not work for everyone. In sftp.json
, set the
following:
"sshCustomParams": "sudo su -;"
This can also be used with GIT this way when you're checking out a branch or reverting changes/commits, your server will also be updated.
{
"name": "My Server",
"host": "<host_ip_address>",
"protocol": "sftp",
"port": 22,
"username": "user1",
"remotePath": "/folder1/folder2/folder3",
"uploadOnSave": false, // Set to false if watcher `autoUpload` is set to true & `files` is set to "**/*".
"watcher": {
"files": "**/*",
"autoUpload": true,
"autoDelete": true
}
"syncOption": {
"delete": true // Delete extraneous files from destination directories.
},
}
Show dotfiles/hidden files in remote explorer
Please edit the config file proftpd.conf
. Depending on your installation, the default location for this file can be one of those :
/etc/proftpd.conf
/etc/proftpd/proftpd.conf
/usr/local/etc/proftpd.conf
/usr/local/etc/proftpd/proftpd.conf
Search for the ListOptions
parameter and change it from "-l"
to "-la"
.
It should look like this :
#Global settings
<Global>
[...]
ListOptions "-la"
[...]
</Global>