proftpd公钥Comment超长问题

使用proftpd提供sftp服务时,若选择publickey认证方式,当公钥文件中的Comment所在行内容超过74字节时,会使登录时证书认证方式失败。

登录失败时的proftpd日志示例如下:

2017-12-06 20:30:58,324 mod_sftp/0.9.9[1591]: line too long (74) on line 1 of '/usr/proftpd-1.3.5/etc/authorized_keys/app'

2017-12-06 20:30:58,324 mod_sftp/0.9.9[1591]: Make sure that '/usr/proftpd-1.3.5/etc/authorized_keys/app' is a RFC4716 formatted key

2017-12-06 20:30:58,324 mod_sftp/0.9.9[1591]: error base64-decoding key data in '/usr/proftpd-1.3.5/etc/authorized_keys/app'

2017-12-06 20:30:58,324 mod_sftp/0.9.9[1591]: error comparing keys from '/usr/proftpd-1.3.5/etc/authorized_keys/app': Invalid argument

2017-12-06 20:30:58,325 mod_sftp/0.9.9[1591]: sending userauth failure; remaining userauth methods: password

proftpd文档中关于以上问题的说明如下:

Question: I followed the instructions to convert my authorized keys from OpenSSH to RFC4716 format, yet I see the following error in my SFTPLog:

mod_sftp/0.9.7[31050]: line too long (74) on line 1 of 'authorized_keys'
What can I do to fix this?

Answer: OpenSSH's ssh-keygen tool had a bug where the RFC4716 keys it would generate might not comply to the RFC; see the OpenSSH bug filed for this issue.
Chances are that the offending line in the RFC4716 key is a "Comment: " header that is too long. Simply delete that "Comment: " line; the mod_sftp ignores this header.

http://www.proftpd.org/docs/contrib/mod_sftp.html

解决办法:

Comment所在行内容超过74个字节,则需要将该行内容删除,或删除“Comment: "..."”中的描述内容,使该行内容减少至小于等于74个字节。


示例:“Comment: "1024-bit RSA, converted from OpenSSH by app@localhost.localdomain"”内容超为76个字节,则将该行内容删除,或使该行内容小于等于74个字节,如修改为“Comment: "1024-bit RSA, converted from OpenSSH by app@localhost.localdoma"”

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值