Home > Article > Operation and Maintenance > How to determine whether sftp is enabled in linux
Judgment method: 1. Use the netstat command to check whether the specified port is open. The syntax is "netstat -an | grep '22'"; 2. Use the ps command to check the process information. If the process information is displayed, it means that sftp has been opened. , the syntax is "ps -ef | grep sftp".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
The rpm command can only detect software packages installed through rpm or yum. If the software is installed through other methods, it cannot be found. .
Check whether vsftpd is installed through the rpm command: rpm -qa | grep vsftpd
.
Because you can use sftp to upload files after the server gets it, there must be such an sftp service and the service has been turned on. After confirming that it was not installed through the package manager, you can view the service by querying the process or port.
Specific operations
1. Check whether the port is open
netstat -an | grep '22'## Port 22 actually checks the ssh service, so you can also use netstat -an | grep 'ssh' to query.
2. Check the process:
ps -ef | grep sftpIt is worth noting that these two methods need to open an sftp client and have connected to the server. Find out. Unless running as vsftpd. [notice]vsftpd runs as a daemon and can be controlled through service, so it can be directly found through the process or port. [/notice]ps -ef displays the process in a standard format. The format is as followsThe contents of each column mean the following UID //User ID, But the output is the user name PID //Process ID PPID //Parent process ID C //Percentage of CPU occupied by the process STIME //The time from the start of the process to the present TTY //The process is running on which terminal. If it has nothing to do with the terminal, it will be displayed? If it is pts/0, etc., it means that the host process is connected by the network. CMD //The name and parameters of the commandRecommended learning:
The above is the detailed content of How to determine whether sftp is enabled in linux. For more information, please follow other related articles on the PHP Chinese website!