dropbear가 호스트.허용과 호스트 거부를 처리하나요?

dropbear가 호스트.허용과 호스트 거부를 처리하나요?

저는 dropbearDebian(실제로는 Raspbian)에서 SSH 데몬으로 실행 중입니다. 설정을 해보았습니다

# /etc/hosts.allow
dropbear:192.168.1.1
# my static ip from which I SSH connect to the device

그리고

# /etc/hosts.deny
ALL:ALL
# block all others

그런 다음 전체 장치를 다시 시작했습니다. 다른 IP 주소는 물론 원격에서도 SSH를 통해 장치에 연결할 수 있습니다. 파일을 잘못 구성했거나 dropbear이 두 파일을 지원하지 않습니까?

답변1

/etc/hosts.allowDropbear에는 및 에 대한 지원이 포함되어 있지 않습니다 /etc/hosts.deny. 이 파일은 다음에 의해 관리됩니다.TCP 래퍼libwrapDropbear가 사용하지 않는 라이브러리( )입니다. 일부 타사 패키지는 TCP 래퍼 지원을 위해 Dropbear를 패치하지만 Debian은 패치하지 않습니다.

다음을 통해 Dropbear를 시작할 수 있습니다.tcpdTCP 래퍼 지원을 받으려면

/usr/sbin/tcpd /usr/sbin/dropbear -i

IP 주소로만 필터링하려면 iptables를 사용하면 됩니다.

iptables -A INPUT -p tcp ! --dport 22 -j DROP

답변2

노력하다:

# /etc/hosts.deny
sshd:ALL:spawn /bin/echo  the ip %h tried to access `/bin/date`>> /var/log/ssh.log

그리고

# /etc/hosts.allow
sshd:192.168.1.1

작동하지 않으면 이 방법으로 dropbear를 다시 사용해 보세요.

# /etc/hosts.deny
dropear:ALL:spawn /bin/echo  the ip %h tried to access `/bin/date`>> /var/log/ssh.log

그리고

# /etc/hosts.allow
dropbear:192.168.1.1

dropbear가 tcp/wrappers를 지원하는지 확인하세요.

ldd /path/to/dropbear

찾다libwrap.so.0 → /lib/libwrap.so.0

관련 정보