How to Use SFTP ?

Usage

Build a SFTP session with your linux like server, e.g, by the tool "Xshell" or any you like.

After the session is established, then, input the "help" command, do it like this:sftp:/home/catalyst/myapp> help.

You would see below commands shown below: (I would write them word by word, because I want to have a complete overview of them)


ls    -list content of a remote directory

lls   -list content of a local directory

cd   -change your remote working directory

lcd  -change and/or print local working directory

pwd -print your remote working directory

lpwd -print your local working directory

get  -down a file from the server to your local machine

put  -upload a file to your server from local machine


clear -clear screen

help   -give help

bye  -finish your SFTP session

exit  -finish your SFTP session

quit -finish your SFTP session


mkdir -create a directory on the remote server

mv   -move or rename a file on the remote server

rename  -move or rename a file on the remote server

rm  -remove a file on the remote server

rmdir  -remove a directory on the remote server


Demo

Change your local working directory:

Get a file from remote server:

Change your remote working directory, and upload a file to there from the local.

Mars

March 17, 2015


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
How to use SFTP (with client validation - public key authentication) The topic How to use SFTP (with client validation - password authentication) discusses the simplest form of client authentication, via password. In public key authentication, SSH clients and servers authenticate each other via public/private key pairs. Each must have access to their own private key, and they must have access to each other's public key (unless server validation is disabled). You should ensure that the server's public keys are loaded by the client as described in How to use SFTP (with server validation - known hosts), or you may want to switch off server validation to get started. The client's public key must be registered with the SSH server, typically by copying it into the server's authorized_keys file. The client's private key is loaded via SSHFTPClient's setAuthentication method before calling connect, supplying the full path of the private key file, the SSH username and the passphrase of the private key file: ftp.setAuthentication("C:\\myhome\\.ssh\\id_rsa", username, passphrase); Both DSA and RSA keypairs can be used. There are no formal standards for SSH private key files, however three main formats are in common use. All are supported by edtFTPj/PRO (PuTTY since version 1.5.7). Private Key Type Start of key OpenSSH -----BEGIN DSA PRIVATE KEY----- SSH.com ---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- PuTTY PuTTY-User-Key-File-2: The format is automatically detected when the file is loaded. Note that earlier versions of edtFTPj/PRO (prior to 1.5.7) do not support PuTTY keys, but they can be easily converted into SSH.COM or OpenSSH formats via PuTTYgen. The PuTTYgen.exe utility can be freely downloaded from here. It is a simple GUI application that can generate keypairs, and import and export keys in various formats. On the File menu item, select Load Private Key and load your PuTTY private key file. You can optionally enter your key's passphrase (which is advisable – otherwise the converted key will be saved without a passphrase, which is insecure). Then via Conversions -> Export OpenSSH key you can export your private key to another file in OpenSSH format (similarly for ssh.com format). The other authentication method, keyboard-interactive authentication, is discussed in How to use SFTP (with client validation - keyboard-interactive authentication).
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值