<div dir="ltr">Perhaps not something to have default in dropbear, put perhaps of interest for someone... <div><br></div><div>In order to restrict  access from certain ip addresses only, you can, with this patch, start a dropbear with option -S</div><div>This will only allow password logins if a corresponding file /etc/dropbear/ip_&lt;ipnumber&gt;_any.allow exists.</div><div><br></div><div>It will also check for /etc/dropbear/ip_&lt;ipnumber&gt;_&lt;username&gt;.allow for granting access to specific usernames only</div><div><br></div><div>If you start dropbear with -S -S  it will also use this restriction for pubkey validation</div><div><br></div><div>Example:</div><div><div># blocking password and pubkey from unknown locations, using a valid pubkey</div><div>root@core ~# ./dropbear -S -S  -F  -p 2022</div><div>[24472] Oct 04 12:30:21 Not backgrounding<br></div><div>[24473] Oct 04 12:30:40 Child connection from ::ffff:<a href="http://192.168.1.10:49799">192.168.1.10:49799</a></div><div>[24473] Oct 04 12:30:40 Exit before auth (user &#39;root&#39;, 0 fails): Remote address ::ffff:<a href="http://192.168.1.10:49799">192.168.1.10:49799</a> is not allowed to connect with public key or password</div></div><div><div><div><br></div><div><div># blocking password from unknown locations, using a valid pubkey</div></div><div>root@core ~# ./dropbear -S   -F  -p 2022<br></div><div>[24486] Oct 04 12:30:55 Not backgrounding<br></div><div>[24487] Oct 04 12:31:10 Child connection from ::ffff:<a href="http://192.168.1.10:49801">192.168.1.10:49801</a></div><div>[24487] Oct 04 12:31:11 Pubkey auth succeeded for &#39;root&#39; with key md5 14:07:9a:1d:d9:64:45:db:88:d8:78:62:45:1e:88:21 from ::ffff:<a href="http://192.168.1.10:49801">192.168.1.10:49801</a></div></div><div><br></div><div><div># blocking password from unknown locations, using a valid password</div><div>root@core ~# ./dropbear -S   -F  -p 2022</div><div>[24551] Oct 04 12:31:25 Not backgrounding<br></div><div>[24552] Oct 04 12:32:06 Child connection from ::ffff:<a href="http://192.168.1.10:49802">192.168.1.10:49802</a></div><div>[24552] Oct 04 12:32:09 IP access denied : file /etc/dropbear/ip_192.168.1.10_root.allow not found</div><div>[24552] Oct 04 12:32:09 IP access denied : file /etc/dropbear/ip_192.168.1.10_any.allow not found</div><div>[24552] Oct 04 12:32:09 Exit before auth (user &#39;root&#39;, 0 fails): Remote address ::ffff:<a href="http://192.168.1.10:49802">192.168.1.10:49802</a> is not allowed to connect with password</div></div><div><br></div><div># grant  connections for root from 192.168.1.10, using a valid publickey</div><div>root@core ~# touch /etc/dropbear/ip_192.168.1.10_root.allow<br></div><div>root@core ~# ./dropbear -S -S  -F  -p 2022</div><div>[24578] Oct 04 12:33:02 Not backgrounding<br></div><div>[24579] Oct 04 12:33:20 Child connection from ::ffff:<a href="http://192.168.1.10:49803">192.168.1.10:49803</a></div><div>[24579] Oct 04 12:33:20 IP access allowed : file /etc/dropbear/ip_192.168.1.10_root.allow found</div><div>[24579] Oct 04 12:33:20 Pubkey auth succeeded for &#39;root&#39; with key md5 14:07:9a:1d:d9:64:45:db:88:d8:78:62:45:1e:88:21 from ::ffff:<a href="http://192.168.1.10:49803">192.168.1.10:49803</a><br></div></div><div><br></div><div><br></div><div>Have fun with it...</div><div><br></div><div>Hans</div><div><br></div><div><br></div><div><br></div><div><br></div></div>