Raspberry Pi に Ubuntu Core 、Rocket.Chat をインストールする。

環境:Raspberry Pi 3 Model B(wi-fi)、Mac

(1)Ubuntu One アカウントを作成する。

https://login.ubuntu.com/

(2)Mac のターミナルで、以下のコマンドで SSH キーを作成。

$ ssh-keygen -t rsa -b 4096

“Enter file in which to save the key” はそのまま Enter キーを押せばデフォルトの保存場所に保存される。

passphrase は適当なものを入力する。

(3)生成された id_rsa.pub を開き(デフォルトだと /Users/[ユーザー名]/.ssh/id_rsa.pub)、コピー。以下のページへペーストする。

https://login.ubuntu.com/ssh-keys

(4)以下のページで Ubuntu Core 16 image for Raspberry Pi 3 をダウンロードする。stable 版は wifi 接続に問題があるようだから、edge 版にした。

Raspberry Pi 2 or 3 | Developer
https://developer.ubuntu.com/core/get-started/raspberry-pi-2-3

(5)Etcher で4のイメージファイルを microSD カードに書き込む。

(6)Raspberry Pi に microSD カードを挿して起動。

最初に wifi の設定ができる。さらに、1で作成した Ubuntu One のメールアドレスを入力する。これでネットに繋がり、ssh アクセス用のアドレスが表示される。

設定終了後 Ubuntu が再起動する。

(7)Mac のターミナルで6で表示されたアドレスにアクセスする。途中で passphrase を聞かれるが、これは2で設定した、SSH key のものを入力する。これでコンソールに入れる。

(8)以下のコマンドで Rocket.Chat Server をインストールする。

$ sudo snap install rocketchat-server

Snap にインストールされたパッケージ一覧は以下のコマンドで確認できる。

$ snap list

(9)以下のページにアクセスすると、Rocket.Chat に行けるはずだ。

http://[Raspberry Pi の IP アドレス]:3000/

ただ、インターフェースの日本語化はできないっぽい。そしてチャンネル名に日本語を使えない。

参考:
Macで秘密鍵と公開鍵を作成する (ssh-keygenの使い方) – TASK NOTES
http://www.task-notes.com/entry/20150208/1423325535

公開鍵暗号を用いてのSSH接続(きほん) – Qiita
https://qiita.com/mukoya/items/f20def019e25dc162ca8

Raspberry Pi 2 or 3 | Developer
https://developer.ubuntu.com/core/get-started/raspberry-pi-2-3

ROS + Snappy Ubuntu Core (4) : Raspberry Pi 3へのUbuntu Coreのインストール | Tokyo Opensource Robotics Kyokai Association
http://opensource-robotics.tokyo.jp/?p=2314

snapを使ったRocket.Chatの簡単インストール – Qiita
https://qiita.com/bibimarujp/items/b1bebba9dd67422031c6

RocketChat/Rocket.Chat.RaspberryPi: Run a private social network on your Pi for iPhone and Android devices !
https://github.com/RocketChat/Rocket.Chat.RaspberryPi