Skip to content

Commit

Permalink
docs(GITBOOK#28): No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
cconstab authored and gitbook-bot committed Feb 18, 2024
1 parent 66122cd commit 582a076
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ unzip sshnp.zip

See the links in the table below to continue with the installation process.

<table><thead><tr><th width="196" data-type="content-ref">Installation method</th><th>When to use this method</th></tr></thead><tbody><tr><td><a href="systemd-unit.md">systemd-unit.md</a></td><td>You are on Linux and have root access.</td></tr><tr><td><a href="tmux-session.md">tmux-session.md</a></td><td>You have tmux installed, or can install it.</td></tr><tr><td><a href="standalone-binaries.md">standalone-binaries.md</a></td><td>You want to manually setup the background service after downloading the binaries.</td></tr><tr><td><a href="headless.md">headless.md</a></td><td>When none of the above options are suitable.</td></tr></tbody></table>
<table><thead><tr><th width="196" data-type="content-ref">Installation method</th><th>When to use this method</th></tr></thead><tbody><tr><td><a href="tmux-session.md">tmux-session.md</a></td><td>You have tmux installed, or can install it. (recommended)</td></tr><tr><td><a href="standalone-binaries.md">standalone-binaries.md</a></td><td>You want to manually setup the background service after downloading the binaries.</td></tr><tr><td><a href="systemd-unit.md">systemd-unit.md</a></td><td>You are on Linux and have root access. (Here be dragons!)</td></tr><tr><td><a href="headless.md">headless.md</a></td><td>When none of the other options are suitable.</td></tr></tbody></table>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You'll then be greeted with a file that looks like this:

{% @github-files/github-code-block url="https://github.com/atsign-foundation/noports/blob/trunk/packages/dart/sshnoports/bundles/shell/systemd/sshnpd.service" %}

Replace `<username>` with the [linux user ](#user-content-fn-1)[^1]running sshnpd
Replace `<username>` with the [linux user ](#user-content-fn-1)[^1]running sshnpd (we suggest creating service account not running as root)

Replace `<@device_atsign>` with the [device address](#user-content-fn-2)[^2]

Expand Down Expand Up @@ -110,7 +110,36 @@ If you need to verify the status of the service:
sudo systemctl status sshnpd.service
```

## 5. All done!
If you want to follow the logs of the service you can with&#x20;

```bash
sudo journalctl -u sshnpd.service -f
```

## 5. Check your environment.

There are a number of fiddly things to get in place for ssh to work. The first is the `~/.ssh/authorized_keys`file. It needs to be only writable by the owner, else the `sshd` will not allow logins. This can be checked with `ls -l` and corrected with.

```bash
chmod 600 ~/.ssh/authorized_keys
```

It should look like this.

```
cconstab@iotdevice01:~$ ls -l ~/.ssh/authorized_keys
-rw------- 1 cconstab cconstab 813 Feb 17 23:42 /home/cconstab/.ssh/authorized_keys
```

If you decided to use the root user in the service setup you need to make sure that the root user is allowed to login via sshd. Whist this is not recommended you can get it working by editing the `/etc/ssh/sshd_config` file and removing the `#` on this line.

```
# PermitRootLogin prohibit-password
```

Once removed you will need to restart the sshd daemon. How to do this varies from distribution/OS so check on how to do it or reboot.

## 6. All Done !

Your systemd service is ready to go, you can now proceed to [installing your client](../client-installation-sshnp.md), or if you've already done that, checkout our [usage guide](../../usage-guide/basic-usage/).

Expand Down

0 comments on commit 582a076

Please sign in to comment.