Knowledge Preparation:
1. The difference between SSH and sshd:
2. SSH service process default address:/etc/init.d/ssh
See if the SSH service is turned on
Service SSH Status
Or:
/ETC/INIT.D/SSH status
On the Virtual Machine Unit test remote.c function, first manually check whether SSH is running:
[Email protected]:/etc/init.d#/etc/init.d/ssh Status
* SSHD is running
Or this check: [Email protected]:/etc/init.d# service SSH status
SSH start/running, Process 748
[Email protected]:~# vi/etc/init.d/ssh stop to close SSH service instructions
[Email protected]:~# netstat–apntlu View port status, SSH is on if SSH port 22 is in listen state. SSH shutdown failed.
[Email protected]:~# vi/etc/init.d/ssh View SSH script content
[Email protected]:~# vi/var/run/sshd.pid view SSH process pid
[Email protected]:~# start-stop-daemon--stop--quiet--oknodo--pidfile/var/run/sshd.pid--exec/usr/sbin/sshd Follow the script command to close SSH
[Email protected]:~# netstat–apntlu View port status, SSH is on if SSH port 22 is in listen state.
[Email protected]:~# man Start-stop-daemon
OPTIONS
-S,--signal signal
With--stop, specifies the signal-to-send to processes being stopped (default term).
Research signal signal send error issue.
After unloading the new SSH, the problem is solved, it should be a problem in the installation process, I originally installed apt-get install SSH, the correct installation file should be openssh-server. The package used by the sshd installation is Openssh-server, the client is using Openssh-client, and the installation package should not be SSH
[Email protected]:~# vi/etc/init.d/ssh Stop the SSH Service command is working.
Note:
[Email protected]:~# ps-ef | grep ssh can also view port status.
Or you can connect to Linux remotely with Putty, and try to connect. Note: After you close the SSH service, the putty that is being turned on will not be disconnected, but attempting to exit Putty will not connect.
After the Linux system restarts, the SSH service process restarts by default and the PID number is reassigned.
See if the Linux virtual machine SSH service is turned on