侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

限制用户从特定ip登录的两个技巧

2023-04-22 星期六 / 0 评论 / 0 点赞 / 72 阅读 / 1271 字

限制用户从特定ip登录的两个技巧由于ssh是管理员最常使用和最便简的工具,因此ssh管理是最为重要的.技巧 1 修改ssh端口/etc/ssh/sshd_config#Port 22You chang

.

 限制用户从特定ip登录的两个技巧

..由于ssh是管理员最常使用和最便简的工具,因此ssh管理是最为重要的.
技巧 1 修改ssh端口
/etc/ssh/sshd_config..#Port 22..You change the above line to (if say I want to change port to 5022):..Port 5022..[Expert@fireball]# service sshd restart..Now you connect to the firewall #ssh -p 5022 user@IP
技巧2 限制ssh用户从特定ip登录
Openssh provides the possibility to restrict access for specific user to specific IP addresses. I will look here at few potential scenarios.
Case 1 限制用户从特定ip登录 ,这里是网络 99.19.19.0/24:
在 /etc/ssh/sshd_config 最底下增加:..AllowUsers *@99.19.19.*..重启生效,只有来自99.19.19.0/24 的用户才可以登录
Case 2限制一些用户从特定ip登录但其它可以从任务地址登录...如admin可以从 LAN  10.88.88.0/24 and  WAN IP is 123.123.123.10登录,yurisk可以从任务地点登录.../etc/ssh/sshd_config 
AllowUsers [email protected] [email protected].* yurisk...

广告 广告

评论区