Home > Operation and Maintenance > Linux Operation and Maintenance > Check if ssh is enabled in linux

Check if ssh is enabled in linux

藏色散人
Release: 2019-11-07 10:28:49
Original
17787 people have browsed it

Check if ssh is enabled in linux

linux check if ssh is enabled?

1 Installation

apt-get install openssh-server
Copy after login

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

ps -e | grep ssh
Copy after login

If only:

ssh-agent
Copy after login

It means the server is not started

You can start it manually:

sudo /etc/init.d/ssh start
Copy after login

or restart ubuntu

Recommended: "Linux Tutorial"

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
Copy after login

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

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

root]#/etc/rc.d/init.d/sshd start
root]#service ssh start
Copy after login

Look at the network connection of this ssh service:

root]#netstat -ntlp
Copy after login

If you look Go to the following content:

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 22109/sshd
Copy after login

This shows that sshd can work normally. If the client (SecurCRT, putty, etc.) cannot be connected, try turning off the firewall

Try: service iptables stop

The above is the detailed content of Check if ssh is enabled in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template