How to view Linux ssh service information and running status

How to view Linux ssh service information and running status

There are many articles about ssh server configuration, such as ssh service configuration under Linux. Here we only list some common commands for viewing ssh service related information.

1 Installation

apt-get install openssh-server

2 After completion, check whether the ssh server is started:

ps -e | grep ssh

If there is only:

ssh-agent

Explanation: The server is not started

It can be started manually:

sudo /etc/init.d/ssh start

Or restart ubuntu

3 Now you can use putty to connect

rpm -qa | grep ssh You can see the ssh installation package in the system

rpm -ql openssh-3.5p1-6 View the installation information of the installation package (such as installation path, configuration file, etc.)

ps -e | grep ssh Check whether the ssh service is running. If so, you can see something similar to the following:

2254 ? 00:00:00 sshd

This proves that ssh is already running, and the process name is sshd

If it is not running, you can run it with the following command:

root]#/etc/rc.d/init.d/sshd start

root]#service ssh start

Let's take a look at the network connection status of this ssh service:

root]#netstat -ntlp

If you see something like this:

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 22109/sshd

This means that sshd is working properly. If you cannot connect using a client (SecurCRT, putty, etc.), try turning off the firewall.

Try the wall: service iptables stop

The above method of checking Linux ssh service information and running status is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • How to check whether the ssh service is installed or started in Ubuntu
  • How to view the status of remote server files in Linux

<<:  MySql 8.0.11-Winxp64 (free installation version) configuration tutorial

>>:  Promise encapsulation wx.request method

Recommend

Use of nginx custom variables and built-in predefined variables

Overview Nginx can use variables to simplify conf...

How to make an input text box change length according to its content

First: Copy code The code is as follows: <input...

Complete steps for Docker to pull images

1. Docker pull pulls the image When using $ docke...

js precise calculation

var numA = 0.1; var numB = 0.2; alert( numA + num...

Use of JavaScript sleep function

Table of contents 1.sleep function 2. setTimeout ...

Summary of commonly used CSS encapsulation methods

1. pc-reset PC style initialization /* normalize....

Examples of using the or statement in MySQL

1. The use of or syntax in MySQL, and the points ...

Example of using store in vue3 to record scroll position

Table of contents Overall Effect Listen for conta...

Detailed explanation of how to install PHP7 on Linux

How to install PHP7 on Linux? 1. Install dependen...