1.Kettle Spoon的[Run SSH commands]連線異常
2.下載Arthas並執行,附加到/<Kettle目錄>/launcher/launcher.jar
3.在GitHub搜尋source code,得知進行SSH連線的元件是com.trilead.ssh2,方法是connect
4.輸入tt -t com.trilead.ssh2.Connection connect監控connect方法
5.回到Spoon,點擊[Test connection]按鈕重現錯誤,記下INDEX數字(本例為1000)
6.輸入tt -i 1000 -w 'target.connect'觸發錯誤
7.查看~/logs/arthas/arthas.log,發現"Caused by: java.io.IOException: Cannot negotiate, proposals do not match"的異常
8.查詢此錯誤為SSH演算法不相容,修改伺服端主機的/etc/ssh/sshd_config,
MACS區段加入hmac-sha1-96,Kexalgorithms區段加入diffie-hellman-group-exchange-sha1
※Windows主機為%programdata%\ssh\sshd_config
新增內容如下
Match Group administrators
AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
Match all<--如果有Match Group要加這行關閉Match block
# Pentaho Kettle [Run SSH commands]
Kexalgorithms +diffie-hellman-group-exchange-sha1
MACS +hmac-sha1-96
HostKeyAlgorithms +ssh-rsa,ssh-dss<--Windows主機再加這行
9.重啟SSH服務
10.Kettle Spoon的[Run SSH commands]連線即正常
PS:Arthas誠為神器也
PS:sshd啟用log紀錄會很有幫助