vlock コマンドで tmux をロックする

現在ターミナルマルチプレクサは Byobu 経由で GNU screen と tmux を環境により併用しています.GNU screen では画面ロックの設定をしていたのですがtmux は設定していなかったので今回 console lock コマンドの vlock を設定してみました.

導入
$ sudo apt install vlock
help
$ vlock -h
vlock: locks virtual consoles, saving your current session.
Usage: vlock [options] [plugins...]
	   Where [options] are any of:
-c or --current: lock only this virtual console, allowing user to
	   switch to other virtual consoles.
-a or --all: lock all virtual consoles by preventing other users
	   from switching virtual consoles.
-n or --new: allocate a new virtual console before locking,
	   implies --all.
-s or --disable-sysrq: disable SysRq while consoles are locked to
	   prevent killing vlock with SAK
-t <seconds> or --timeout <seconds>: run screen saver plugins
	   after the given amount of time.
-v or --version: Print the version number of vlock and exit.
-h or --help: Print this help message and exit.
カレントコンソールをlock してみる.何かキーを押した後ユーザのパスワードを入力することで復帰できる.
$ vlock -c
This TTY is now locked.

Please press [ENTER] to unlock.
matoken's Password:
全てのコンソールをロックする.ロック状態で Alt + n で他のコンソールに移動しても全てロックされている.
$ vlock -a
The entire console display is now completely locked.
You will not be able to switch to another virtual console.

Please press [ENTER] to unlock.
matoken's Password:
$ tty
/dev/tty1
仮想コンソール(Xの端末, ターミナルマルチプレクサ, script等)では全てのロックは失敗する
$ vlock -a
vlock: this terminal is not a virtual console
$ tty
/dev/pts/9
tmux に設定してみる(byobu 経由の場合)
$ cat ~/.byobu/.tmux.conf
# Enable locking(I need vlock -> sudo apt install vlock)
set -g lock-command vlock
set -g lock-after-time 0
bind l lock-session

.tmux.conf に設定した状態で tmux を起動して Ctrl+b l と押すと vlock でロックされます.セッション単位でロックされます.

ちなみに X では xscreensaver-command -activate を設定しています.例えば以下は awesome wm で Mod4 + l に設定してあります.

    -- lock screen
    awful.key({ "Mod1"  }, "l", function () awful.util.spawn( "xscreensaver-command -activate",false) end),
環境1
$ dpkg-query -W byobu screen tmux vlock
byobu   5.129-1
screen  4.6.2-3
tmux    2.8-3
vlock   2.2.2-8
$ hostnamectl | egrep 'Operating System|Architecture'
  Operating System: Debian GNU/Linux 10 (buster)
      Architecture: x86-64

crontab の実行タイミングをわかりやすく表示してくれる cronv を試す

ちょっと試したら少し嵌ったのでメモがてら.

build
$ go get github.com/takumakanari/cronv/cronv
$ go build -o ./cronv github.com/takumakanari/cronv/cronv
Usage
$ ./cronv -h
Usage:
  Cronv v0.4.1 [OPTIONS]

Application Options:
  -o, --output=    path to .html file to output (default: ./crontab.html)
  -d, --duration=  duration to visualize in N{suffix} style. e.g.) 1d(day)/1h(hour)/1m(minute) (default: 6h)
      --from-date= start date in the format '2006/01/02' to visualize (default: 2019/05/25)
      --from-time= start time in the format '15:04' to visualize (default: 02:50)
  -t, --title=     title/label of output (default: Cron Tasks)
  -w, --width=     Table width of output (default: 100)

Help Options:
  -h, --help       Show this help message
実行
$ crontab -l | ./cronv

2019-06-01 ADD: 以下のtab が含まれているときにエラーとなる問題は修正されました😖

しかし,missing field(s) とか syntax error in year field: とかのエラーになってしまう.

$ printf "* * * * *\tcommand\n"
* * * * *       command
$ printf "* * * * *\tcommand\n" | ./cronv
panic: Failed to analyze cron '* * * * *        command': syntax error in year field: 'command'

goroutine 1 [running]:
panic
        ../../../src/libgo/go/runtime/panic.go:554
main.main
        /home/mk/go/src/github.com/takumakanari/cronv/cronv/main.go:33

タブ区切りをやめてスペース区切りにするとエラーが出ない

$ printf "* * * * * command\n" | ./cronv
[Cron Tasks] 1 tasks.
[Cron Tasks] './crontab.html' generated.

ということでとりあえずタブをスペースに変換することにした.

$ crontab -l | tr -s '\t' ' ' | ./cronv
[Cron Tasks] 8 tasks.
[Cron Tasks] './crontab.html' generated.

作成された crontab.html を w3m で……ほとんど表示されない.

20190525 03 36 35 001

もう少しリッチな JavaScript の動くウェブブラウザで開くとOK.
これからの6時間分の様子が見える.

20190525 03 00 01 001

-d, --duration option で表示する時間間隔が指定できる.
開始日時は,--fron-date, --from-time option で指定できる.
以下の例では 2019-05-25 00:00:00 から1日分の表示になる.

$ crontab -l | tr -s '\t' ' ' | ./cronv -d 1d --from-date=2019/05/25 --from-time=00:00

20190525 02 58 37 001

ちなみに1ヶ月も試したが,ウェブブラウザで表示するのにとても時間が掛かった.

環境
$ dpkg-query -W cron gccgo-go
cron    3.0pl1-128.1ubuntu1
gccgo-go        2:1.10~4ubuntu1
$ lsb_release -d
Description:    Ubuntu 18.04.2 LTS
$ uname -m
x86_64

nanoを消したDebianでエディタの警告が出るのを修正

vim使うのでnanoを消しているのですが警告が出ています.

$ sudo crontab -e
/usr/bin/sensible-editor: 25: /usr/bin/sensible-editor: /bin/nano: not found
/usr/bin/sensible-editor: 28: /usr/bin/sensible-editor: nano: not found
/usr/bin/sensible-editor: 31: /usr/bin/sensible-editor: nano-tiny: not found
crontab: installing new crontab

fallback?でvimに切り替わるので実害はないのですが気持ち悪い.
警告を出している sensible-editor を確認.

$ man sensible-editor|more
SENSIBLE-EDITOR(1)                                         General Commands Manual                                         SENSIBLE-EDITOR(1)

NAME
       sensible-editor, sensible-pager, sensible-browser - sensible editing, paging, and web browsing

SYNOPSIS
       sensible-editor [OPTIONS...]
       sensible-pager [OPTIONS...]
       sensible-browser url

DESCRIPTION
       sensible-editor,  sensible-pager and sensible-browser make sensible decisions on which editor, pager, and web browser to call, respec‐
       tively.  Programs in Debian can use these scripts as their default editor, pager, or web browser or emulate their behavior.

SEE ALSO
       Documentation of the EDITOR, VISUAL and PAGER variables in environ(7) and select-editor(1) for changing a user's default editor

STANDARD
       Documentation of behavior of sensible-utils under a debian system is available under section 11.4 of debian-policy  usually  installed
       under /usr/share/doc/debian-policy (you might need to install debian-policy)

Debian                                                           14 Nov 2010                                               SENSIBLE-EDITOR(1)

select-editor を実行するとインストール済のエディタを選択できる.

$ sudo select-editor

Select an editor.  To change later, run 'select-editor'.
  1. /usr/bin/vim.gtk3
  2. /usr/bin/vim.nox
  3. /usr/bin/vim.basic
  4. /usr/bin/mcedit
  5. /usr/bin/vim.tiny
  6. /usr/bin/vscodium

Choose 1-6 [1]: 2

警告が出なくなりました :)

$ sudo crontab -e
crontab: installing new crontab

環境

$ dpkg-query -W sensible-utils cron vim
cron    3.0pl1-133
sensible-utils  0.0.12
vim     2:8.1.0875-2
$ lsb_release -dr
Description:    Debian GNU/Linux 10 (buster)
Release:        10
$ uname -m
x86_64

色々なプログラムで proxy を使えるようにする proxychains-ng を試す

proxychains-ng というものを見かけたので試してみます.ネットワーク関連の関数をフックして,SOCKS 4a, 5, HTTP proxy を利用できるようにします.
torsocks的な感じ.

とりあえずこんな感じで動きました

$ git clone https://github.com/rofl0r/proxychains-ng
$ cd proxychains-ng
$ ./configure && make

src/proxychains.confにtorの設定が書いてあるのでとりあえずそれで動かします.(tor daemon が動いている前提)
1回目はtimeoutに,2回目は成功.

$ ./proxychains4 -f src/proxychains.conf curl ifconfig.me/ip
  :
[proxychains] Strict chain  ...  127.0.0.1:9050  ...  ifconfig.me:80 <--socket error or timeout!
curl: (7) Couldn't connect to server
$ ./proxychains4 -f src/proxychains.conf curl ifconfig.me/ip
  :
[proxychains] Strict chain  ...  127.0.0.1:9050  ...  ifconfig.me:80  ...  OK
158.69.192.239

torsocksでは起動しないfirefox も起動した.

$ ./proxychains4 -f src/proxychains.conf firefox

Debian package にも proxychains4 という名前であった.こっちのほうが楽ですね.

$ apt show proxychains4
Package: proxychains4
Version: 4.13-4
Priority: optional
Section: net
Source: proxychains-ng
Maintainer: Boyuan Yang <byang@debian.org>
Installed-Size: 45.1 kB
Provides: proxychains, proxychains-ng
Depends: libproxychains4 (= 4.13-4), libc6 (>= 2.4)
Breaks: proxychains (<< 3.1-8)
Replaces: proxychains
Homepage: https://github.com/rofl0r/proxychains-ng
Download-Size: 14.1 kB
APT-Sources: http://ftp.jp.debian.org/debian sid/main amd64 Packages
Description: redirect connections through socks/http proxies (proxychains-ng)
 Proxychains is a UNIX program, that hooks network-related libc functions
 in dynamically linked programs via a preloaded DLL (dlsym(), LD_PRELOAD)
 and redirects the connections through SOCKS4a/5 or HTTP proxies.
 It supports TCP only (no UDP/ICMP etc).
 .
 This project, proxychains-ng, is the continuation of the unmaintained
 proxychains project (known as proxychains package in Debian).
$ sudo apt install proxychains4
$ $ proxychains4 curl ifconfig.me/ip
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.13
[proxychains] Strict chain  ...  127.0.0.1:9050  ...  ifconfig.me:80  ...  OK
94.230.208.147

環境

$ lsb_release -dr
Description:    Debian GNU/Linux 10 (buster)
Release:        10
$ uname -m
x86_64

apt upgrade で ping(inetutils-ping) が壊れていると言われて失敗する

Debian sid amd64 環境で,apt upgrade するとこんなエラーで失敗しました.

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree     
Reading state information... Done    
Calculating upgrade... Done          
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.         
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 inetutils-ping : Conflicts: ping
E: Broken packages 

ping コマンドはあるし実行も出来る.reinstall してみましたがエラーは解消されず.

$ sudo apt install --reinstall inetutils-ping                                                                     
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  python-newt
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 57 not upgraded.
Need to get 0 B/226 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 472864 files and directories currently installed.)
Preparing to unpack .../inetutils-ping_2%3a1.9.4-7_amd64.deb ...
Unpacking inetutils-ping (2:1.9.4-7) over (2:1.9.4-7) ...
Setting up inetutils-ping (2:1.9.4-7) ...
Processing triggers for man-db (2.8.5-2) ...

一時的に削除してみました.

$ sudo apt remove inetutils-ping
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  python-newt
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
  inetutils-ping
0 upgraded, 0 newly installed, 1 to remove and 57 not upgraded.
After this operation, 358 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 472864 files and directories currently installed.)
Removing inetutils-ping (2:1.9.4-7) ...
Processing triggers for man-db (2.8.5-2) ...

削除した後 apt upgrade を試すと通りました.

$ sudo apt upgrade

その後 ping を install し直したあと upgrade を試すとエラーは出なくなりました.

$ sudo apt install inetutils-ping
$ sudo apt upgrade>/dev/null 2>&1;echo $?
0

原因がよくわからないですね…….

環境

$ dpkg-query -W apt inetutils-ping
apt     1.8.0
inetutils-ping  2:1.9.4-7
$ lsb_release -dr
Description:    Debian GNU/Linux 10 (buster)
Release:        10
$ uname -m
x86_64

dhcp パケットをキャプチャするメモ

tcpdumpの場合
$ sudo tcpdump -i wlp3s0 port 67 or port 68 -e -n
[sudo] password for matoken:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlp3s0, link-type EN10MB (Ethernet), capture size 262144 bytes
21:07:44.898511 00:23:15:5b:a6:60 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:23:15:5b:a6:60, length 300
dhcpdump も読みやすくて便利
$ sudo dhcpdump -i wlp3s0
  TIME: 2019-04-10 21:17:17.398
	IP: 0.0.0.0 (0:23:15:5b:a6:60) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
	OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 011d073a
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 00:23:15:5b:a6:60:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         3 (DHCPREQUEST)
OPTION:  50 (  4) Request IP address        192.168.1.5
OPTION:  12 (  5) Host name                 x201i
OPTION:  55 ( 17) Parameter Request List      1 (Subnet mask)
											 28 (Broadcast address)
											  2 (Time offset)
											  3 (Routers)
											 15 (Domainname)
											  6 (DNS server)
											119 (Domain Search)
											 12 (Host name)
											 44 (NetBIOS name server)
											 47 (NetBIOS scope)
											 26 (Interface MTU)
											121 (Classless Static Route)
											 42 (NTP servers)
											249 (MSFT - Classless route)
											 33 (Static route)
											252 (MSFT - WinSock Proxy Auto Detect)
											 17 (Root path)


--------------------


^C

apt/apt-get のエイプリルフール牛さん

昨夜なんとなく apt コマンドのイースターエッグの apt moo を実行してみました.するといつもとは違った牛が!

20190402 00 04 09 23354

Debian sid 環境だったのでもしかしてキャラクター変更されたのだろうかと思ったのですがしばらくしてから再度実行するといつもの牛.

20190402 20 04 14 16775

時計を見ると日付が04/01から04/02に変わったところでした.
04/01に出現したってことはエイプリルフールな牛かな?と faketime command を利用して1日前にして実行すると出てきました.

$ faketime -f '-1d' apt moo
               _     _
              (_\___( \,
                )___   _  Have you smashed some milk today?
               /( (_)-(_)    /
    ,---------'         \_
  //(  ',__,'      \  (' ')
 //  )              '----'
 '' ; \     .--.  ,/
    | )',_,'----( ;
    ||| '''     '||

若しくは04/01を指定

$ faketime '20190401' apt moo
               _     _
              (_\___( \,
                )___   _  Have you smashed some milk today?
               /( (_)-(_)    /
    ,---------'         \_
  //(  ',__,'      \  (' ')
 //  )              '----'
 '' ; \     .--.  ,/
    | )',_,'----( ;
    ||| '''     '||

多分この辺ですね

$ grep -A21 bool\ DoMooApril ./apt-private/private-moo.cc
static bool DoMooApril()                                                /*{{{*/
{
   // by Christopher Allan Webber and proposed by Paul Tagliamonte
   // in a "Community outreach": https://lists.debian.org/debian-devel/2013/04/msg00045.html
   if (_config->FindI("quiet") >= 2)
   {
      std::cerr << "Have you smashed some milk today?" << std::endl;
      return true;
   }
   c1out <<
      "               _     _\n"
      "              (_\\___( \\,\n"
      "                )___   _  Have you smashed some milk today?\n"
      "               /( (_)-(_)    /\n"
      "    ,---------'         \\_\n"
      "  //(  ',__,'      \\  (' ')\n"
      " //  )              '----'\n"
      " '' ; \\     .--.  ,/\n"
      "    | )',_,'----( ;\n"
      "    ||| '''     '||\n";
   return true;
}

1.4 で入ったぽい?

$ zgrep -A2 \(1.4\) /usr/share/doc/apt/changelog.gz
apt (1.4) unstable; urgency=medium

  * The April Fools' Release

ちなみに moo moo でカラフルな牛が出てこないときは,APT::Moo::Color オプションが使えるようです.(エイプリルフール牛は単色のみみたい)

20190402 20 04 40 17194

永続化する場合や色をカスタマイズしたい場合は /usr/share/doc/apt/examples/configure-index.gz を参考に /etc/apt/apt.conf に設定すればok.

$ zgrep moo::color /usr/share/doc/apt/examples/configure-index.gz
apt::moo::color "<BOOL>";
$ echo 'apt::moo::color "true";' | sudo tee -a /etc/apt/apt.conf
apt::moo::color "true";
$ dpkg-query -W apt faketime
apt     1.8.0
faketime        0.9.7-3
$ lsb_release -dr
Description:    Debian GNU/Linux buster/sid
Release:        unstable
$ uname -m
x86_64

Ubuntu Server インストーラの Github, Launchpad からの ssh公開鍵インポート機能

github.com/settings/keys からSSH Keyとして突っ込んどくと便利だし、今のUbuntu Serverはセットアップでそれを使う項目すらあるので

なるほど便利そう
試してみようと Ubuntu Server 18.04.2 LTS
(ubuntu-18.04.2-live-server-amd64.iso) のインストーラで試してみました.

OpenSSH を導入するようにすると,SSH鍵をインポートするオプションで Github / Launchpad が選べます.
Screenshot ubuntu18 04 2019 03 30 13 02 56

こんな感じでインポートされました.
Screenshot ubuntu18 04 2019 03 30 13 05 37

インストールが終了して ssh login するとインポートされた鍵で login 出来ました.

インポートされた公開鍵を確認するとコメント部分が少し書き換わっています.

$ cat ~/.ssh/authorized_keys
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPgwY9aZPxN/YoBBzd7TOcCk7EuGO0E9PuUjCHPtTuHP matoken@github/16598604 # ssh-import-id gh:matoken
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEoKnbjj7cVafcAJbYHqUEua1x/81uzoK0LnjgqmR6H8 matoken@github/33364582 # ssh-import-id gh:matoken

sshd_config を見ると編集ではなく末尾に追記してるのでちょっと雑い感.

$ grep PasswordAuthentication /etc/ssh/sshd_config
#PasswordAuthentication yes
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication, then enable this but set PasswordAuthentication
PasswordAuthentication no
$ tail -1 /etc/ssh/sshd_config
PasswordAuthentication no

ちなみに,Github から鍵を入手するのはこんな感じで行けるようです.
(<USERNAME>部分を該当ユーザ名に修正)

Launchpad はこんな感じ.

ちなみにLaunchpad は未だED25519形式には未対応なようです.
20190330 13 03 12 27418

Bitbucket の鍵も同様に https://api.bitbucket.org/2.0/users/<USERNAME>/ssh-keys で入手できそうと思ったのですが,未認証では駄目みたいです.

$ curl -s https://api.bitbucket.org/2.0/users/matoken/ssh-keys|jq
{
  "type": "error",
  "error": {
    "message": "This API is only accessible with the following authentication types: session, password, apppassword"
  }
}
環境
$ lsb_release -d
Description:	Ubuntu 18.04.2 LTS
$ uname -m
x86_64

ansible-tower setupメモ

「Ansibleもくもく会 (サーバ編)2019.03 in オイシックス・ラ・大地!」にリモート枠が!鹿児島からでも参加できそうと申し込みました.

参加するに当たってAWSの環境が用意されるようだけど手元の回線は不安定だし勉強会後のことも考えると手元にも環境を用意しておいたほうが良さそうということで以下のページを参考にセットアップしました.その時つまずいたときのメモです.

※Debian sid amd64 上のKVM 環境に CentOS7 x86_64 環境を用意してその中で設定しました. ansible-tower-setup のバージョンはlatest で 3.4.2-1 でした.

setup.sh の実行は tower ディレクトリの下で

Step2 で,setup.shを実行するとリポジトリが見つからずエラーとなる

$ sudo ./ansible-tower-setup-$VERSION.el7/setup.sh
https://releases.ansible.com/ansible-tower/rpm/dependencies//epel-7-x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

以下のあたりでバージョンを取得している

ansible-tower-setup-3.4.2-1/setup.sh:baseurl=$AW_REPO_URL/rpm/dependencies/$(grep version group_vars/all | grep -o ':digit:.:digit:')/epel-$1-x86_64

tower のディレクトリに降りて実行すればok

$ cd ansible-tower-setup-3.4.2-1
$ sudo ./setup

実行環境のRAM は4GB 以上に

RAM 512MBで setup.sh を実行するとエラー.RAMが足りないらしい.

TASK [preflight : Preflight check - Fail if this machine lacks sufficient RAM.] ***********************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "This machine does not have sufficient RAM to run Ansible Tower."}
        to retry, use: --limit @/home/matoken/ansible-tower-setup-3.4.2-1/install.retry

システム要件を確認すると4GB のRAM が必要らしい

4 GB RAM minimum for Tower installations

なそ
にん

時間がないときは LIMITED FEATURES UP TO 10 NODES ライセンスを選択

ADD) もくもく会ではこれとは別のURLから Red Hat Ansible Tower, Standard (10 Managed Nodes) Trial を入手して利用した.以下の LIMITED FEATURES UP TO 10 NODES では最後のあたりで詰まる.(Exercise 3 の Step 4 で「ADD SURVEY」ボタンが出てこない)

ENTERPRISE FEATURES の場合人力みたい

An Ansible representative will be reaching out to you within one business day with your Ansible Tower enterprise features trial license key.

LIMITED FEATURES UP TO 10 NODES だとすぐにメールで届いた

You should receive an email shortly with your Ansible Tower Basic Edition trial license key.

試した環境

$ cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
$ uname -m
x86_64

Endlessh を使って ssh 接続をとてもゆっくりと処理して攻撃者に嫌がらせをする

ssh は攻撃が多いです.公開鍵認証にしておくと大分侵入に強くなりますがインターネットに直接繋がっているサーバでは攻撃はとても多いです.

Endlessh はsshd の代わりに起動してバージョン情報を送る前のデータにほぼランダムな文字列をゆっくりと配信し続けて攻撃者の足止めをするプログラムのようです.
本当の sshd は別ポートで起動してそっちを使う感じでしょうか.22番を無くして port knocking や sslh を使うなどのほうがいいかもですが面白そうです.

ということで手元で少し試してみました.

導入とビルド
$ git clone https://github.com/skeeto/endlessh
$ cd endlessh
$ git log |head -1
commit 548a7b1521b2912e7e133d0d9df50e0e514f1f2c
$ make
port 22222 で起動
$ ./endlessh -v -p22222 &
[1] 22698
2019-03-24T04:56:10.338Z Port 22222
2019-03-24T04:56:10.338Z Delay 10000
2019-03-24T04:56:10.338Z MaxLineLength 32
2019-03-24T04:56:10.338Z MaxClients 4096
ssh 接続してみると700分ほど捕まえていた
$ time ssh localhost -p 22222
2019-03-24T04:56:19.510Z ACCEPT host=::1 port=59402 fd=4 n=1/4096
ssh_exchange_identification: No banner received

real    700m30.650s
user    0m0.040s
sys     0m0.240s
2019-03-24T16:37:00.162Z CLOSE host=::1 port=59402 fd=4 time=42040.652 bytes=73944
終了
$ kill %1
[1]+  Done                    ./endlessh -v -p22222

数回試しましたが,標準オプションでは700分前後捕まりました.単にありもののscriptを動かすレベルの攻撃者であればツールが対応するまでは妨害になりそうです.

環境
$ git log |head -1
commit 548a7b1521b2912e7e133d0d9df50e0e514f1f2c
$ dpkg-query -W openssh-client
openssh-client  1:7.9p1-9
$ lsb_release -dr
Description:    Debian GNU/Linux buster/sid
Release:        unstable
$ uname -m
x86_64