大网数据广告活动
服务器运维问答

Using public key SSH works, but SFTP gives error

· 52CE 我爱测

On a server I installed openSUSE, configured SSH so only one user is allowed, only public key is allowed (no pam, no password), coming from specific IP. SSH works, X11 forwarding works, SFTP works. Now, I needed secondary system,…

问题原文

原帖链接 · greenoldman · CC BY-SA 4.0

On a server I installed openSUSE, configured SSH so only one user is allowed, only public key is allowed (no pam, no password), coming from specific IP.

SSH works, X11 forwarding works, SFTP works.

Now, I needed secondary system, pretty much identical as outer world is concerned. I installed Xubuntu, set SSH, firewall, I copied exactly the same SSH config and keys from openSUSE, and...

SSH works, X11 forwarding works, SFTP does not work.

I use FileZilla for connection, and it gives error "sftp received unexpected end-of-file from sftp server". I googled a bit, and found out advice to check "/var/log/auth.log" on the server so I did, and it is all rosy, when I try to connect using SFTP I see only single message "sshd[11835]: Accepted publickey for ...".

What can be cause of such difference and how to fix it?

已采纳解答

原帖链接 · greenoldman · CC BY-SA 4.0

Finally found it. I tried other clients hoping one of them will bring new light, and indeed "sftp -v" did. The sshd config I copied was using external sftp server (which was present in openSUSE, but was not in Xubuntu). I changed it to internal server and now I can connect using Xubuntu as well.

Here is the post which helped: OpenSSH: Difference between internal-sftp and sftp-server

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-04-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。