How to restrict ip addresses for ssh logon in linux
Vi/etc/hosts. allow
Sshd: 192.168.0.100: allow // allow IP address 192.168.0.100 to log on
Sshd: 192.168.0.: allow // allow IP address 192.168.0. Network Segment Login
Sshd: all: deny // disable logon from all other IP addresses
Or
Sshd: 223.227.223. *: allow // allow IP 223.227.223. * network segment Logon
Sshd: 192.168.0. *: allow // allow IP address 192.168.0. * network segment Logon
Sshd: all: deny // disable logon from all other IP addresses
Save the changes under fedora and the changes will take effect.
FreeBSD restricts ssh login from specific ip addresses:
1.
# Ee/etc/hosts. allow
Add
Sshd: 192.168.0.100: allow
Sshd: 223.227.223. *: allow
Sshd: ALL: deny
2.
Modify/etc/ssh/sshd_config
Join
Allowusers admin@172.16.2.188
Indicates
Only allow admin to log on from 172.16.2.188
Change the IP address of FreeBSD without restarting the computer:
/Etc/netstart after modification in rc. conf