zoukankan      html  css  js  c++  java
  • 查看ssh服务开启状态

    root@dbaudit-desktop:/etc/init.d# /etc/init.d/ssh status

     * sshd is running

    或者这样检查:root@dbaudit-desktop:/etc/init.d# service ssh status

    ssh start/running, process 748

    或者这样检查:

    root@dbaudit-desktop:~# netstat -apntlu

    激活Internet连接 (服务器和已建立连接的)

    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

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

    tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1239/cupsd

    tcp        0      0 0.0.0.0:636             0.0.0.0:*               LISTEN      1139/slapd

    tcp        0      0 0.0.0.0:389             0.0.0.0:*               LISTEN      1139/slapd

    tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      731/mysqld

    tcp        0      0 192.168.51.95:49362     192.168.51.207:22       ESTABLISHED 3763/ssh

    tcp        0      0 192.168.51.95:49363     192.168.51.207:22       ESTABLISHED 3788/ssh

    tcp        0      0 192.168.51.95:22        192.168.51.113:5419     ESTABLISHED 25662/3

    tcp6       0      0 :::80                   :::*                    LISTEN      1361/apache2

    tcp6       0      0 :::22                   :::*                    LISTEN      26913/sshd

    tcp6       0      0 ::1:631                 :::*                    LISTEN      1239/cupsd

    tcp6       0      0 :::636                  :::*                    LISTEN      1139/slapd

    tcp6       0      0 :::389                  :::*                    LISTEN      1139/slapd

    udp        0      0 0.0.0.0:50138           0.0.0.0:*                           764/avahi-daemon: r

    udp        0      0 0.0.0.0:5353            0.0.0.0:*                           764/avahi-daemon: r

    或者这样检查:

    root@dbaudit-desktop:~# ps -ef | grep ssh

    root      2217  2181  0 08:48 ?        00:00:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session

    root      3669  3625  0 08:58 pts/1    00:00:00 ssh root@192.168.51.207

    root      3680  2403  0 08:58 pts/0    00:00:00 ssh root@192.168.51.207

    root      3763  2403  0 08:59 pts/0    00:00:00 ssh root@192.168.51.207

    root      3788  3625  0 08:59 pts/1    00:00:00 ssh root@192.168.51.207

    root     25662     1  0 11:53 ?        00:00:00 sshd: root@pts/3

    root     26003     1  0 11:54 ?        00:00:00 /usr/sbin/sshd

    root     26153 25890  0 11:55 pts/3    00:00:00 grep --color=auto ssh

    或者直接用putty看看能不能连接上。注意:关闭远程协助服务后,本次putty登录并不自动断开,但尝试再次登录putty则不会登录上去了。

    如果有一天我们淹没在茫茫人海中,庸碌一生,那一定是我们没有努力活得丰盛
  • 相关阅读:
    用户登录设计 单点登录 记住密码等
    相同类名称但不同包启动报错
    IDEA项目搭建十一——添加拦截器、忽略URL大小写、启动事件
    IDEA项目搭建七——使用Feign简化消费者端操作
    java enum使用方法
    IDEA项目搭建十——使用slf4j和logback进行日志记录
    IDEA项目搭建九——MybatisPlus多数据库实现
    IDEA项目搭建八——使用MybatisPlus简化数据库交互
    IDEA项目搭建六——使用Eureka和Ribbon进行项目服务化
    新建Git仓库并关联远程Gitlab
  • 原文地址:https://www.cnblogs.com/xiachj/p/4112108.html
Copyright © 2011-2022 走看看