zoukankan      html  css  js  c++  java
  • 修改centos和ubuntu ssh远程连接端口提升系统安全性

    #修改centos服务器ssh端口

    sed -i 's/#Port 22/Port 38390/' /etc/ssh/sshd_config
    sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config
    service sshd restart

    #修改centos服务器root密码

    echo '8bdafafffe' | passwd --stdin root


    发现sshd无法启动


    UseDNS no
    #AddressFamily inet
    PermitRootLogin yes
    SyslogFacility AUTHPRIV
    PasswordAuthentication yes


    vim /etc/ssh/sshd_config


    修改如下:


    ListenAddress 1.1.1.1


    重启sshd报错:
    service sshd restart
    Stopping sshd:                                             [FAILED]
    Starting sshd: /etc/ssh/sshd_config line 130: address family must be specified before ListenAddress.
                                                               [FAILED]
    于是将sshd_config底部的AddressFamily inet提至ListenAddress前面即可:


    Port 38390
    AddressFamily inet
    ListenAddress 1.1.1.1


    ubuntu ssh端口修改方法
    sed -i 's/Port 22/Port 38390/' /etc/ssh/sshd_config
    sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config

    service ssh restart


    密码修改方法

    sudo passwd

  • 相关阅读:
    图像轮廓最大内接矩形的求法
    python利用sift和surf进行图像配准
    Faster Rcnn随笔
    opencv利用svm训练
    灰度图片均衡化源码
    彩色直方图(源码)
    Tensorflow内存暴涨问题
    C++写入txt
    C++生成dll以及调用(函数)和类
    列表元素的几种统计方法总结(嵌套列表)
  • 原文地址:https://www.cnblogs.com/reblue520/p/6239742.html
Copyright © 2011-2022 走看看