To SSH into a Synology or QNAP NAS, enable the SSH service in the control panel. Connect with an account in the administrators group on the configured port, which is 22 by default in OpenSSH. Authenticate with an Ed25519 key and disable SSH when you finish. The NAS should never expose that port directly to the internet.

Enabling SSH in the Synology or QNAP NAS control panel

SSH on a Synology or QNAP NAS is switched on from the web admin panel, not from a terminal. In Synology DSM the setting is under Control Panel › Terminal & SNMP › Enable SSH service. In QNAP QTS it is under Control Panel › Network & File Services › Telnet/SSH. Exact labels can change between system versions, but both panels have a checkbox to enable the service and a port field.

Enable SSH only. Telnet sends usernames and passwords in clear text and has no place on a home or office network. Save the change and write down the port the panel shows, because your client will need it.

Administrator account for NAS SSH: which user to log in with

A Synology or QNAP NAS only accepts SSH sessions from accounts with administrator privileges. That account has full control over volumes, shared folders and services, so choose it carefully:

  • Use your own admin-group account with a long password. Avoid the generic account if the system lets you disable it.
  • Do not enable direct root login. When you need to elevate, run sudo -i from your own account. That makes it obvious when you are acting as root.
  • Turn on user home folders. On Synology, enable the user home service. Without it there is no home directory and nowhere to store ~/.ssh/authorized_keys.

NAS SSH port: connecting on 22 or the port you configured

OpenSSH listens on TCP port 22 by default, and that is the value both the Synology and QNAP panels suggest. If you change it in the panel, give the new port to the client with -p or the Port directive:

# Direct connection (replace IP, user and port)
ssh -p 22 [email protected]

# ~/.ssh/config entry so you only type "ssh nas"
Host nas
    HostName 192.168.1.50
    Port 22
    User youruser
    IdentityFile ~/.ssh/id_ed25519

A different port means less noise in the logs, but it does not protect the NAS. Do not forward the NAS SSH port on your router. To reach it from outside, use a mesh private network without open ports such as Prialo or Tailscale, and connect to the private IP it assigns.

Ed25519 key login to the NAS instead of a password

OpenSSH has supported Ed25519 keys since version 6.5, released in January 2014. They are the sensible choice for a NAS: short keys, with no reliance on the SHA-1 ssh-rsa signature that has been disabled by default since OpenSSH 8.8.

# On the client: generate the key and copy the public half to the NAS
ssh-keygen -t ed25519 -C "nas-access"
ssh-copy-id -i ~/.ssh/id_ed25519.pub -p 22 [email protected]

# On the NAS: the permissions sshd expects
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Permissions matter. With StrictModes, which is on by default, sshd ignores authorized_keys when the home directory, ~/.ssh or the file itself is too permissive. The behaviour is documented in the official sshd_config manual page. Once the key works, you can turn off password authentication.

In termi1, the key is generated on the phone and kept in the system's secure storage. The private key never leaves the device or touches termi1 servers: you only copy the public key into the NAS authorized_keys.

NAS SSH from a phone vs a desktop: comparison table

Mosh requires mosh-server on the NAS. It uses UDP on ports 60000-61000 and starts through an initial SSH connection. Before relying on it, run command -v mosh-server on the NAS: if it returns no path, connect with plain SSH.

Task on the NASPhone with termi1 (iOS/Android)Desktop with OpenSSH
Generate an Ed25519 keyOn the phone, kept in system secure storagessh-keygen -t ed25519 in ~/.ssh
Esc, Ctrl, Tab and F1–F12Custom keyboard with those keys and an fn layerPhysical keyboard
Switching from Wi-Fi to mobile dataMosh keeps the session if the NAS has mosh-serverThe SSH session usually drops and needs reconnecting
Browsing and moving filesBuilt-in SFTP without leaving the sessionsftp or scp, which uses SFTP since OpenSSH 9.0
Commands that delete or stop thingsProduction Guard holds them before the promptEntirely up to whoever is typing

termi1's AI turns a typed or spoken sentence into a command that is written to the prompt without pressing Enter. If you tag the NAS connection as production, nothing gets Enter automatically, and anything that deletes, stops or changes something is held before it reaches the prompt. Get the termi1 terminal on the App Store; it is also on Google Play.

Turning off NAS SSH when you finish: shutdown checklist

An SSH service you are not using adds attack surface and gives you nothing back. On a home or office NAS, the rule is to disable it in the panel once you are done:

  1. Close the session with exit and make sure nothing you started still depends on it.
  2. Untick SSH in the panel: Terminal & SNMP on Synology, Telnet/SSH on QNAP. Apply the change.
  3. Confirm the port is closed from another machine with ssh -p 22 [email protected], which should now fail.
  4. Keep your public key in authorized_keys, so next time you only need to re-enable the service.

Frequently asked questions

How do I enable SSH on a Synology NAS?

SSH on a Synology NAS is enabled in DSM under Control Panel › Terminal & SNMP, by ticking the SSH service box. You set the port on the same screen; it defaults to 22. Then log in with an account that belongs to the administrators group.

Which user should I use to SSH into a QNAP NAS?

A QNAP NAS only accepts SSH from accounts with administrator privileges. Use an account in the administrators group with a long password, authenticate with an Ed25519 key and avoid enabling direct root login. When you need to elevate privileges, do it from your own account.

Is it safe to open the NAS SSH port on my router?

Opening the NAS SSH port on your router exposes it to the internet, and swapping 22 for another number does not protect it. Reaching the NAS through a mesh private network such as Prialo or Tailscale is safer, because it needs no open ports.

Does Mosh work with a Synology or QNAP NAS?

Mosh works with a Synology or QNAP NAS only if the NAS has mosh-server installed. Check with command -v mosh-server. Mosh starts over SSH, uses UDP ports 60000-61000 and does no port forwarding. If it is missing, use plain SSH.