0

PSFTP.exe で FTP サーバーの応答コードを表示/出力する方法はありますか?

FTP サーバーの応答コードの例:

226 Transfer OK

200 Command okay

私のコード:

psftp.exe username@hostname -pw password -v -b batch_file > output_file 2>&1

バッチファイル:

put some_file
quit

出力ファイル:

Looking up host "....."
Connecting to ..... port 22
Server version: SSH-2.0-OpenSSH_3.9p1
We claim version: SSH-2.0-PuTTY_Release_0.60_(Centrify_GSS_1.4)
Using SSH protocol version 2
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-1
Host key fingerprint is:
ssh-rsa 1024 ....
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Using username ....
Sent .....
Access granted
Opened channel for session
Started a shell/command
Sent EOF message
Server sent command exit status 0
Disconnected: All channels closed
Connected to ......
Remote working directory is ....
local:some_file => remote: some_file_path_on_server
4

1 に答える 1

1

FTPサーバーではなくSSHサーバーに接続しているため、FTP サーバーのステータス コードを取得できません。名前は似ていますが、SSH ファイル転送プロトコルは FTP とは根本的に異なります。

于 2013-01-29T19:00:09.053 に答える