ぼっちサーファーのブログ

一人海外サーフトリップの記録と雑記

Kusanagiをyum updateしたらSSHログインできなくなったときの対処法

2018/6/6〜25までバリ島一人サーフトリップの記録

リアルタイム更新の記事はこちら

先日Kusanagiをyum update したらSSHログインできなくなった。

firewalldもアップデートされたので設定ファイルが上書きされてしまったことが原因。


Update前は「/usr/lib/firewalld/services/ssh.xml」を編集してsshポートを22から任意のポートに変更していた。

<?xml version="1.0" encoding="utf-8"?>
 <service>
 <short>SSH</short>
 <description>Secure Shell (SSH) is a protocol for logging into and executing commands on remote machines. It provides secure encrypted communications. If you plan on acc    essing your machine remotely via SSH over a firewalled interface, enable this option. You need the openssh-server package installed for this option to be useful.</description>
 <port protocol="tcp" port="[任意のポート]"/>
</service>


しかし本来「/usr/lib/firewalld/services/ssh.xml」は変更するべきでなく「/etc/firewalld/services」にコピーしてから使うべきだった。

firewalld.org

cp /usr/lib/firewalld/services/ssh.xml /etc/firewalld/services/ssh.xml


「/etc/firewalld」はデフォルトのセッティングを上書きするがupdateの影響を受けない。
WordPressの子テーマ的な感じ。


基本的な設定ミスだけどヒヤッとしたので今後気をつけよう。