【发布时间】:2022-06-21 19:26:46
【问题描述】:
我有一个想要上传到 SSH 服务器的 SQL 文件。我该怎么做?
我尝试使用putty 连接到本地主机,但这需要配置环境。
【问题讨论】:
标签: windows powershell ssh file-upload pscp
我有一个想要上传到 SSH 服务器的 SQL 文件。我该怎么做?
我尝试使用putty 连接到本地主机,但这需要配置环境。
【问题讨论】:
标签: windows powershell ssh file-upload pscp
我所做的是使用 Windows PowerShell 和 pscp 命令:
pscp -P [port] -l [user] [local source like C:\...] [target like host:path]
C:\admin>pscp
PuTTY Secure Copy client
Release 0.60
Usage: pscp [options] [user@]host:source target
pscp [options] source [source...] [user@]host:target
pscp [options] -ls [user@]host:filespec
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-p preserve file attributes
-q quiet, don't show statistics
-r copy directories recursively
-v show verbose messages
-load sessname Load settings from saved session
-P port connect to specified port
-l user connect with specified username
-pw passw login with specified password
-1 -2 force use of particular SSH protocol version
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for authentication
-noagent disable use of Pageant
-agent enable use of Pageant
-batch disable all interactive prompts
-unsafe allow server-side wildcards (DANGEROUS)
-sftp force use of SFTP protocol
-scp force use of SCP protocol
【讨论】: