在 CentOS 上,您可以使用以下方法之一来重启 SFTP 服务:
方法 1:使用 systemctl
sudo yum install openssh-server
sudo systemctl start sshd
sudo systemctl enable sshd
sudo systemctl status sshd
方法 2:使用 service
sudo service sshd start
sudo chkconfig sshd on
sudo service sshd status
请注意,这两种方法都会重启 OpenSSH 服务,其中包括 SFTP 功能。如果您只想重启 SFTP 服务,而不是整个 OpenSSH 服务,可以尝试使用以下命令(但请注意,这可能不是所有系统都支持的):
sudo systemctl restart sftp
或者
sudo service sftp restart