nerdexam
Red_Hat

RH302 · Question #186

ssh service is enabled in your Server. Your LAN is connected to WAN also. Configure to match following conditions. i. Deny the ssh from outside the example.com domain members. ii. If any denied…

1. vi /etc/hosts.deny sshd:ALL EXCEPT .example.com: spawn echo "Logging attempt from %c to %s" | mail -s "Login from denied hosts" root We can secure the services using tcp_wrappers. There are main two files, /etc/hosts.allow and /etc/hosts.deny. There will be three stage…

Security

Question

ssh service is enabled in your Server. Your LAN is connected to WAN also. Configure to match following conditions. i. Deny the ssh from outside the example.com domain members. ii. If any denied hosts tried for ssh then send the information through mail with client;s information.

Explanation

  1. vi /etc/hosts.deny sshd:ALL EXCEPT .example.com: spawn echo "Logging attempt from %c to %s" | mail -s "Login from denied hosts" root We can secure the services using tcp_wrappers. There are main two files, /etc/hosts.allow and /etc/hosts.deny. There will be three stage access checking -Is access explicitly permitted? Means permitted from /etc/hosts.allow?
  • Otherwise, is access explicitly denied? Means denied from /etc/hosts.deny?
  • Otherwise, by default permit access if neither condition matched. To deny the services we can configure /etc/hosts.deny file using ALL and EXCEPT operation. Pattern of /etc/hosts.allow and /etc/hosts.deny file is: Demon_list:client_list:options In Client list can be either domain name or IP address.

Topics

#SSH#TCP wrappers#hosts.deny#security notification

Community Discussion

No community discussion yet for this question.

Full RH302 Practice