查看Linux是否安装ssh服务

查看ssh的安装包 :rpm -qa | grep ssh
查看ssh是否安装成功 :ps -ef | grep ssh

root 2659
 1 0 18:31 ? 00:00:00 /usr/sbin/sshd

root 2702
 2618 0 18:38 pts/0 00:00:00 grep ssh


//这证明ssh已经在运行了,进程名为sshd

开启sshd服务 :service sshd start
开启sshd服务 :/bin/systemctl start sshd.service
查看sshd服务的网络连接情况:netstat -ntlp
查看Linux是否安装ssh服务_第1张图片

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN 

这就是已经连接上了。
我是xshell连接不上Linux了,以为是sshd的服务没有开启。但我的服务开启了。防火墙也关闭了就是连接不上。

你可能感兴趣的:(小小技术点)