zoukankan      html  css  js  c++  java
  • linux ssh连接设置

    suselinux11 ssh设置。关闭root用户连接,使用sshd用户连接。然后通过sshd用户跳转root用户。

     

    1.设置 /etc/ssh/sshd_config

     #vi /etc/ssh/sshd_config

    port 22   (使用22的端口)

    ClientAliveInterval 300   (连接300s后,记录一次超时)
    ClientAliveCountMax 0  (如果发现客户端没有相应,则判断一次超时,这个参数设置允许超时的次数)

    PermitRootLogin yes     (禁止root用户登录)

    AllowUsers sshd           (服务器加固后仅限sshd用户登录)

     

     

    2.将sshd加入用户组

    (1)/etc/pam.d/su 文件 看看下面这句是不是设成有效了
    auth required pam_wheel.so use_uid

    (2)注释SU_WHEEL_ONLY yes

    vi /etc/login.defs
    #SU_WHEEL_ONLY yes

    (3)/bin/su的权限为‘-rwsr-xr-x’

    ll /bin/su

    -rwsr-xr-x 1 root root 40016 Mar 18  2013 /bin/su

     

    3. su - root 密码正确,报错su:incorrect password

    (1)因为 /etc/pam.d/su 中auth required pam_wheel.so use_uid

    (2)需要将sshd用户加入wheel组

     #usermod sshd -g wheel

     

     4.关闭防火墙

    (1)临时关闭防火墙

    rcSuSEfirewall2_setup stop

    rcSuSEfirewall2_init stop

    (2)永久关闭防火墙

    chkconfig SuSEfirewall2_setup off   

    chkconfig SuSEfirewall2_init off 

    5.、启动ssh

    /etc/init.d/sshd start

     chkconfig sshd on    (ssh加入自动启动)

     

     

     

     

     

     

  • 相关阅读:
    Path Sum II
    Convert Sorted Array to Binary Search Tree
    Construct Binary Tree from Inorder and Postorder Traversal
    Construct Binary Tree from Preorder and Inorder Traversal
    Maximum Depth of Binary Tree
    Binary Tree Zigzag Level Order Traversal
    Binary Tree Level Order Traversal
    Same Tree
    Validate Binary Search Tree
    Binary Tree Inorder Traversal
  • 原文地址:https://www.cnblogs.com/eugenebo/p/7131128.html
Copyright © 2011-2022 走看看