Skip to content

Synology SSH Permission Denied: A Five-Layer Triage Tree

ssh admin@<NAS-IP> returning Permission denied, please try again or Permission denied (publickey), or logging in successfully but stalling at sudo -i, is one of the most common Synology failures: it looks like a bad password but has many branches. This guide narrows it through five layers - account and DSM version, authentication method, homes permissions, security policy, and service and logs. Every UI path, account rule, and command was checked against the official Synology root SSH sign-in guide, the official RSA key sign-in guide, the official homes default permissions article, the official DSM sign-in troubleshooting page, and the official NAS security hardening guide. Ports and exact paths depend on your DSM version.

The short version: Permission denied is the uniform refusal signal from SSH; it does not say which layer refused you. What sets the direction is whether you use a password or a key, which major DSM release you run, and whether the account is in the administrators group. Fix those three facts first. Reachability at the network layer is a separate chain, covered in TCP Connection Triage: From Port to Packet Capture - do not mix it with an authentication refusal.

1. Layer one: account and DSM version, who should you log in as?

The official root SSH guide splits account rules cleanly by release:

  • DSM 6.0 / SRM 1.3 and later: accounts able to sign in with root privilege are members of the administrators group. The flow is: sign in with the admin account (the official example is ssh [email protected] -p 22), enter that account's password, run sudo -i, then enter the admin password again to gain root.
  • DSM 5.2 / SRM 1.2 and earlier: sign in directly as root (official example ssh [email protected] -p 22) using the default account "admin" password.

The first test is therefore simple: on DSM 6.0 and later, trying ssh root@... is expected to fail, not a fault. Likewise, a regular account outside the administrators group will not gain root through sudo -i.

The guide warns that enabling SSH may bring security risks, advises it only when necessary, and suggests replacing default port 22. Your SSH port may no longer be 22, so separate connection-level failure from an authentication-level Permission denied.

2. Layer two: password or key, with different checklists

The official RSA key guide states that its methods apply only to DSM 6.2.4 or above. Its "Before you start" section lists three items, which double as a checklist for key failures:

  1. Sign in to DSM with an account belonging to the administrators group.
  2. Go to Control Panel > Terminal & SNMP > Terminal and tick Enable SSH Service.
  3. To sign in as an administrator: go to Control Panel > User & Group (DSM 7.0 and above) or User (DSM 6.2.4) > Advanced > User Home, tick Enable user home service, and make sure the homes shared folder uses default permissions; non-admin users should have no Read or Write permission.

Reading key: if password login works and key login fails, the fault sits in key upload and the three items above - do not touch password policy. If both fail, return to layer one. The guide's notes add two traps: the .ssh folder may be hidden on a Mac (press Command + Shift + . in Finder), and a passphrase set at key generation will be requested at sign-in.

That gives the key branch: password works, key fails, check key and home directory; both fail, check account and lockout. Keeping them apart prevents bouncing between key permissions and password resets.

3. Layer three: homes defaults, the layer most easily broken by a "quick fix"

Synology has a dedicated article on default homes folder permissions, and it lists SSH key login failure as a direct consequence. Changing those defaults may result in users being unable to enter their own home folders, administrators being unable to sign in via SSH using RSA keys, and packages storing data in home folders not working properly.

The official default table has three entries, all applying to the folder, child folders, child files, and all descendants:

User or group Type Permission
Owner Allow All Administration, Read, and Write
administrators Allow All Read and Write
Everyone Allow Only Traverse folders/Execute files under Read

To check them, open File Station, right-click homes, choose Properties, and read the Permission tab. With no prior changes it shows default entries; click Edit to verify and restore defaults if needed. The article notes that administrators means the DSM group, and a directory-service admin group may get the same permissions if the NAS joins a domain or LDAP.

The test is crisp: key auth returns Permission denied (publickey) and homes permissions were edited, so restore the official defaults first. Listing this in a warning is not a formality.

4. Layer four: auto block, verification codes, and "no permission to use this service"

When credentials are correct but access is still refused, look at DSM-side security policy. The official sign-in troubleshooting page lists several states easily confused with an SSH refusal:

  • Blocked IP: in the allow/block list, select the blocked IP, click Remove, then confirm Delete. If the password is forgotten or no other IP is available, reset the administrator password by the official procedure.
  • Wrong verification code, or a changed or lost phone: disable multi-factor authentication per the official article.
  • "You do not have permission to use this service": access was set to Deny. On DSM 7.0 and above go to Control Panel > Application Permissions > DSM > Edit; on DSM 6.2 and earlier go to Control Panel > Privilege > DSM > Edit; on DSM Enterprise (PAS) go to Control Panel > Application Permissions > DSM Enterprise > Edit. If every user including admins sees it, use the corresponding official article.
  • "System is preparing. Please sign in later": the login page still appears but the attempt returns that message. Boot time depends on how many services run; check front-panel LEDs and wait until ready.

The official NAS security guide adds the scope of auto block: SSH, Telnet, rsync, network backup, shared folder sync, FTP, WebDAV, Synology mobile apps, File Station, and DSM sign-in are all covered. Set it under Control Panel > Security > Protection on DSM 7.0 and later, or Control Panel > Security > Account on DSM 6.2 and earlier. The firewall lives under Control Panel > Security > Firewall, with an important official caution: set rules from an IP that will be allowed to sign in, do not use QuickConnect, and confirm your current IP is in the allow list so you do not lock yourself out.

Repeated wrong passwords can trigger auto block, after which even a corrected password keeps failing until the block expires or the IP is removed. Changing the password again only prolongs it.

5. Layer five: service not enabled, protocol confusion, and log evidence

Synology answers a common puzzle directly: SSH service is disabled but SSH authentication-failure messages keep arriving. SSH, SFTP, and encrypted rsync tasks all use the SSH protocol and can all trigger that warning. If you need those services, verify the username and password in the SFTP or rsync client. If you do not need rsync, go to Control Panel > File Services > rsync and clear Enable rsync service. For a steady stream of failures from unknown users or IPs, follow the official security hardening steps for auto block and firewall rules.

Take evidence from logs before changing anything. The official NAS security guide names Log Center as the place for security events; a login refusal and a disabled service are recorded differently, so read the entry first and then decide whether to change authentication configuration or service configuration.

A boundary on privilege commands: sudo -i comes from the official root sign-in guide and is an official flow. Tools often cited online such as synoservice, synopkg, and synowifinetcfg are community or third-party reverse-engineered commands, not documented official Synology CLI, and their syntax changes between DSM releases. If you must use one on site, confirm its actual syntax with --help and mark the finding needs-site-confirm; never mark it verified.

6. One tree: symptom to next cut

  • ssh root@<IP> refused on DSM 6.0 or later: use an administrators-group account and sudo -i. That is a version rule, not a fault.
  • Admin login works but sudo -i fails: confirm the second prompt takes the same admin account's password and that the account is in the administrators group.
  • Password works, key fails: check the three RSA-guide items - administrators group, SSH service enabled, user home service enabled with homes at defaults.
  • Key fails and homes permissions were edited: File Station > homes > Properties > Permission, and restore the official table (Owner full, administrators Read/Write, Everyone traverse/execute only).
  • Correct credentials still refused: check the allow/block list, MFA state, and whether Application Permissions is set to Deny; DSM 7.0+ uses Control Panel > Security > Protection, older releases use Security > Account.
  • SSH disabled but authentication alerts continue: check SFTP and encrypted rsync tasks; disable rsync under Control Panel > File Services > rsync if unused.
  • Many failed logins from unknown IPs: enable auto block and firewall allow rules per the official security guide, and confirm the current admin IP is not locked out.

Each step answers one yes-or-no question. Do not mix "wrong account" with "edited home permissions" in one round of changes: the first is a different login method, the second changes shared-folder permissions with a much wider blast radius. A certificate error proper is a different chain - see SSL/TLS Handshake Failure Triage - and should not be conflated with the authentication refusals here.

7. Acceptance checklist before calling it done

  • DSM version recorded and the login account follows the official rule for that release (6.0+: administrators-group account plus sudo -i)
  • SSH service state and actual current port verified, not assumed to be 22
  • For key auth: user home service enabled and homes permissions match the official default table
  • For password failures: allow/block list, MFA state, and application permissions reviewed
  • Auto block and firewall rules reviewed; current management IP is not locked out
  • If a passphrase was set on the key, the client is confirmed to prompt for it
  • Commands used were separated into official flows and community reverse-engineered tools, with the latter marked needs-site-confirm
  • SSH service disabled again after evidence collection, as the official guidance advises

A checklist card is more useful here than a script: most decisions in this tree are "which account" and "are permissions still default," which need human context. A script can only print port reachability and the log tail.