Skip to content

Commit

Permalink
Merge branch 'trunk' into xc/srv-zombie-process
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierChanth authored Jul 24, 2024
2 parents 4988d5b + 855f4e8 commit d4240cd
Show file tree
Hide file tree
Showing 24 changed files with 575 additions and 245 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/c_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ jobs:
- if: ${{ ! inputs.main_build_only }}
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- if: ${{ ! inputs.main_build_only }}
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v3.1.0
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- if: ${{ ! inputs.main_build_only }}
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0
uses: docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27 # v3.5.0
- if: ${{ ! inputs.main_build_only }}
run: |
docker buildx build -t cpswan/sshnpdc -f sshnpd/tools/Dockerfile.package \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dockerhub_sshnpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ jobs:
VER=${REF:11}
sed -i "0,/version:/{s/version: \(.*\)/version: "${VER}"/}" pubspec.yaml
- name: Set up QEMU
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v3.1.0
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0
uses: docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27 # v3.5.0
- name: Login to Docker Hub
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Extract version for docker tag
- name: Get version
run: echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@1ca370b3a9802c92e886402e0dd88098a2533b12 # v6.4.1
uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0
with:
context: .
file: ${{ matrix.dockerfile }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/multibuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ jobs:
with:
ref: multibuild-${{github.run_number}}
- if: ${{ ! inputs.main_build_only }}
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v3.1.0
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- if: ${{ ! inputs.main_build_only }}
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0
uses: docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27 # v3.5.0
- if: ${{ ! inputs.main_build_only }}
run: |
docker buildx build -t atsigncompany/sshnptarball -f sshnoports/tools/Dockerfile.package \
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ layout:

SSH No Ports is the flagship product in the No Ports suite. It enables you to SSH to any device with no open listening ports, making your devices reachable while eliminating network attack surfaces and reducing administrative overhead!

<table data-view="cards"><thead><tr><th data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="ssh-no-ports/">ssh-no-ports</a></td></tr><tr><td><a href="ssh-no-ports/guides/installation-guide.md">installation-guide.md</a></td></tr><tr><td><a href="ssh-no-ports/guides/upgrade-guide/">upgrade-guide</a></td></tr><tr><td><a href="ssh-no-ports/guides/usage-guide/">usage-guide</a></td></tr><tr><td><a href="ssh-no-ports/how-it-works.md">how-it-works.md</a></td></tr><tr><td><a href="ssh-no-ports/faq.md">faq.md</a></td></tr></tbody></table>
<table data-view="cards"><thead><tr><th data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="ssh-no-ports/">ssh-no-ports</a></td></tr><tr><td><a href="ssh-no-ports/guides/installation-guide/">installation-guide</a></td></tr><tr><td><a href="ssh-no-ports/guides/upgrade-guide/">upgrade-guide</a></td></tr><tr><td><a href="ssh-no-ports/guides/usage-guide/">usage-guide</a></td></tr><tr><td><a href="ssh-no-ports/how-it-works.md">how-it-works.md</a></td></tr><tr><td><a href="ssh-no-ports/faq.md">faq.md</a></td></tr></tbody></table>

## No Ports Tunnel

Expand Down
7 changes: 6 additions & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
* [🚫 No Ports Documentation](README.md)
* [⌨️ SSH No Ports](ssh-no-ports/README.md)
* [🔢 Guides](ssh-no-ports/guides/README.md)
* [💽 Simple Installation Guide Linux/MacOS](ssh-no-ports/guides/installation-guide.md)
* [💽 Quickstart Installation Linux/MacOS](ssh-no-ports/guides/installation-guide/README.md)
* [▶️ Activating your atSigns](ssh-no-ports/guides/installation-guide/activating-your-atsigns.md)
* [🪪 Installation Details](ssh-no-ports/guides/installation-guide/installation-details.md)
* [🪟 Installation Guide Windows](ssh-no-ports/guides/installation-guide-windows.md)
* [👨‍💻 Usage Guide](ssh-no-ports/guides/usage-guide/README.md)
* [💻 Basic Usage](ssh-no-ports/guides/usage-guide/basic-usage/README.md)
* [⚙️ Additional Configuration](ssh-no-ports/guides/usage-guide/basic-usage/additional-configuration.md)
* [🗃️ SFTP](ssh-no-ports/guides/usage-guide/sftp.md)
* [🌐 Web Server](ssh-no-ports/guides/usage-guide/web-server.md)
* [🖥️ RDP](ssh-no-ports/guides/usage-guide/rdp.md)
* [🔢 np.sh](ssh-no-ports/guides/usage-guide/np.sh.md)
* [🛠️ Integrate with ssh config](ssh-no-ports/guides/usage-guide/integrate-with-ssh-config.md)
* [⬆️ Upgrade Guide](ssh-no-ports/guides/upgrade-guide/README.md)
* [👩‍💻 Client Upgrade (sshnp)](ssh-no-ports/guides/upgrade-guide/client-upgrade-sshnp.md)
* [💽 Device Upgrade (sshnpd)](ssh-no-ports/guides/upgrade-guide/device-upgrade-sshnpd.md)
Expand Down
26 changes: 18 additions & 8 deletions docs/noports-tunnel/basic-usage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,30 @@ npt -f @<_client> -t @<_device> -r <@rv_(am|ap|eu) -d <name> \
{% hint style="info" %}
Replace the \<??> with your details and remember to logout and back into the client so you have`npt`in your PATH.\
\
Note: ensure that the sshnpd on the server includes the remote port in their --permit-open/--po rules. By updating the \~/.local/bin/sshnpd.sh file, then rebooting or restarting the sshnpd daemon. For example to allow ssh and smb access to 192.168.1.90 add the following.
Note: ensure that the sshnpd on the server includes the remote port in their --permit-open/--po rules. If you installed using defaults then you need to edit the `/etc/systemd/system/sshnpd.service` file and add the hosts/ports you want to connect to via npt. \

\
`options="localhost:22,192.168.1.90:22,192.168.1.90:445"`&#x20;

`sleep 10; # allow machine to bring up network`&#x20;
For example:

`ExecStart=/usr/local/bin/sshnpd -a "$device_atsign" -m "$manager_atsign" -d "$device_name" "$s" "$u" "$v"`



Would become&#x20;

`ExecStart=/usr/local/bin/sshnpd -a "$device_atsign" -m "$manager_atsign" -d "$device_name" "$s" "$u" "$v" --po 127.0.0.1:22,192.168.1.90:445`



To allow localhost access to SSH and SMB/CIFS access to 192.168.1.90 on port 445. Then run.

`sudo systemctl daemon-reload`

`export USER="$user"`&#x20;
`sudo systemctl restart sshnpd.service`

`while true; do`

&#x20;`"$HOME"/.local/bin/sshnpd -a "$device_atsign" -m "$manager_atsign" -d "$device_name" --po $options -v`&#x20;

`sleep 10 done`\
If you used a non root install (e.g. TMUX) then you will need to make a similar edit to `~/.local/bin/sshnpd.sh` and restart the script\

{% endhint %}

Expand Down
12 changes: 10 additions & 2 deletions docs/noports-tunnel/smb.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ npt -f @alice_client -t @alice_device -d my_server -r @rv_am -p 445 \
NOTE Make sure the sshnpd daemon is allowing port 445 to the SMB file server see Basic Usage for details.
{% endhint %}

Now you can mount the SMB share locally using the file explorer on Windows or the file app on MacOs
Now you can mount the SMB share locally using the finder app ( Go->Connect to server) on MacOs

<figure><img src="../.gitbook/assets/smba.png" alt=""><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/Screenshot 2024-07-03 at 19.52.04.png" alt=""><figcaption></figcaption></figure>

Once mounted you can use the file share as normal, as you dismount the file share the NPT command will disconnect.



{% hint style="info" %}
Windows mounting on a non-standard port is currently not supported by Microsoft but they are working on it.

If you need this functionality, it is possible but fiddly to set up, contact us if you want to know how.
{% endhint %}

### To learn more about NPT
4 changes: 2 additions & 2 deletions docs/ssh-no-ports/guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ coverY: 0

# 🔢 Guides

{% content-ref url="installation-guide.md" %}
[installation-guide.md](installation-guide.md)
{% content-ref url="installation-guide/" %}
[installation-guide](installation-guide/)
{% endcontent-ref %}

{% content-ref url="usage-guide/" %}
Expand Down
2 changes: 1 addition & 1 deletion docs/ssh-no-ports/guides/be-your-own-vpn.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Using sshuttle and SSH built in SOCKS proxy.

# 🏔️ Be your own VPN

To follow this guide, you will need to set up an SSH No Ports device (`sshnpd)`on your home network. For this, you could use a Raspberry Pi, an old PC running Linux, a virtual machine, or even a docker container—the choice is yours. You can get your No Ports free trial account [here](https://noports.com) and follow the [installation guide](installation-guide.md) to get started.
To follow this guide, you will need to set up an SSH No Ports device (`sshnpd)`on your home network. For this, you could use a Raspberry Pi, an old PC running Linux, a virtual machine, or even a docker container—the choice is yours. You can get your No Ports free trial account [here](https://noports.com) and follow the [installation guide](installation-guide/) to get started.

SSH is a hugely versatile tool for command line access, but what if you want a full IP tunnel, like a VPN?

Expand Down
75 changes: 75 additions & 0 deletions docs/ssh-no-ports/guides/installation-guide-windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
description: SSH No Ports Windows
---

# 🪟 Installation Guide Windows

### Installation <a href="#installation" id="installation"></a>

First, open a powershell terminal.

Then run the following command:

```powershell
Invoke-WebRequest -Uri "https://github.com/atsign-foundation/noports/releases/latest/download/universal.ps1" -OutFile "universal.ps1"
```

#### Running the installer <a href="#running-the-installer" id="running-the-installer"></a>

After downloading the installer, you can run the installer by running the following command:

```powershell
.\universal.ps1
```

#### Device Side <a href="#device-side" id="device-side"></a>

After finishing the device install, you will have a windows service installed called `sshnpd`. This service will be started automatically and will be running in the background.

#### Client Side <a href="#client-side" id="client-side"></a>

After finishing the client install, you will have a binary called `{device_name@device_atsign}` installed on your machine. You can use this binary to connect to the device.

Example:

```powershell
esp_32@wanderinggazebo
```

or

```
.\[email protected]
```

### SSH Key Generation <a href="#ssh-key-generation" id="ssh-key-generation"></a>

To generate an SSH key, you can run the following command:

For RSA:

```powershell
ssh-keygen
```

For Ed25519:

```powershell
ssh-keygen -t ed25519
```

### Activate the device atSign <a href="#activate-the-device-atsign" id="activate-the-device-atsign"></a>

First time activating this atSign

```powershell
Users\alice\.local\bin\at_activate -a @<REPLACE>_device
```

Activated this atSign before ? As before if this atSign is already activated elsewhere then you need to copy the .atKeys file for this atSign into the \~/.atsign/keys/ directory.

### RDP? Check this out.

{% content-ref url="usage-guide/rdp.md" %}
[rdp.md](usage-guide/rdp.md)
{% endcontent-ref %}
Loading

0 comments on commit d4240cd

Please sign in to comment.