Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

target_sftp

Marcel Kloubert edited this page Mar 4, 2018 · 28 revisions

Home >> Targets >> sftp

SFTP

Deploys to a SFTP server.

{
    "deploy.reloaded": {
        "targets": [
            {
                "type": "sftp",
                "name": "My SFTP folder",
                "description": "A SFTP folder",

                "dir": "/my_package_files",
                "host": "localhost",
                "user": "tester", "password": "password"
            }
        ]
    }
}
Name Description
agent* Name or path to ssh-agent for ssh-agent-based user authentication. s. ssh2 module
agentForward Set to (true) to use OpenSSH agent forwarding (auth-agent@openssh.com) for the life of the connection. agent property must also be set to use this feature. Default: (false)
dir* The remote directory on the server. Default: /
debug Activate logging for ssh2-sftp-client module and write those logs to .vscode-deploy-reloaded/.logs sub folder inside the user's home directory. Default: (false)
hashAlgorithm* The algorithm to use to verify the fingerprint of a host. Default: md5
hashes The optional list of one or more fingerprints, that are used to verify the host. If not defined any host will be accepted.
host* The host address of the server. Default: 127.0.0.1
modes Defines the chmod access permission value for the targets files on server. s. Modes for specific files.
password The password.
port* The TCP port of the server. Default: 22
privateKey* The path to the private key file, if authentification should be done via SSH key. Relative paths will be mapped to your home directory (.vscode-deploy-reloaded sub folder) or the .vscode folder.
privateKeyPassphrase The passphrase for the key file, if needed.
readyTimeout* How long (in milliseconds) to wait for the SSH handshake to complete. Default 20000
tryKeyboard Try keyboard-interactive user authentication if primary user authentication method fails. Default: (false)
user Username. Default: anonymous

* supports placeholders

Modes for specific files

All values are octal!

{
    "deploy.reloaded": {
        "targets": [
            {
                "name:": "MY_SFTP1",
                "type": "sftp",

                "modes": {
                    "/**/*.php": 666,
                    "/**/*.txt": 777,
                }
            },

            {
                "name:": "MY_SFTP2",
                "type": "sftp",

                "modes": 777
            }
        ]
    }
}

Examples

Using key file

{
    "deploy.reloaded": {
        "targets": [
            {
                "type": "sftp",
                "name": "My SFTP folder",
                "description": "SFTP target with key file",

                "dir": "/my_package_files",
                "host": "localhost",

                "user": "mkloubert",
                "privateKey": "/.ssh/id_rsa"
            }
        ]
    }
}
Clone this wiki locally