Linux users often use the SCP and SFTP commands when they are transmitting remote files. But these two commands also have some risks for our computers, so we can turn them off when we don't need to transfer files remotely. So how do you ban the SCP and SFTP? Here is the concrete method.
SFTP Introduction
SFTP is a secure File Transfer protocol abbreviation for security FTP. You can provide a secure encryption method for transferring files. SFTP and FTP have almost the same syntax and functionality
Introduction to SCP
Transfer files between two hosts generally use the SCP command, usually using the SCP command to obtain each other's Linux host files via SSH, you need to enter a password confirmation, the method is almost.
Prohibition of SCP and SFTP commands
System: CentOS 5.x
1. First prohibition of SCP
Rpm-qa|grep openssh-*
Yum Remove openssh-clients-y
After you delete the openssh-clients, and then execute the SCP, you'll report the following error:
-bash:scp:command not found
2. Prohibition of SFTP
Vi/etc/ssh/sshd_config
subsystem Sftp/usr/libexec/openssh/sftp-server
Note This line, as follows:
#Subsystem Sftp/usr/libexec/openssh/sftp-server
After exiting save, restart sshd:
Service sshd Restart
That's the way the Linux system prohibits SCP and SFTP commands. Users who need or are interested can try the operation on their own computers.