深度阅读

How to make SFTP server listen on a specific port?

作者
作者
2023年08月22日
更新时间
11.96 分钟
阅读时间
0
阅读量

To make an SFTP server listen on a specific port, you will need to modify your SFTP server’s configuration file. The steps vary depending on the specific SFTP server software you are using, but in general, you should look for a configuration file that specifies the port number, which is usually located in the “etc” or “conf” directory of the SFTP server installation.

Here is an example of how to change the port number for the popular SFTP server software “OpenSSH” on a Linux or Unix server:

  1. Connect to your server using SSH.
  2. Open the OpenSSH configuration file /etc/ssh/sshd_config in a text editor.
  3. Find the line that reads #Port 22.
  4. Remove the # character to uncomment the line.
  5. Change the number 22 to the desired port number.
  6. Save the file and exit the editor.
  7. Restart the SSH service by running the command sudo service sshd restart or sudo systemctl restart sshd.service.

After completing these steps, your SFTP server should now be listening on the specified port.

Keep in mind that changing the default port for SFTP may impact compatibility with other software and may require you to modify firewall rules or security policies accordingly.

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。