Score:1

Using public key SSH works, but SFTP gives error

tm flag

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?

Score:1
tm flag

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

Score:-2
gb flag

Have you installed FTP server yet? If not, install a FTP server daemon like vsftp as below

sudo zypper -n in vsftpd

Then configure /etc/vsftpd.conf file. Otherwise, recheck client's configuration and make sure you put the correct directory of SSH private and public key.

so flag
SFTP and FTP are two completely unrelated protocols.
John Greene avatar
cn flag
The option to `sshd_config` is `subsystem`. Add `sftp` as its argument and enjoy the sftp.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.