美文网首页
Kali Linux 启用 ssh server

Kali Linux 启用 ssh server

作者: 松上有婵 | 来源:发表于2020-09-17 11:02 被阅读0次

    查看端口 22 是否 listening

    root@kali:~# netstat -an | grep :22
    root@kali:~#
    

    查看 ssh service状态

    root@kali:~# service ssh status
    [FAIL] sshd is not running … failed!
    root@kali:~#
    

    启动ssh service

    root@kali:~# service ssh start
    [ ok ] Starting OpenBSD Secure Shell server: sshd.
    root@kali:~#
    

    再次查看ssh status

    ● ssh.service - OpenBSD Secure Shell server
       Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: di>
       Active: active (running) since Wed 2020-09-16 22:46:01 EDT; 6min ago
         Docs: man:sshd(8)
               man:sshd_config(5)
      Process: 1913 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
     Main PID: 1914 (sshd)
        Tasks: 1 (limit: 2300)
       Memory: 3.0M
       CGroup: /system.slice/ssh.service
               └─1914 /usr/sbin/sshd -D
    

    再次检查22 是否处于 listening

    root@kali:~# netstat -an | grep :22
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
    tcp6       0      0 :::22                   :::*                    LISTEN
    root@kali:~#
    root@kali:~/Desktop#
    

    设置允许root 用户登录
    先备份配置文件

    cd /etc/ssh/
    cp sshd_config sshd_config.bak
    

    修改配置文件 sshd_config

    vim sshd_config
    
    # Authentication:
    #LoginGraceTime 2m
    #PermitRootLogin prohibit-password
    #StrictModes yes
    #MaxAuthTries 6
    #MaxSessions 10
    

    添加一行PermitRootLogin yes

    # Authentication:
    PermitRootLogin yes
    #LoginGraceTime 2m
    #PermitRootLogin prohibit-password
    #StrictModes yes
    #MaxAuthTries 6
    #MaxSessions 10
    

    重启ssh服务
    service ssh start
    然后大功告成

    相关文章

      网友评论

          本文标题:Kali Linux 启用 ssh server

          本文链接:https://www.haomeiwen.com/subject/adhlyktx.html