# macOS to Windows

### Step 1 to Step 4

These initial steps set up the machine initiating the connection.

<details>

<summary>On the machine you are connecting from</summary>

{% hint style="warning" %}
In this installation guide, `@example01_np` will represent the client atSign, while `@example02_np` will represent the device atSign.
{% endhint %}

### <mark style="color:orange;">Step 1:</mark> Download and run the Installer

Open a terminal and download the installer from GitHub by running the following command:

```bash
curl -L https://github.com/atsign-foundation/noports/releases/latest/download/universal.sh -o universal.sh
```

To check if the installation downloaded correctly:

```bash
stat universal.sh
```

Make the script executable and run the script by running the command below:

```bash
chmod u+x universal.sh
./universal.sh
```

{% hint style="info" %}
You may be asked to enter your password if your machine requires sudo privileges.
{% endhint %}

**The install type**

* Enter  `client` when prompted.

**Your atSigns (Skip this step)**

* To skip this step, simply press the Enter/Return key twice. Your atSigns will be activated in the upcoming steps.

### <mark style="color:orange;">Step 2:</mark> Activate your client atSign (@example01\_np)

{% hint style="warning" %}
If you've already activated your **client** atSign on another device, this step will not work. Instead, follow this guide: [reuse-your-client-atsign-on-another-machine](https://docs.noports.com/installation-faq/reuse-your-client-atsign-on-another-machine "mention")
{% endhint %}

This command activates your atSign and prompts you to enter an OTP. This is only done during the setup of a brand new atSign.

{% hint style="warning" %}
Replace `@<REPLACE>_np` with your **client atSign.**
{% endhint %}

```
~/.local/bin/at_activate -a @<REPLACE>_np
```

#### Enter the one-time password (OTP) & Check your SPAM/PROMOTIONS folders

at\_activate will pause and wait for the input of a one-time pin (OTP) sent to your email or phone number.\
\
Once activated, the master keys will save at `~/.atsign/keys`.

### <mark style="color:orange;">Step 3:</mark> Activate your device atSign (@example02\_np)

Run the same command, but for your device atSign.

{% hint style="warning" %}
Replace `@<REPLACE>_np` with your **device atSign.**
{% endhint %}

```
~/.local/bin/at_activate -a @<REPLACE>_np
```

#### Enter the one-time password (OTP) & Check your SPAM/PROMOTIONS folders

at\_activate will pause and wait for the input of a one-time pin (OTP) sent to your email or phone number.\
\
Once activated, the master keys will save at `~/.atsign/keys`.

### <mark style="color:orange;">Step 4:</mark> Generate an atSign authorization passcode for your device atSign

Run the following command to generate a 6-character one-time passcode. You will use this passcode in **Step 6.**

{% hint style="warning" %}
Replace `@<REPLACE>_np` with your device **atSign.**
{% endhint %}

```bash
~/.local/bin/at_activate otp -a @<REPLACE>_np
```

</details>

### Step 5 to Step 7

After setting up the machine you're connecting from, you'll configure the machine you're connecting to.

<details>

<summary>On the machine you are connecting to</summary>

### <mark style="color:orange;">Step 5:</mark> Download and run the Installer

Download the msi installer [from GitHub](https://github.com/atsign-foundation/noports/releases/latest/download/sshnp-windows-x64.zip). You can run the msi right from the windows-bundle.zip.

Ensure both Core Tools & Daemon Service are being installed.

<figure><img src="https://2080310565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxDhnoLkxryJhtCjj7mE2%2Fuploads%2F7K0vRIHDQOOqk3PZbLtu%2Fimage.png?alt=media&#x26;token=c360b6e2-5833-44cf-8a42-6b5102c89799" alt=""><figcaption></figcaption></figure>

### <mark style="color:orange;">Step 6:</mark> Initiate device atSign authorization request

Open a terminal (Command Prompt or PowerShell) and run the following command to make an authorization request.&#x20;

{% hint style="warning" %}
Be sure to replace the following values:

`@<REPLACE>_np` with your **device atSign**,

&#x20;`<PASSCODE>` with the **passcode generated in Step 4**,&#x20;

`<USER>` with your **Windows username**,&#x20;

`@<REPLACE>_np_key` with your **device atSign**,&#x20;

`<DEVICE_NAME>` with the name of the machine you are on
{% endhint %}

<pre class="language-bash"><code class="lang-bash">at_activate.exe enroll -a "@&#x3C;REPLACE>_np" `
<strong>  -s &#x3C;PASSCODE> `
</strong><strong>  -p noports `
</strong><strong>  -k C:\Users\&#x3C;USER>\.atsign\keys\@&#x3C;REPLACE>_np_key.atKeys `
</strong><strong>  -d &#x3C;DEVICE_NAME> `
</strong><strong>  -n "sshnp:rw,sshrvd:rw"
</strong></code></pre>

Once you see this text, you're ready to continue to the next step.

```
Submitting enrollment request 
Enrollment ID: ---------------------
Waiting for approval; will check every 10 seconds
```

{% hint style="info" %}
If you encounter a handshake exception, it usually means your root certificates are outdated. To refresh them, run the following command with administrator privileges:<kbd>Install-Script -Name UpdateRootCertificates</kbd>
{% endhint %}

### <mark style="color:orange;">Step 7:</mark> Setup Service Config on Device

The service config lives in C:\Program Data\NoPorts\sshnpd.yaml, you can open it in notepad by running the following command:

{% hint style="danger" %}
Make sure you run notepad/terminal as administrator or else you won't be able to save your changes!
{% endhint %}

```
notepad C:\ProgramData\NoPorts\sshnpd.yaml
```

Ensure you provide the following fields to your service config:

* **atsign**
  * `atsign: example02_np`
  * `atsign: '@example02_np'`
* **keys (windows path)**
  * `keys: C:\Users\alice\.atsign\keys\@example02_np_key.atKeys`
* **manager**&#x20;
  * `manager: example01_np`
  * `manager: '@example01_np'`

Examples on how to fill in the fields are inside the config file.

</details>

### Step 8 and Step 9

With both machines now configured, the final steps bring us back to the machine initiating the connection.

<details>

<summary>On the machine you are connecting from</summary>

### <mark style="color:orange;">Step 8:</mark> Approve the atSign authorization request

Run the following command:

{% hint style="warning" %}
Be sure to replace the following values:

`@<REPLACE>_np` with your **device atSign**,

`@<REPLACE_NAME>` with the **device name** **from Step 5.**
{% endhint %}

```bash
~/.local/bin/at_activate approve -a @<REPLACE>_np --arx noports --drx <DEVICE_NAME>
```

### <mark style="color:orange;">Step 9:</mark> Use NoPorts!

That's it. You can start using NoPorts or explore some of the documented use cases, including [MCP](https://docs.noports.com/use-cases/mcp), [SSH](https://docs.noports.com/use-cases/ssh), [RDP](https://docs.noports.com/use-cases/rdp), [SFTP](https://docs.noports.com/use-cases/sftp), [Web Server](https://docs.noports.com/use-cases/web-server), and [SMB](https://docs.noports.com/use-cases/smb).&#x20;

</details>
