zoukankan      html  css  js  c++  java
  • Linux ssh服务器配置

    配置文件在/etc/sshd_config,注意只有root可rw,其他所有用户权限为---。

    配置说明可参考man sshd_config。

    如果更改了服务器端口号,并且启用了SELinux,需要执行以下命令:

    semanage port -a -t ssh_port_t -p tcp YOUR_TCP_PORT

    # 使用以下命令查看更改效果

    # semanage port -l | grep "ssh"

    # ssh_port_t tcp YOUR_NEW_PORT, 22

    # 该更改复位后保持有效。

    # 如需删除,将-a替换为-d即可:

    # semanage port -d -t ssh_port_t -p tcp YOUR_TCP_PORT

    # 使用semanage port -d -t ssh_port_t -p tcp 22无法删除port 22,

    # 大意是说port 22由policy定义。待查。

    建议更改默认端口。

    另外几个建议更改的配置:

    # The time after which the server disconnects if the user has not successfully logged in.

    LoginGraceTime    30s

    # Specifies the maximum number of authentication attempts permitted per connection.

    # Once the number of failures reaches half this value, additional failures are logged. 

    MaxAuthTries    4

    # 限制root远程登录

    PermitRootLogin no

  • 相关阅读:
    Java枚举和反射
    Java网络编程
    django 中文乱码问题
    chrome 开发人员工具
    js 编码问题
    js 复制内容到剪切板
    网页获取页面上选择的内容
    git命令
    Jquery和Javascript对象之间的转换
    Spring Data Elasticsearch
  • 原文地址:https://www.cnblogs.com/byeyear/p/9289063.html
Copyright © 2011-2022 走看看