ubuntu on windows (WLS)でsshdを動かす

公開:2017-02-26 19:05
更新:2020-02-15 04:37
カテゴリ:ubuntu on windows,lubuntu

lubuntu と windows 10間でファイル転送をするためにwindows 10側でsshdを構築した。 sshd自体はubuntu on windows上で動かすことにした。

動かすにあたっては、下のページあたりを参考にした。

http://qiita.com/ubnt_intrepid/items/84a56a01cf7081401917

http://fftest33.blog.fc2.com/blog-entry-121.html

ubuntu on windowsに特有な設定としては

である。それ以外はごく普通のsshdの設定でいいようだ。

設定していて気づいた点としては、

  1. hosts.allow/hosts.denyファイルを使ってIP/ポートレベルのアクセス制御が行える(TCP Wrappers?)。
  2. iptablesはubuntu on windowsでは動いていないようだ。

1.、2.ともWindowsファイアーウォールがあるからいらないけど。 ちなみにiptables -Lを実行した結果は以下であった。

sf@computer:/etc/ssh$ sudo iptables -L
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

tcp wrappersとiptablesについてはいまだにきちんと理解していない。昔はtcp wrappersだったけど、今はiptablesが主流くらいの知識くらいしかない。 https://www.sfpgmr.net/ も今はubuntuで運用しているけど、iptablesの設定はしたなあ。xinetdなんてものあるんだな。inetdなんかも実際何なのかよくわかっていなかったのだが、下のブログを見て理解できた。

http://d.hatena.ne.jp/e_c_e_t/20080319

1.なんだけど、TCP Wrappersではなくて、sshd自体がhosts.allow/hosts.denyを読んでいるとのこと。

http://blue-red.ddo.jp/~ao/wiki/wiki.cgi?page=iptables+%A4%C8+hosts.allow%A1%A2hosts.deny

実際にはsshdはinetd起動ではなくinitで起動しているので、TCPWrappersの配下にはないとも書いてあった。TCPWrappersなんていうものは今は使われていないんだなぁ。。

それにしてもこのあたりもよくわからんなあ。。