Synology NAS - SSH To Find User Info
Tags: synology, nas, tutorial
Published: 2021-01-22 03:02:02

---
title: Synology NAS - SSH To Find User Info
published: true
date: 2021-01-21 00:00:00 UTC
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/dj3bauj14p1a13khsz5s.png
tags: Synology,NAS,tutorial
canonical_url: https://chrisotto.dev/ssh-synology-nas/
series: Synology NAS Setup
---

Image courteous of [unsplash](https://unsplash.com/).

The user information for your user is useful for setting up Docker images/containers that need access. You can either set up a dedicated Docker user in your NAS or any other user that has `admin` privileges.

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#enable-ssh)Enable SSH

In order to be able to SSH into the NAS first, we need to enable SSH:

- In DSM open up the Control Panel
- Terminal & SNMP (make sure you’re in advanced mode in the control panel)
- In the Terminal Tab
- Click the checkbox to Enable SSH Service
- Change the port from the default port of `22`
- Apply

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#open-up-the-terminal-and-find-user-info)Open Up The Terminal And Find User Info

Now that SSH is enabled we head to the terminal in order to login into our NAS via SSH. If you’re on Windows using the default Command Prompt will work or Terminal on MacOS/Linux.

With the terminal open enter the following command:

```
ssh %USERNAME%@%IP_ADDRESS% -p %PORT%
```

- %USERNAME% - The username for the account that has `admin` access in your NAS. It’s standard practice to disable the default admin and guest account for your NAS.
- %IP\_ADDRESS% - The IP address of your Synology NAS
- %PORT% - Port you set up for SSH when enabling SSH

You’ll then be prompted to enter your password afterward, you should be greeted with the following your terminal:

```
%USERNAME%@%SYNOLOGY_NAS_NAME%:~$
```

Now enter in `id` and see the information for your user:

```
%USERNAME%@%SYNOLOGY_NAS_NAME%:~$id
uid=1033(%USERNAME%) gid=100(users) groups=100(users),101(administrators)...
```

The key information that we need to take out of this is the `uid` and the administrator's group ID. A lot of the containers on [Linux Server](https://fleet.linuxserver.io/) require these IDs but they will be mapped a little bit differently:

- `uid` = `PUID`
- Admin Group ID = `PGID`

That’s it. With those two IDs saved off, you should now have the prerequisites to set up some Docker containers on your NAS. I will have follow-up posts for some of the containers I’ve set up on my NAS. Cheers! 🍻