Raspberry Pi セキュリティ対策

認証

パスワードを設定

rootとpiユーザのパスワードを設定する

sudo passwd root
passwd pi

sudo時のパスワード省略を禁止

/etc/sudoers.d/010_pi-nopassword ファイルを編集する。
属性が読み取り専用になっているので一旦書き込み許可後に編集を行う。
保存後直ちに反映される。

編集前

pi ALL=(ALL) NOPASSWD: ALL

編集後

#pi ALL=(ALL) NOPASSWD: ALL

OSの定期的な更新

unattended-upgradesを設定し定期的にOSが更新されるようにする。

sudo apt install unattended-upgrades

sshd

公開鍵暗号による認証に限定する。

ポート番号をデフォルト22から変更する。

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny

タイトルとURLをコピーしました