Linux.com

hosts.allow question

Link to this post 03 Sep 09

hi there,
i have a basic question about general use of /etc/hosts.allow
is it possible to have multiple lines for the same protocol ?
right now i have 1 line for vsftpd like:

vsftpd: xxx1 , xxx2, xxx3 : allow

(where xxx1,2 and 3 are IP i want to allow)
it works but its easy to forget which ip belong to who ..
i'd like to do like this if its possible:

# john doe
vsftpd: xxxx1 : allow
# smith
vsftpd: xxxx2 : allow
# michael
vsftpd: xxxx3 : allow

is it possible ?

Link to this post 04 Sep 09

I do personally have no clue but you can always read the manual for hosts.allow either by typing

man hosts.allow

or visiting this site: http://linux.die.net/man/5/hosts.allow

Link to this post 04 Sep 09

I'm going to take a stab in the dark here, please correct me if im wrong. I want to test my knowledge, without doing any research . You would like to solve the following issue : forgetting which IP belongs to specific Nodes..

Would the following syntax work? Doesn't the semicolon break the line then allow you to write notes behind it?


# IP Addresses Names
vsftpd: 12.34.56.78 ; John
12.34.56.79 ; Roger
:allow

Or maybe something like that to If the above doesn't work. and if you had mulitple lines you would start a second line of names.


# John Roger
# Chris Same
vsftpd: 12.34.56.78, 12.34.56.79

Technically you could have multiple lines because say you have 20 IP's that you need to allow. They all wouldn't fit on one line. So it would end up looking like this.


vsftpd: 12.34.56.78, 12.34.56.79, 12.34.56.78, 12.34.56.79,12.34.56.78, 12.34.56.79, 12.34.56.78, 12.34.56.79, 12.34.56.78, 12.34.56.79,12.34.56.78,
12.34.56.79, 12.34.56.78, 12.34.56.79 : allow


But that's just taking a stab in the dark... I would say, make a back up of the file and play around with it. If you get a syntax error then you know you can't do it.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board