Get the App
SLTechnology News&Howtos  ›  Servers  › 

How does Linux turn on SFTP

Shulou Source: shulou.com Published: 2022-06-02 06:56:09 10月27日 Update

1. SFTP explanation

SFTP is the abbreviation of Secure File Transfer Protocol, secure file transfer protocol. It can provide a secure encryption method for transferring files.

SFTP and FTP have almost the same syntax and function.

SFTP is part of SSH and is a secure way to transfer files to a Blogger server. In fact, a secure file transfer subsystem called SFTP (Secure File Transfer Protocol) is already included in the SSH package, and SFTP itself does not.

There is a separate daemon that must use the SSHD daemon (the port number is 22 by default) to complete the corresponding connection operation, so in a sense, SFTP is not like a server program, but more like a client program.

SFTP also uses encryption to transmit authentication information and transmitted data, so using SFTP is very secure.

However, because this mode of transmission uses encryption / decryption technology, the transmission efficiency is much lower than ordinary FTP, if you have higher requirements for network security, you can use SFTP instead of FTP.

2. Enable SFTP

Open the command:

1 / etc/init.d/sshd start 2 / etc/init.d/sshd stop

After starting in this way, it is possible to connect using the SFTP connection with the XShell5 tool.

The configuration is as follows:

Figure 1 configuration information

Figure 2 successful connection

PS: but if you connect to a program written in Java, you will find an error, the error reported is Auth fail, and the verification error.

Possible reasons:

One of the configuration items in the / etc/ssh/sshd_config folder, PasswordAuthentication, defaults to no, and the "PasswordAuthentication" setting allows password authentication. Change it to yes and restart the service to OK.

Tags: Transfer security files programs encryption configuration information methods processes errors services authentication normal success functions reasons passwords slogans commands subsystems Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Apple Xiaomi OPPO Reno macOS