Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer tailscale #222

Merged
merged 6 commits into from
Oct 20, 2023
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 82 additions & 76 deletions website/docs/ssh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ title: Access and Develop on the Brain
---

Users can remotely access and start developing on the brain via `SSH` access.
The only requirement is to **be connected to the same network of your Amiga**.

### Sign up for a farm-ng-user account

#### 1. Request SSH access to our Fleet Customer Support via email (coming up soon)
#### 1. Email Customer Support (support@farm-ng.com) with subject line "Request device access"

#### 2. You will receive a confirmation email with a link for sign-up along with instructions

Expand All @@ -18,7 +17,7 @@ If your institution does not use Google accounts, you may be able to create a
[Google](https://support.google.com/accounts/answer/27441?sjid=986712808663701328-NA#existingemail)
account using your existing institutional email address.

#### 3. On our fleet manager website, click on **login**
#### 3. On our Fleet Manager website, click on **login**

![Screenshot from 2023-10-05 11-37-02](https://github.com/farm-ng/amiga-dev-kit/assets/39603677/16afce2a-f338-44a6-9757-f1eadce9a9bb)

Expand Down Expand Up @@ -93,28 +92,84 @@ cat ~/.ssh/id_rsa.pub # Copy it with Shift + Ctrl + C
</TabItem>
</Tabs>

#### 11. Copy your SSH key (including ssh-rsa) to the fleet manager website (`New SSH Key`)
#### 11. Copy your SSH key (including ssh-rsa) to the Fleet Manager website (`New SSH Key`)

#### 12. Assign a name to that key (e.g., my-lenovo-pc)

#### 13. Click on `Add SSH Key`

![Screenshot from 2023-10-05 11-44-09](https://github.com/farm-ng/amiga-dev-kit/assets/39603677/2fe86af2-6156-4fda-bef8-7bb803d5ff52)

#### 14. Email our Fleet Customer Support to inform that you have signed up successfully
:::info INFO
Each SSH key corresponds to a single PC.
If you need to access the Amiga from multiple PCs, you will need to repeat steps 7-13 for each PC.
:::

#### 14. Inform Customer Support that you have signed up successfully

They will grant you access to your robot.
Reply on the "Request device access" email thread. Provide the Google account email you used to sign
up in Fleet Manager.

Congratulations, you're done setting up your account!
Customer Support will grant you access to your robot and reply with additional instructions for
remote access (see next section).

### (Recommended) Configure cross-network access

You should now be able to SSH into the Amiga as described in the next sections, but **only if your
PC is connected to the same Wifi network as your Amiga.** With a small amount of additional setup,
you can use [Tailscale](https://tailscale.com/) for secure remote access to your Amiga from any
network.

#### 1. Create a Tailscale network with your development machines

:::info INFO
Each SSH key corresponds to a single PC.
If you need to access the Amiga from multiple PCs, you will need to repeat steps 7-13 for each PC.
For simplicity, we describe here how an individual user can create their own private Tailscale
network (tailnet). If your development machines are already on a tailnet, or if you prefer to set
up a larger tailnet for your team, you are free to do so.
:::

Follow the [Tailscale quickstart](https://tailscale.com/kb/1017/install/) guide. Note:

* Sign up using the same Google account you use to login to Fleet Manager.
* You can use Tailscale's free plan to provide remote access to up to three of your machines, for
example: a laptop, a workstation, and a mobile phone/tablet. The Amiga will not count against your
limit.

#### 2. Add the Amiga to your Tailscale network

In your access confirmation email from farm-ng Support, you should have received an invite link to
share the Amiga with you via your Tailscale network. Click the link and sign in to your Tailscale
account to accept the invite. In the [Machines](https://login.tailscale.com/admin/machines) page of
the Tailscale admin console, you should see a new machine listed with hostname of the form
`[element]-[fruit]`. That's your Amiga!

The invite link works for a limited amount of time. If you need a new one, contact support@farm-ng.com.

#### 3. Connect your development machine

In a terminal window, run the following commands:

```bash
sudo tailscale up
tailscale status
```

This will output a list of machines on your Tailscale network, similar to:

```bash
100.95.129.75 my-laptop my-username@ linux -
100.77.194.143 my-phone my-username@ android -
100.127.188.107 [element-fruit].[tailnet-name].ts.net support-username@ linux -
```

In this example, the bottom row represents your Amiga. You will access it via either:

* IP address: a stable IP of the form `100.x.y.z` assigned on your Tailscale network.
* Fully qualified domain name (FQDN): of the form `[element-fruit].[tailnet-name].ts.net`.

### (Recommended) Configure your SSH Connections

Now that you have an `SSH key` and your account is ready, let's configure your SSH connections.
Now that you have an `SSH` key and remote connectivity to your Amiga, let's configure your SSH connections.

This can be done via the terminal or VS Code.

Expand All @@ -131,24 +186,6 @@ gedit ~/.ssh/config # This will open your .ssh/config
# Here we're using gedit as our text manager, feel free to choose another one (e.g., vi, nano)
```

Hit **Enter** and then add the following lines to your file:

```bash
Host <robot-name>
HostName <ip-address>
User farm-ng-user-<username>
```

Replace `<robot-name>` with your robot name (e.g., element-vegetable) and
`<ip-address>` the robot's local IP address.

Replace `<username>` with your username (e.g., john-doe).
Make sure to save the file before you close it!

:::tip TIP
You can download [**Fing**](https://www.fing.com/products/fing-app) to scan
all devices connected to your network and figure out your robot's IP address.
:::
</TabItem>

<TabItem value="windows" label="Windows" default>
Expand All @@ -167,24 +204,7 @@ c. Hit **Enter**

d. This will create a file named config and open the folder it's stored.

e. Open the file using a text editor such as notepad and paste the following:

```bash
Host <robot-name>
HostName <ip-address>
User farm-ng-user-<username>
```

Replace `<robot-name>` with your robot name (e.g., element-vegetable) and
`<ip-address>` the robot's local IP address.

Replace `<username>` with your username (e.g., john-doe).
Make sure to save the file before you close it!

:::tip TIP
You can download [**Fing**](https://www.fing.com/products/fing-app) to scan
all devices connected to your network and figure out your robot's IP address.
:::
e. Open the file using a text editor such as notepad.

</TabItem>

Expand All @@ -197,24 +217,6 @@ gedit ~/.ssh/config # This will open your .ssh/config
# Here we're using gedit as our text manager, feel free to choose another one (e.g., vi, nano)
```

Hit **Enter** and then add the following lines to your file:

```bash
Host <robot-name>
HostName <ip-address>
User farm-ng-user-<username>
```

Replace `<robot-name>` with your robot name (e.g., element-vegetable) and
`<ip-address>` the robot's local IP address.

Replace `<username>` with your username (e.g., john-doe).
Make sure to save the file before you close it!

:::tip TIP
You can download [**Fing**](https://www.fing.com/products/fing-app) to scan
all devices connected to your network and figure out your robot's IP address.
:::
</TabItem>

<TabItem value="vscode" label="VS Code">
Expand All @@ -235,28 +237,32 @@ all devices connected to your network and figure out your robot's IP address.

![Screenshot from 2023-10-05 13-58-05](https://github.com/farm-ng/amiga-dev-kit/assets/39603677/6a577080-a052-4a90-9ffb-491d7bb7c2ed)

#### 5. Add the following lines to your file
</TabItem>
</Tabs>

Add the following lines to your file:

```bash
Host <robot-name>
HostName <ip-address>
User farm-ng-user-<username>
# Replace <robot-name> with your robot name (e.g., element-vegetable).
# You should receive your robot name via email
# Replace <username> with your username (e.g., john-doe)
# and <ip-address> with the robot's local IP address.
```
```

Replace:

* `<robot-name>` with your robot name (of the form `element-vegetable`).
* `<ip-address>` with the robot's Tailscale FQDN (or IP address) reported by `tailscale status` in
the previous section. If you have not set up remote access via Tailscale, and your PC and Amiga
are connected to the same Wifi network, you may use the Amiga's local IP address instead.
* `<username>` with the username you chose on your first login to Fleet Manager (e.g., `john-doe`).

Make sure to save the file before you close it!

:::tip TIP
You can download [**Fing**](https://www.fing.com/products/fing-app) to scan
all devices connected to your network and figure out your robot's IP address.
all devices connected to your network and figure out your robot's local IP address.
:::

#### 6. Save and close the document

</TabItem>
</Tabs>

### Accessing the brain

You can access the brain via a terminal (**Linux, Windows or MacOS**) or VS Code.
Expand Down
Loading