Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to log in to restrict ip for ssh under CentOS

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to log on to restrict ip in ssh under CentOS". In daily operation, I believe that many people have doubts about how to log in to restrict ip in ssh under CentOS. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubt of "how to log in to restrict ip under CentOS". Next, please follow the editor to study!

The method of restricting ip in ssh login under linux

Vi / etc/hosts.allow

Sshd:192.168.0.100:allow / / allow IP 192.168.0.100 to log in

Sshd:192.168.0.:allow / / allows IP 192.168.0. Network segment login

Sshd:all:deny / / disable all other IP logins

Or

Sshd:223.227.223.*:allow / / allow IP 223.227.223.* network segment login

Sshd:192.168.0.*:allow / / allow IP 192.168.0.* network segment to log in

Sshd:all:deny / / disable all other IP logins

Takes effect after modification and saving under fedora

FreeBSD restricts ssh login for a particular ip:

1.

# ee / etc/hosts.allow

Add before ALL: ALL: allow

Sshd: 192.168.0.100: allow

Sshd: 223.227.223.*: allow

Sshd: ALL: deny

two。

Modify / etc/ssh/sshd_config

Join

Allowusers admin@172.16.2.188

It means

Only admin is allowed to log in from 172.16.2.188

Change FreeBSD to IP, no need to restart the computer:

After changing it in rc.conf / etc/netstart

At this point, the study on "how to log in to restrict ip in ssh under CentOS" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report