LAN インターフェイスで ProFTPd アクセスが拒否されました。

LAN インターフェイスで ProFTPd アクセスが拒否されました。

私のホームFTPサーバーで非常に奇妙なアクセス拒否の問題が発生しました。症状は、ワイヤレスインターフェイスを介してのみアクセスできることです。 Wi-Fiを無効にしてイーサネットを使用すると、アクセスが拒否されます。

NcFTP 3.2.5 (Feb 02, 2011) by Mike Gleason (http://www.NcFTP.com/contact/).
ncftp> debug 1
ncftp> open 192.168.1.134
> open 192.168.1.134

LibNcFTP 3.2.5 (January 17, 2011) compiled for linux-x86_64-glibc2.21                                                                                                                                                                                                           
Uname: Linux|Korhal|4.4.0-87-generic|#110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017|x86_64
Contents of /etc/debian_version:
  stretch/sid
Contents of /etc/issue:
  Ubuntu 16.04.3 LTS \n \l
Glibc: 2.23 (stable)
Remote server is running ProFTPD.

ProFTPD 1.3.4d Server (foxnfish FTP Server) [::ffff:192.168.1.134]
220: ProFTPD 1.3.4d Server (foxnfish FTP Server) [::ffff:192.168.1.134]                                                                                                                                                                                                         
Connected to 192.168.1.134.
Cmd: USER anonymous
331: Anonymous login ok, send your complete email address as your password
Cmd: PASS NcFTP@
530: Access denied
Access denied
Cmd: QUIT
221: Goodbye.

私のifconfigの出力

enp0s25   Link encap:Ethernet  HWaddr 00:1c:25:78:d5:06  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: **** Scope:Link
          inet6 addr: **** Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29531724 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4256164 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:42081203522 (42.0 GB)  TX bytes:851356778 (851.3 MB)
          Interrupt:20 Memory:fe200000-fe220000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:198 errors:0 dropped:0 overruns:0 frame:0
          TX packets:198 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:16160 (16.1 KB)  TX bytes:16160 (16.1 KB)

wls3      Link encap:Ethernet  HWaddr 00:1f:3b:04:58:59  
          inet addr:192.168.1.143  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: **** Scope:Global
          inet6 addr: **** Scope:Link
          inet6 addr: ****/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:303586 errors:0 dropped:0 overruns:0 frame:0
          TX packets:157656 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:452487811 (452.4 MB)  TX bytes:15696186 (15.6 MB)

Proftd 構成ファイル

ServerName "foxnfish FTP Server"
ServerType standalone
DefaultServer on
DefaultAddress foxnfish
UseIPv6 on
Port 21
User nobody
Group nogroup
Umask 000 000
SyslogFacility ftp
MultilineRFC2228 off
DisplayLogin /var/run/proftpd/proftpd.motd
DeferWelcome off
TimeoutIdle 600
TimeoutLogin 300
TimeoutNoTransfer 300
TimeoutStalled 3600
MaxInstances none
MaxClients 5
MaxConnectionsPerHost 10
MaxLoginAttempts  1
DefaultTransferMode ascii
IdentLookups off
UseReverseDNS off

<Limit LOGIN>
  AllowGroup ftp
  DenyAll
</Limit>

<Global>
  RequireValidShell off
  DefaultRoot ~ !wheel
  AllowOverwrite on
  DeleteAbortedStores off
  TimesGMT off
</Global>

<IfModule mod_ban.c>
  BanEngine off
  BanControlsACLs all allow group wheel
  BanLog /var/log/proftpd/ban.log
  BanMessage Host %a has been banned
  BanTable /var/run/proftpd/ban.tab
</IfModule>

<IfModule mod_delay.c>
  DelayEngine on
  DelayTable "/var/run/proftpd/proftpd.delay"
</IfModule>

<IfModule mod_wrap.c>
  TCPAccessFiles /etc/hosts.allow /etc/hosts.deny
  TCPAccessSyslogLevels info warn
  TCPServiceName ftpd
</ifModule>    

/etc/hosts.allow

#ftpd  : xxx.xxx.xxx.xxx : deny
#sshd : .example.com : deny
#in.tftpd : xxx.xxx.xxx.xxx : deny
#bsnmpd : xxx.xxx.xxx.xxx : deny
ALL : ALL : allow

/etc/hosts.denyが空です。

何が間違っている可能性がありますか?

ベストアンサー1

ヒントをくれた@wurtelに感謝します。 proftpDの設定ファイルを確認したところ、ホスト.allowとホスト.拒否という2つのファイルがあることがわかりました。これら2つのファイルの内容は無害に見えますが。

/etc/hosts.allow

#ftpd  : xxx.xxx.xxx.xxx : deny
#sshd : .example.com : deny
#in.tftpd : xxx.xxx.xxx.xxx : deny
#bsnmpd : xxx.xxx.xxx.xxx : deny
ALL : ALL : allow

/etc/hosts.denyが空です。

サーバーログをさらに確認し、これらのエラーログを見つけました。

Feb 18 21:51:55 foxnfish proftpd[19657]: 192.168.1.134 (192.168.1.2[192.168.1.2]) - mod_wrap/1.2.4: using access files: /etc/hosts.allow, /etc/hosts.deny 
Feb 18 21:51:55 foxnfish proftpd[19657]: 192.168.1.134 (192.168.1.2[192.168.1.2]) - mod_wrap/1.2.4: refused connection from ::ffff:192.168.1.2 
Feb 18 21:54:15 foxnfish proftpd[19659]: 192.168.1.134 (192.168.1.146[192.168.1.146]) - mod_wrap/1.2.4: using access files: /etc/hosts.allow, /etc/hosts.deny 
Feb 18 21:54:15 foxnfish proftpd[19659]: 192.168.1.134 (192.168.1.146[192.168.1.146]) - mod_wrap/1.2.4: allowed connection from iMac.xxx.xxx.xxx.net 

したがって、ワイヤレス接続の場合、ソースアドレスはローカルドメインホスト形式で解決されます。ちなみに、イーサネットから接続する際、送信元アドレスは奇妙なIPです。私はそれがHost.allowと一致しないと思います。

これはNas4Freeバージョンが組み込まれているため、実際にホスト.許可ファイルを変更することはできません。クイック修正はproftpd_modwrap_enableを完全にオフにすることです。

Nas4FreeでproftpDを使用している場合は、proftpd_modwrap_enableをNOに設定してこのモジュールをオフにできます。System|Advanced|rc.conf

おすすめ記事