![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
gulp-fez-sftp
Advanced tools
使用SFTP(SSH)上传文件到远程服务器
本插件基于
gulp-sftp
修改,修复了在新版gulp4.0-alpha.3
不能使用的问题。
$ npm install --save-dev gulp-fez-sftp
var gulp = require('gulp');
var sftp = require('gulp-fez-sftp');
gulp.task('default', function () {
return gulp.src('src/*')
.pipe(sftp({
host: 'xxx.xxx.xxx.xxx',
user: 'user',
pass: 'password'
}));
});
Required
Type: String
Type: Number
Default: 22
Type: String
Default: 'anonymous'
Type: String
Default: null
If this option is not set, gulp-fez-sftp assumes the user is using private key authentication and will default to using keys at the following locations:
~/.ssh/id_dsa
and /.ssh/id_rsa
If you intend to use anonymous login, use the value '@anonymous'.
Type: String
Default: '/'
The remote path to upload to. If this path does not yet exist, it will be created, as well as the child directories that house your files.
Type: String
Default: 'unix'
The remote platform that you are uploading to. If your destination server is a Windows machine, use the value windows
.
type String
or Object
Default: null
A key file location. If an object, please use the format {location:'/path/to/file',passphrase:'secretphrase'}
type String
Default: null
A passphrase for secret key authentication. Leave blank if your key does not need a passphrase.
type String
Default: null
If you wish to pass the key directly through gulp, you can do so by setting it to options.keyContents.
type String
Default: null
An identifier to access authentication information from .ftppass
see Authentication for more information.
type String
Default: .ftppass
A path relative to the project root to a JSON formatted file containing auth information.
type int
Default: Currently set by ssh2 as 10000
milliseconds.
An integer in milliseconds specifying how long to wait for a server response.
type String
Default: null
Path to ssh-agent's UNIX socket for ssh-agent-based user authentication.
type bool
Default: false
Set to true to use OpenSSH agent forwarding. Requires that options.agent
is configured.
type function
Default: null
Callback function to be called once the SFTP connection is closed.
##Authentication
For better security, save authentication data in a json formatted file named .ftppass
(or to whatever value you set options.authFile to). Be sure to add this file to .gitignore. You do not typically want auth information stored in version control.
var gulp = require('gulp');
var sftp = require('gulp-fez-sftp');
gulp.task('default', function () {
return gulp.src('src/*')
.pipe(sftp({
host: 'website.com',
auth: 'keyMain'
}));
});
.ftppass
{
"keyMain": {
"user": "username1",
"pass": "password1"
},
"keyShort": "username1:password1",
"privateKey": {
"user": "username"
},
"privateKeyEncrypted": {
"user": "username",
"passphrase": "passphrase1"
},
"privateKeyCustom": {
"user": "username",
"passphrase": "passphrase1",
"keyLocation": "/full/path/to/key"
}
}
FAQs
使用SFTP(SSH)上传文件到远程服务器
The npm package gulp-fez-sftp receives a total of 6 weekly downloads. As such, gulp-fez-sftp popularity was classified as not popular.
We found that gulp-fez-sftp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.