winSCP 无法通过 FTP 或 SFTP 访问 proFTPd

winSCP 无法通过 FTP 或 SFTP 访问 proFTPd

我想在我的 Debian 服务器上设置 SFTP 以通过 winSCP 上传一些文件。

我已经可以使用 FTP,但我发现 SFTP 很难工作。

我已经遵循了这个指南:在 ProFTPd 中设置 SFTP(接受将 DSA 更改为 ECDSA)

我正在尝试通过 winSCP 使用以下设置连接到 SFTP:

servername: 192.168.2.126

portnumber: 2222

protocol: SFTP

username: *******

password: *******

但这会返回:已断开连接:没有可用的受支持的身份验证方法(服务器发送:公钥)

winSCP的会话日志:

. 2019-08-03 19:20:21.682 --------------------------------------------------------------------------
. 2019-08-03 19:20:21.684 WinSCP Version 5.15.3 (Build 9730) (OS 10.0.17134 - Windows 10 Enterprise)
. 2019-08-03 19:20:21.684 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2019-08-03 19:20:21.685 Log level: Debug 2
. 2019-08-03 19:20:21.685 Local account: STEPHAN\Stephan H. Böhm
. 2019-08-03 19:20:21.685 Working directory: C:\Program Files (x86)\WinSCP
. 2019-08-03 19:20:21.685 Process ID: 7760
. 2019-08-03 19:20:21.688 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe"
. 2019-08-03 19:20:21.688 Time zone: Current: GMT+2, Standard: GMT+1 (Mitteleuropäische Zeit), DST: GMT+2 (Mitteleuropäische Sommerzeit), DST Start: 31.03.2019, DST End: 27.10.2019
. 2019-08-03 19:20:21.689 Login time: Samstag, 3. August 2019 19:20:21
. 2019-08-03 19:20:21.690 --------------------------------------------------------------------------
. 2019-08-03 19:20:21.690 Session name: [email protected] (Ad-Hoc site)
. 2019-08-03 19:20:21.690 Host name: 192.168.2.126 (Port: 2222)
. 2019-08-03 19:20:21.691 User name: dietpi (Password: Yes, Key file: No, Passphrase: No)
. 2019-08-03 19:20:21.691 Tunnel: No
. 2019-08-03 19:20:21.691 Transfer Protocol: SFTP (SCP)
. 2019-08-03 19:20:21.691 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2019-08-03 19:20:21.691 Disable Nagle: No
. 2019-08-03 19:20:21.691 Proxy: None
. 2019-08-03 19:20:21.691 Send buffer: 262144
. 2019-08-03 19:20:21.691 SSH protocol version: 2; Compression: No
. 2019-08-03 19:20:21.691 Bypass authentication: No
. 2019-08-03 19:20:21.691 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: Yes
. 2019-08-03 19:20:21.691 GSSAPI: Forwarding: No; Libs: gssapi32,sspi,custom; Custom:
. 2019-08-03 19:20:21.691 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2019-08-03 19:20:21.691 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2019-08-03 19:20:21.693 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2019-08-03 19:20:21.693 Simple channel: Yes
. 2019-08-03 19:20:21.693 Return code variable: Autodetect; Lookup user groups: Auto
. 2019-08-03 19:20:21.693 Shell: default
. 2019-08-03 19:20:21.693 EOL: LF, UTF: Auto
. 2019-08-03 19:20:21.693 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2019-08-03 19:20:21.693 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2019-08-03 19:20:21.693 SFTP Bugs: Auto,Auto
. 2019-08-03 19:20:21.693 SFTP Server: default
. 2019-08-03 19:20:21.693 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2019-08-03 19:20:21.693 Cache directory changes: Yes, Permanent: Yes
. 2019-08-03 19:20:21.693 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2019-08-03 19:20:21.693 DST mode: Unix
. 2019-08-03 19:20:21.693 --------------------------------------------------------------------------
. 2019-08-03 19:20:21.781 Looking up host "192.168.2.126" for SSH connection
. 2019-08-03 19:20:21.781 Connecting to 192.168.2.126 port 2222
. 2019-08-03 19:20:21.789 Selecting events 63 for socket 3728
. 2019-08-03 19:20:21.789 We claim version: SSH-2.0-WinSCP_release_5.15.3
. 2019-08-03 19:20:21.822 Waiting for the server to continue with the initialization
. 2019-08-03 19:20:21.822 Looking for incoming data
. 2019-08-03 19:20:21.822 Looking for network events
. 2019-08-03 19:20:21.822 Detected network event
. 2019-08-03 19:20:21.822 Enumerating network events for socket 3728
. 2019-08-03 19:20:21.822 Enumerated 18 network events making 18 cumulative events for socket 3728
. 2019-08-03 19:20:21.822 Handling network write event on socket 3728 with error 0
. 2019-08-03 19:20:21.822 Handling network connect event on socket 3728 with error 0
. 2019-08-03 19:20:21.822 Looking for network events
. 2019-08-03 19:20:21.871 Detected network event
. 2019-08-03 19:20:21.872 Enumerating network events for socket 3728
. 2019-08-03 19:20:21.872 Enumerated 1 network events making 1 cumulative events for socket 3728
. 2019-08-03 19:20:21.872 Handling network read event on socket 3728 with error 0
. 2019-08-03 19:20:21.872 Server version: SSH-2.0-mod_sftp/0.9.9
. 2019-08-03 19:20:21.873 Using SSH protocol version 2
. 2019-08-03 19:20:21.873 Have a known host key of type ecdsa-sha2-nistp256
. 2019-08-03 19:20:21.874 Have a known host key of type rsa2
. 2019-08-03 19:20:21.875 Have a known host key of type rsa2
. 2019-08-03 19:20:21.875 Doing ECDH key exchange with curve nistp256 and hash SHA-256
. 2019-08-03 19:20:21.921 Waiting for the server to continue with the initialization
. 2019-08-03 19:20:21.921 Looking for incoming data
. 2019-08-03 19:20:21.921 Looking for network events
. 2019-08-03 19:20:21.968 Detected network event
. 2019-08-03 19:20:21.968 Enumerating network events for socket 3728
. 2019-08-03 19:20:21.968 Enumerated 1 network events making 1 cumulative events for socket 3728
. 2019-08-03 19:20:21.968 Handling network read event on socket 3728 with error 0
. 2019-08-03 19:20:22.058 Host key fingerprint is:
. 2019-08-03 19:20:22.058 ecdsa-sha2-nistp256 256 92:32:84:6a:da:c8:ca:41:a9:43:47:9a:c1:aa:3e:70 TraRD9wF8y7Qbv2aWBP0tJgahSe3OaXOm+RgKjAYO8s=
. 2019-08-03 19:20:22.058 Verifying host key ecdsa-sha2-nistp256 nistp256,0x7b3db8ee475752f3 30e2a519e842240d bd084f28725025c3 a1fcc1412a08f7a9 ,0x14096caedea4f126 13ab45ebbdbe33e6 79d862e8c9575dc1 88fe2e863d4687eb  with fingerprints ecdsa-sha2-nistp256 256 92:32:84:6a:da:c8:ca:41:a9:43:47:9a:c1:aa:3e:70 TraRD9wF8y7Qbv2aWBP0tJgahSe3OaXOm+RgKjAYO8s=
. 2019-08-03 19:20:22.080 Host key matches cached key
. 2019-08-03 19:20:22.080 Selecting events 63 for socket 3728
. 2019-08-03 19:20:22.082 Initialised AES-256 SDCTR client->server encryption
. 2019-08-03 19:20:22.082 Initialised HMAC-SHA-256 client->server MAC algorithm
. 2019-08-03 19:20:22.082 Waiting for the server to continue with the initialization
. 2019-08-03 19:20:22.082 Looking for incoming data
. 2019-08-03 19:20:22.082 Looking for network events
. 2019-08-03 19:20:22.082 Detected network event
. 2019-08-03 19:20:22.082 Enumerating network events for socket 3728
. 2019-08-03 19:20:22.082 Enumerated 1 network events making 1 cumulative events for socket 3728
. 2019-08-03 19:20:22.082 Handling network read event on socket 3728 with error 0
. 2019-08-03 19:20:22.082 Initialised AES-256 SDCTR server->client encryption
. 2019-08-03 19:20:22.082 Initialised HMAC-SHA-256 server->client MAC algorithm
. 2019-08-03 19:20:22.082 Waiting for the server to continue with the initialization
. 2019-08-03 19:20:22.082 Looking for incoming data
. 2019-08-03 19:20:22.082 Looking for network events
. 2019-08-03 19:20:22.136 Detected network event
. 2019-08-03 19:20:22.136 Enumerating network events for socket 3728
. 2019-08-03 19:20:22.136 Enumerated 1 network events making 1 cumulative events for socket 3728
. 2019-08-03 19:20:22.136 Handling network read event on socket 3728 with error 0
! 2019-08-03 19:20:22.137 Using username "dietpi".
. 2019-08-03 19:20:22.160 Waiting for the server to continue with the initialization
. 2019-08-03 19:20:22.160 Looking for incoming data
. 2019-08-03 19:20:22.160 Looking for network events
. 2019-08-03 19:20:22.171 Detected network event
. 2019-08-03 19:20:22.171 Enumerating network events for socket 3728
. 2019-08-03 19:20:22.171 Enumerated 1 network events making 1 cumulative events for socket 3728
. 2019-08-03 19:20:22.171 Handling network read event on socket 3728 with error 0
. 2019-08-03 19:20:22.171 Server offered these authentication methods: publickey
. 2019-08-03 19:20:22.172 Selecting events 0 for socket 3728
. 2019-08-03 19:20:22.172 Disconnected: No supported authentication methods available (server sent: publickey)
* 2019-08-03 19:20:22.217 (EFatal) Disconnected: No supported authentication methods available (server sent: publickey)
* 2019-08-03 19:20:22.217 Anmeldungsprotokoll (Siehe Sitzungsprotokoll für Details):
* 2019-08-03 19:20:22.217 Verwende Benutzername "dietpi".
* 2019-08-03 19:20:22.217
* 2019-08-03 19:20:22.217 Anmeldung fehlgeschlagen.
. 2019-08-03 19:20:31.371 --------------------------------------------------------------------------
. 2019-08-03 19:20:31.373 WinSCP Version 5.15.3 (Build 9730) (OS 10.0.17134 - Windows 10 Enterprise)
. 2019-08-03 19:20:31.373 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2019-08-03 19:20:31.374 Log level: Debug 2
. 2019-08-03 19:20:31.374 Local account: STEPHAN\Stephan H. Böhm
. 2019-08-03 19:20:31.374 Working directory: C:\Program Files (x86)\WinSCP
. 2019-08-03 19:20:31.375 Process ID: 7760
. 2019-08-03 19:20:31.378 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe"
. 2019-08-03 19:20:31.378 Time zone: Current: GMT+2, Standard: GMT+1 (Mitteleuropäische Zeit), DST: GMT+2 (Mitteleuropäische Sommerzeit), DST Start: 31.03.2019, DST End: 27.10.2019
. 2019-08-03 19:20:31.379 Login time: Samstag, 3. August 2019 19:20:31
. 2019-08-03 19:20:31.379 --------------------------------------------------------------------------
. 2019-08-03 19:20:31.379 Session name: [email protected] (Ad-Hoc site)
. 2019-08-03 19:20:31.380 Host name: 192.168.2.126 (Port: 2222)
. 2019-08-03 19:20:31.380 User name: dietpi (Password: Yes, Key file: No, Passphrase: No)
. 2019-08-03 19:20:31.380 Tunnel: No
. 2019-08-03 19:20:31.380 Transfer Protocol: SFTP (SCP)
. 2019-08-03 19:20:31.381 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2019-08-03 19:20:31.381 Disable Nagle: No
. 2019-08-03 19:20:31.381 Proxy: None
. 2019-08-03 19:20:31.381 Send buffer: 262144
. 2019-08-03 19:20:31.381 SSH protocol version: 2; Compression: No
. 2019-08-03 19:20:31.381 Bypass authentication: No
. 2019-08-03 19:20:31.381 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: Yes
. 2019-08-03 19:20:31.382 GSSAPI: Forwarding: No; Libs: gssapi32,sspi,custom; Custom:
. 2019-08-03 19:20:31.382 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2019-08-03 19:20:31.382 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2019-08-03 19:20:31.382 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2019-08-03 19:20:31.382 Simple channel: Yes
. 2019-08-03 19:20:31.383 Return code variable: Autodetect; Lookup user groups: Auto
. 2019-08-03 19:20:31.383 Shell: default
. 2019-08-03 19:20:31.383 EOL: LF, UTF: Auto
. 2019-08-03 19:20:31.383 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2019-08-03 19:20:31.383 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2019-08-03 19:20:31.383 SFTP Bugs: Auto,Auto
. 2019-08-03 19:20:31.383 SFTP Server: default
. 2019-08-03 19:20:31.384 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2019-08-03 19:20:31.384 Cache directory changes: Yes, Permanent: Yes
. 2019-08-03 19:20:31.384 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2019-08-03 19:20:31.384 DST mode: Unix
. 2019-08-03 19:20:31.384 --------------------------------------------------------------------------
. 2019-08-03 19:20:31.479 Looking up host "192.168.2.126" for SSH connection
. 2019-08-03 19:20:31.480 Connecting to 192.168.2.126 port 2222
. 2019-08-03 19:20:31.487 Selecting events 63 for socket 3784
. 2019-08-03 19:20:31.488 We claim version: SSH-2.0-WinSCP_release_5.15.3
. 2019-08-03 19:20:31.521 Waiting for the server to continue with the initialization
. 2019-08-03 19:20:31.521 Looking for incoming data
. 2019-08-03 19:20:31.521 Looking for network events
. 2019-08-03 19:20:31.521 Detected network event
. 2019-08-03 19:20:31.521 Enumerating network events for socket 3784
. 2019-08-03 19:20:31.521 Enumerated 18 network events making 18 cumulative events for socket 3784
. 2019-08-03 19:20:31.521 Handling network write event on socket 3784 with error 0
. 2019-08-03 19:20:31.521 Handling network connect event on socket 3784 with error 0
. 2019-08-03 19:20:31.523 Looking for network events
. 2019-08-03 19:20:31.569 Detected network event
. 2019-08-03 19:20:31.569 Enumerating network events for socket 3784
. 2019-08-03 19:20:31.569 Enumerated 1 network events making 1 cumulative events for socket 3784
. 2019-08-03 19:20:31.569 Handling network read event on socket 3784 with error 0
. 2019-08-03 19:20:31.570 Server version: SSH-2.0-mod_sftp/0.9.9
. 2019-08-03 19:20:31.570 Using SSH protocol version 2
. 2019-08-03 19:20:31.571 Have a known host key of type ecdsa-sha2-nistp256
. 2019-08-03 19:20:31.572 Have a known host key of type rsa2
. 2019-08-03 19:20:31.573 Have a known host key of type rsa2
. 2019-08-03 19:20:31.573 Doing ECDH key exchange with curve nistp256 and hash SHA-256
. 2019-08-03 19:20:31.618 Waiting for the server to continue with the initialization
. 2019-08-03 19:20:31.618 Looking for incoming data
. 2019-08-03 19:20:31.618 Looking for network events
. 2019-08-03 19:20:31.666 Detected network event
. 2019-08-03 19:20:31.666 Enumerating network events for socket 3784
. 2019-08-03 19:20:31.666 Enumerated 1 network events making 1 cumulative events for socket 3784
. 2019-08-03 19:20:31.666 Handling network read event on socket 3784 with error 0
. 2019-08-03 19:20:31.745 Host key fingerprint is:
. 2019-08-03 19:20:31.745 ecdsa-sha2-nistp256 256 92:32:84:6a:da:c8:ca:41:a9:43:47:9a:c1:aa:3e:70 TraRD9wF8y7Qbv2aWBP0tJgahSe3OaXOm+RgKjAYO8s=
. 2019-08-03 19:20:31.745 Verifying host key ecdsa-sha2-nistp256 nistp256,0x7b3db8ee475752f3 30e2a519e842240d bd084f28725025c3 a1fcc1412a08f7a9 ,0x14096caedea4f126 13ab45ebbdbe33e6 79d862e8c9575dc1 88fe2e863d4687eb  with fingerprints ecdsa-sha2-nistp256 256 92:32:84:6a:da:c8:ca:41:a9:43:47:9a:c1:aa:3e:70 TraRD9wF8y7Qbv2aWBP0tJgahSe3OaXOm+RgKjAYO8s=
. 2019-08-03 19:20:31.786 Host key matches cached key
. 2019-08-03 19:20:31.787 Selecting events 63 for socket 3784
. 2019-08-03 19:20:31.790 Initialised AES-256 SDCTR client->server encryption
. 2019-08-03 19:20:31.790 Initialised HMAC-SHA-256 client->server MAC algorithm
. 2019-08-03 19:20:31.790 Waiting for the server to continue with the initialization
. 2019-08-03 19:20:31.790 Looking for incoming data
. 2019-08-03 19:20:31.790 Looking for network events
. 2019-08-03 19:20:31.790 Detected network event
. 2019-08-03 19:20:31.790 Enumerating network events for socket 3784
. 2019-08-03 19:20:31.790 Enumerated 1 network events making 1 cumulative events for socket 3784
. 2019-08-03 19:20:31.790 Handling network read event on socket 3784 with error 0
. 2019-08-03 19:20:31.790 Initialised AES-256 SDCTR server->client encryption
. 2019-08-03 19:20:31.790 Initialised HMAC-SHA-256 server->client MAC algorithm
. 2019-08-03 19:20:31.790 Waiting for the server to continue with the initialization
. 2019-08-03 19:20:31.790 Looking for incoming data
. 2019-08-03 19:20:31.791 Looking for network events
. 2019-08-03 19:20:31.878 Detected network event
. 2019-08-03 19:20:31.878 Enumerating network events for socket 3784
. 2019-08-03 19:20:31.878 Enumerated 1 network events making 1 cumulative events for socket 3784
. 2019-08-03 19:20:31.878 Handling network read event on socket 3784 with error 0
! 2019-08-03 19:20:31.879 Using username "dietpi".
. 2019-08-03 19:20:31.908 Waiting for the server to continue with the initialization
. 2019-08-03 19:20:31.908 Looking for incoming data
. 2019-08-03 19:20:31.908 Looking for network events
. 2019-08-03 19:20:31.919 Detected network event
. 2019-08-03 19:20:31.919 Enumerating network events for socket 3784
. 2019-08-03 19:20:31.920 Enumerated 1 network events making 1 cumulative events for socket 3784
. 2019-08-03 19:20:31.920 Handling network read event on socket 3784 with error 0
. 2019-08-03 19:20:31.920 Server offered these authentication methods: publickey
. 2019-08-03 19:20:31.921 Selecting events 0 for socket 3784
. 2019-08-03 19:20:31.921 Disconnected: No supported authentication methods available (server sent: publickey)
* 2019-08-03 19:20:31.972 (EFatal) Disconnected: No supported authentication methods available (server sent: publickey)
* 2019-08-03 19:20:31.973 Anmeldungsprotokoll (Siehe Sitzungsprotokoll für Details):
* 2019-08-03 19:20:31.973 Verwende Benutzername "dietpi".
* 2019-08-03 19:20:31.973
* 2019-08-03 19:20:31.973 Anmeldung fehlgeschlagen.

也许也是因为我不知道从哪里获得私钥,他们希望我将其添加到winscp/fileZilla。

cat /etc/proftpd/proftpd.conf

给我:

# D I E T - P I
# File Location
# /etc/proftpd/proftpd.conf


# Includes DSO modules
Include /etc/proftpd/modules.conf

# Set off to disable IPv6 support which is problematic on IPv4 only boxes.
UseIPv6                         on
# If set on you can experience a longer connection delay in many cases.
IdentLookups                    off

ServerName                      "192.168.2.126"
ServerType                      standalone
DeferWelcome                    off

MultilineRFC2228                on
DefaultServer                   on
ShowSymlinks                    on

TimeoutNoTransfer               120
TimeoutStalled                  120
TimeoutIdle                     240
DisplayLogin                    welcome.msg
DisplayChdir                    .message true
ListOptions                     "-l"

DenyFilter                      \*.*/

DefaultRoot                     /mnt/backup_hdd/stephan_backup

Port                            21

MaxInstances                    8

RootLogin                       off
User                            dietpi
Group                           dietpi

Umask                           022  022
AllowOverwrite                  on
TransferLog /var/log/proftpd/xferlog
SystemLog   /var/log/proftpd/proftpd.log

# to stop logging wtmp /var/log/wtmp: No such file or directory -Gordon Williams change
WtmpLog off

#UseLastlog on

<IfModule mod_quotatab.c>
QuotaEngine off
</IfModule>

<IfModule mod_ratio.c>
Ratios off
</IfModule>

<IfModule mod_delay.c>
DelayEngine on
</IfModule>

<IfModule mod_ctrls.c>
ControlsEngine        off
ControlsMaxClients    2
ControlsLog           /var/log/proftpd/controls.log
ControlsInterval      5
ControlsSocket        /var/run/proftpd/proftpd.sock
</IfModule>

<IfModule mod_ctrls_admin.c>
AdminControlsEngine off
</IfModule>

#Include /etc/proftpd/tls.conf

# Include other custom configuration files
Include /etc/proftpd/conf.d/

cat /etc/proftpd/conf.d/sftp.conf

给我

<IfModule mod_sftp.c>

        SFTPEngine on
        Port 2222
        SFTPLog /var/log/proftpd/sftp.log

        # Configure both the RSA and DSA host keys, using the same host key
        # files that OpenSSH uses.
        SFTPHostKey /etc/ssh/ssh_host_rsa_key
        SFTPHostKey /etc/ssh/ssh_host_ecdsa_key

        SFTPAuthMethods publickey

        SFTPAuthorizedUserKeys file:/etc/proftpd/authorized_keys/%u

        # Enable compression
        SFTPCompression delayed

</IfModule>

cat /etc/ssh/sshd_config

给我:

#   $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

Port 1234
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation sandbox
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

# override default of no subsystems
#Subsystem  sftp    /usr/lib/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#   X11Forwarding no
#   AllowTcpForwarding no
#   PermitTTY no
#   ForceCommand cvs server

有人能帮我吗?

提前谢谢了!

答案1

我确实通过按照以下教程在 openssh 上配置 sftp 解决了我的问题:

设置 sftp 服务器

抱歉德国链接并感谢您的回答!

答案2

命令scpsftp是服务器的一部分ssh并连接到ssh服务器。sftp提供ftp类似的接口ssh

sftp或安全 ftp,是另一回事。设置sftp服务器绝不会让您运行sftp.你需要一个ssh服务器。

相关内容