CLI を使用し、remote.it を使って接続するターゲットとしてデバイスとサービスを登録する手順を説明します。
1. デバイスの登録
1) “remoteit register” コマンドを実行します。”Device name:” で入力を求められたら、remote.it に登録するためのデバイス名を入力します。(本手順では demo-ubuntu と入力しています。)
sudo remoteit device register
✓ status : OK, execute: remoteit device register
Device Name: demo-ubuntu
✓ status : OK, next
run 'remoteit service add', see `remoteit service add help`
OR
run 'remoteit status' for device/services/connections status
2) “remoteit status” コマンドを使用し、デバイスが登録できたことを確認します。
”deviceRegistered: true” が表示され、stateカラムが “connected” と表示されていれば登録は成功です。
sudo remoteit status
✓ status : OK, execute: remoteit status
owner: jpdemo@remote.it, deviceRegistered: true, services: 0, connections: 0
device | type | state | address
--------------------------------------------------------------------------------------------
90:00:00:00:00:XX:XX:XX | device | connected | 127.0.0.1:65535
以上でデバイスの登録は完了です。
2. サービスの登録
remote.it を使ってリモート接続するためのサービス(ポート)を追加します。
1) “remoteit service add” コマンドを実行します。
続けて対話形式で登録するサービスの情報の入力を求められますので、順次入力します。
-
- “Enter Service Type:” で、登録するプロトコルタイプを指定します。該当するサービスが無い場合は TCP を指定してください。(本手順では SSH に対応する ID 28 を設定しています。IDの代わりに名前で "ssh" と指定することもできます。)
- “Enter Port:” で、登録するサービスのポート番号を入力します。
- “Enter Service name:” で、登録するサービスの任意の名前を入力します。ここで登録した名前が Webポータルやアプリ上で表示されます。
sudo remoteit add
✓ status : OK, execute: remoteit service add
Service Type is not specified or invalid. This is a list of valid service types
ID | Name | Default Port | Protocol | Description
-------------------------------------------------------------------------------------------
48 | ScreenView (beta) | 8959 | TCP | Remote.It ScreenView
32769 | UDP | 0 | UDP | Generic UDP
37 | NxWitness | 7001 | TCP | Nx Witness VMS
46 | PostgreSQL | 5432 | TCP | PostgreSQL server
42 | Admin Panel | 29999 | TCP | remote.it admin panel
38 | Nextcloud | 443 | TCP | Nextcloud hub
39 | OpenVPN TCP | 1194 | TCP | OpenVPN TCP server
49 | SOCKS (beta) | 65535 | TCP | SOCKS Proxy (beta)
7 | HTTP | 80 | TCP | Web protocol
4 | VNC | 5900 | TCP | VNC remote desktop
34 | SMB/CIFS | 445 | TCP | Internet file sharing
32770 | WireGuard | 51820 | UDP | WireGuard VPN server
28 | SSH | 22 | TCP | Secure shell terminal
5 | RDP | 3389 | TCP | Microsoft remote desktop
32772 | OpenVPN UDP | 1194 | UDP | OpenVPN UDP server
8 | HTTPS | 443 | TCP | Secure web protocol
1 | TCP | 0 | TCP | Generic TCP
47 | Docker API | 2375 | TCP | Docker API
45 | MySQL | 3306 | TCP | MySQL server
44 | Redis | 6379 | TCP | Redis server
7 | HTTP | 80 | TCP | Web protocol
8 | HTTPS | 443 | TCP | Secure web protocol
8 | HTTPS | 443 | TCP | Secure web protocol
Enter Service Type ('ID' or 'Name', not case sensitive, default is 'ssh'): 28
Enter Port (default is '22'): 22
Enter Service Name (default is 'SSH'): my-ssh
✓ status : OK, netxt
run 'remoteit status' for device/services/connections status
OR
run 'remoteit service add', see `remoteit service add help`
2) “remoteit status” コマンドを使用し、サービスが登録できたことを確認します。
”service” に登録したサービスが表示されていることを確認します。 stateカラムに “connected” と表示されていれば登録は成功です。追加で他のサービスを登録する場合は、1) の手順を再度行ってください。
sudo remoteit status
✓ status : OK, execute: remoteit status
owner: jpdemo@remote.it, deviceRegistered: true, services: 1, connections: 0
device | type | state | address
--------------------------------------------------------------------------------------------
90:00:00:00:00:XX:XX:XX | device | connected | 127.0.0.1:65535
service | type | state | address | enabled
-------------------------------------------------------------------------------------------------------
90:00:00:00:00:XX:XX:XX | SSH (28) | connected | 127.0.0.1:22 | true※ “remoteit service add” コマンドには、オプションフラグが用意されており、対話形式の他にワンラインで実行することもできます。”remoteit service add help” で確認することができます。
以上でサービスの登録は完了です。
3. 登録状態の確認
正しくデバイスとサービスの登録が行われているかWebポータルで確認する方法を説明します。
1) デバイス登録状態の確認
remote.it のWebポータルにアクセスしてサインインし、デバイスリストに先ほど登録したマシン名のデバイスが存在することを確認します。
2) サービス登録状態の確認
登録されたデバイス名をクリックし、追加したサービスが存在することを確認します。
3) 登録されたサービスへの接続確認
別のPC等でremote.itのWebポータルへアクセスしてサービス名をクリック、[CONNECT] ボタンをクリックして表示された宛先を使って接続できることを確認します。
(以下は SSH へ接続した例です。アドレスとポート番号の指定方法は、各アプリケーションの方法に従ってください。)