更新

更新

我正在尝试使用私钥连接到 sftp。

结果是“服务器拒绝我们的密钥”(已使用 filezilla 和 winscp 尝试)。这是来自 winscp 的会话日志:

Reading key file "D:\path\to\file\mykey.ppk"
Pageant is running. Requesting keys.
Pageant has 2 SSH-2 keys
Configured key file not in Pageant
Using username "myusername".
Server offered these authentication methods: publickey,gssapi-keyex,gssapi-with-mic,password
Offered public key
Server refused our key
Server refused our key

服务器/var/log/secure 日志:

sshd[6219]: Invalid user myusername from xxx.xxx.xxx.xxx
sshd[6220]: input_userauth_request: invalid user myusername

也许有必要提一下,我正在使用 bluehost VPS。我尝试连接到它的 ftp 帐户位于子 cpanel 帐户中(通过 WHM 创建)。

我进行的一些检查:

我检查了一下我能够使用 putty 和相同的私钥通过 ssh 连接到同一台服务器。所以我不知道为什么在尝试使用 sftp 连接时服务器拒绝密钥。

我检查了一下,我能够使用普通 ftp 模式(用户名+密码)连接到服务器

更新

sftp 似乎也可以,但是用户帐号,而不是FTP 帐户(使用私钥)。

ftp账户是通过子cpanel账户的cpanel创建的。

我使用“/usr/sbin/sshd -d”在调试模式下运行 sshd,出现以下错误:

  PAM: password authentication failed for an illegal user: User not known to the underlying authentication module

因此,我认为 PAM 仅识别用户帐户(对于 putty 和 sftp),但不识别 ftp 帐户。

相关内容