Contenu connexe
Similaire à Raspberry Piで始める自宅サーバー超入門 (20)
Plus de VirtualTech Japan Inc./Begi.net Inc. (20)
Raspberry Piで始める自宅サーバー超入門
- 3. 標準OSはRaspberry Pi OS
• サーバー用ならデスクトップ環境は要らな
いのでLite版を導入
• Raspberry Pi Imagerでインストールできる
のは32ビット版
– 64ビット版が欲しい人はイメージを手動ダウン
ロード
– http://downloads.raspberrypi.org/raspios_lite_a
rm64/images/
3
- 4. Ubuntu Serverもよいかも?
• Raspberry Pi Imagerからインストール可能
– LTS版も用意されている
– 32ビット版と64ビット版が用意されている
• イメージのダウンロードも可能
– https://ubuntu.com/download/raspberry-pi
4
- 6. Raspberry Piの名前解決
• mDNSで自動的に名前解決可能
– macOSはBonjour、LinuxはAvahiで実現
– WindowsもmDNS機能を標準搭載
• 「raspberrypi.local」で名前解決可能
– 同じセグメントで複数動作すると自動的に
「○○-2.local」などになるらしい(未確認)
– 必要に応じて名前は変更しましょう
– 名前の変更はraspi-configから(sudo必要)
6
- 8. SSHでリモートログイン
• SSHコマンドでリモートログイン
– % ssh pi@raspberrypi.local
– ユーザー名はpi、パスワードはraspberry
• 初回はホスト証明書の受け入れが必要
– OS再インストールでホスト証明書が切り替
わっている場合にはknown_hostsから
raspberrypi.localの証明書を削除
– % ssh-keygen -R raspberrypi.local
8
- 12. IPアドレスの固定
• DHCPサーバーにMACアドレス登録
– 何度もやり直したりするならこちらが楽
• /etc/dhcpcd.confに書く
12
# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1
設定例の抜粋