I want to allow SSH logins only from 3 IP addresses: 111.111.111.111 and 222.222.222.222 and 333.333.333.333. I know, I have to edit /etc/hosts.allow and /etc/hosts.deny files.
My question is about the content of these files. I have seen different variants:
# /etc/hosts.allow
Variant 1:
sshd: 111.111.111
sshd: 222.222.222
sshd: 333.333.333
Variant 2:
sshd: 111.111.111, 222.222.222, 333.333.333
Variant 3: (without commas):
sshd: 111.111.111 222.222.222 333.333.333
Variant 4 (with sshdfwd-X11):
sshd,sshdfwd-X11: 111.111.111 222.222.222 333.333.333
/etc/hosts.deny
Variant 1:
sshd: ALL
Variant2:
sshd,sshdfwd-X11:ALL
Which is the correct one? I am afraid to lock me out. Thanks.