See if the Linux virtual machine SSH service is turned on

Source: Internet
Author: User
Tags ssh port

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.