SSH can connect but SFTP cannot connect sftp-server does not exist sftp-server installation

illustrate

ubuntu system. Unlike other ways, I did not modify the path to sftp.
The problem I encountered was configured in sshd_config

Subsystem       sftp /usr/libexec/openssh/sftp-server

This path does not exist, so just install it.

sudo apt-get install openssh-server

Steps

vim /etc/ssh/sshd_config 

Subsystem sftp /usr/lib/openssh/sftp-server

-----Subsystem If there is a # sign in front of it, remove it.

3. Restart the service

service sshd restart

4. If it still doesn't work, check whether /usr/lib/openssh/sftp-serverthe file
exists. It doesn't exist here, so just reinstall ssh. As for why it doesn't exist, I still don't know.

sudo apt-get install openssh-server

The following words will appear during the installation. Because it has been installed before, so I will install it again this time. I chose 1.

A new version (/tmp/fileZQLJFe) of configuration file /etc/ssh/sshd_config is available, but the version installed currently
has been locally modified.

  1. install the package maintainer's version             5. show a 3-way difference between available versions
  2. keep the local version currently installed           6. do a 3-way merge between available versions
  3. show the differences between the versions            7. start a new shell to examine the situation
  4. show a side-by-side difference between the versions

What do you want to do about modified configuration file sshd_config? 1
  1. Restart the service, test again, and you can connect.

Guess you like

Origin blog.csdn.net/Zilong0128/article/details/131078999