{"id":9387,"date":"2021-03-07T19:15:36","date_gmt":"2021-03-07T17:15:36","guid":{"rendered":"https:\/\/www.beseit.net\/?p=9387"},"modified":"2021-03-07T20:04:52","modified_gmt":"2021-03-07T18:04:52","slug":"how-can-i-sign-in-to-dsm-srm-with-root-privilege-via-ssh-2","status":"publish","type":"post","link":"https:\/\/www.beseit.net\/?p=9387","title":{"rendered":"How can I sign in to DSM\/SRM with root privilege via SSH?"},"content":{"rendered":"<p><a href=\"https:\/\/www.synology.com\/knowledgebase\/tag\/97\/common_Permission\"><span style=\"color:blue; font-family:Times New Roman; font-size:12pt; text-decoration:underline\">Permission<\/span><\/a><span style=\"font-family:Times New Roman; font-size:12pt\"><br \/>\n\t\t<\/span><\/p>\n<p><span style=\"font-family:Times New Roman; font-size:24pt\"><strong>How can I sign in to DSM\/SRM with root privilege via SSH?<br \/>\n<\/strong><\/span><\/p>\n<p><span style=\"font-family:Times New Roman; font-size:18pt\"><strong>Purpose<br \/>\n<\/strong><\/span><\/p>\n<p><span style=\"font-family:Times New Roman; font-size:12pt\">This article guides you through how to sign in to DSM (DiskStation Manager) and SRM (Synology Router Manager) as root via SSH.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family:Times New Roman; font-size:12pt\">Warning:<br \/>\n<\/span><\/p>\n<ul>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Enabling SSH service may bring security risks to your system. Please enable it only when necessary and avoid making changes to system configurations.<br \/>\n<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family:Times New Roman; font-size:18pt\"><strong>Contents<br \/>\n<\/strong><\/span><\/p>\n<ul>\n<li><a href=\"https:\/\/www.synology.com\/\"><span style=\"color:blue; font-family:Times New Roman; font-size:12pt; text-decoration:underline\">Enable SSH service<\/span><\/a><span style=\"font-family:Times New Roman; font-size:12pt\"><br \/>\n\t\t\t<\/span><\/li>\n<li>\n<div><a href=\"https:\/\/www.synology.com\/\"><span style=\"color:blue; font-family:Times New Roman; font-size:12pt; text-decoration:underline\">Sign in from Windows 10, macOS, or Linux<\/span><\/a><span style=\"font-family:Times New Roman; font-size:12pt\"><br \/>\n\t\t\t\t<\/span><\/div>\n<ul>\n<li><a href=\"https:\/\/www.synology.com\/\"><span style=\"color:blue; font-family:Times New Roman; font-size:12pt; text-decoration:underline\">For DSM 6.0 or later<\/span><\/a><span style=\"font-family:Times New Roman; font-size:12pt\"><br \/>\n\t\t\t\t\t<\/span><\/li>\n<li><a href=\"https:\/\/www.synology.com\/\"><span style=\"color:blue; font-family:Times New Roman; font-size:12pt; text-decoration:underline\">For DSM 5.2 or earlier\/SRM<\/span><\/a><span style=\"font-family:Times New Roman; font-size:12pt\"><br \/>\n\t\t\t\t\t<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div><a href=\"https:\/\/www.synology.com\/\"><span style=\"color:blue; font-family:Times New Roman; font-size:12pt; text-decoration:underline\">Sign in from earlier versions of Windows<\/span><\/a><span style=\"font-family:Times New Roman; font-size:12pt\"><br \/>\n\t\t\t\t<\/span><\/div>\n<ul>\n<li><a href=\"https:\/\/www.synology.com\/\"><span style=\"color:blue; font-family:Times New Roman; font-size:12pt; text-decoration:underline\">For DSM 6.0 or later<\/span><\/a><span style=\"font-family:Times New Roman; font-size:12pt\"><br \/>\n\t\t\t\t\t<\/span><\/li>\n<li><a href=\"https:\/\/www.synology.com\/\"><span style=\"color:blue; font-family:Times New Roman; font-size:12pt; text-decoration:underline\">For DSM 5.2 or earlier\/SRM<\/span><\/a><span style=\"font-family:Times New Roman; font-size:12pt\"><br \/>\n\t\t\t\t\t<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-family:Times New Roman; font-size:18pt\"><strong>Resolution<br \/>\n<\/strong><\/span><\/p>\n<p><span style=\"font-family:Times New Roman; font-size:13pt\"><strong>Enable SSH service<br \/>\n<\/strong><\/span><\/p>\n<ul>\n<li>\n<div><span style=\"font-family:Times New Roman; font-size:12pt\">Go to the terminal setting page on your Synology device:<br \/>\n<\/span><\/div>\n<ul>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>Synology NAS<\/strong>: DSM <strong>Control Panel<\/strong> &gt; <strong>Terminal &amp; SNMP<\/strong> &gt; <strong>Terminal<\/strong><br \/>\n\t\t\t\t\t<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>Synology Router<\/strong>: SRM <strong>Control Panel<\/strong> &gt; <strong>Services<\/strong> &gt; <strong>System Services<\/strong> &gt; <strong>Terminal<\/strong><br \/>\n\t\t\t\t\t<\/span><\/li>\n<\/ul>\n<\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Tick <strong>Enable SSH service<\/strong>.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Specify a port number for SSH connections and save the settings. To ensure system security, we suggest replacing the default port 22 with another one.<a href=\"https:\/\/www.synology.com\/\"><span style=\"color:blue; text-decoration:underline\"><sup>1<\/sup><\/span><\/a><br \/>\n\t\t\t<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family:Times New Roman; font-size:13pt\"><strong>Sign in from Windows 10, macOS, or Linux<br \/>\n<\/strong><\/span><\/p>\n<p><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>For DSM 6.0 or later<\/strong><br \/>\n\t\t<\/span><\/p>\n<ul>\n<li>\n<div><span style=\"font-family:Times New Roman; font-size:12pt\">Launch the terminal application on your computer:<br \/>\n<\/span><\/div>\n<ul>\n<li>\n<div><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>Windows 10<\/strong>: Windows PowerShell<br \/>\n<\/span><\/div>\n<p><img decoding=\"async\" src=\"https:\/\/www.beseit.net\/wp-content\/uploads\/2021\/03\/030721_1804_HowcanIsign1.png\" alt=\"\"\/><span style=\"font-family:Times New Roman; font-size:12pt\"><br \/>\n\t\t\t\t\t\t<\/span><\/p>\n<\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>macOS<\/strong>: Terminal.app<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>Linux<\/strong>: Terminal<br \/>\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Type the following command and press Enter:<br \/>\n<\/span><\/li>\n<\/ul>\n<div style=\"margin-left: 36pt\">\n<table style=\"border-collapse:collapse\" border=\"0\">\n<colgroup>\n<col style=\"width:343px\"\/>\n<col style=\"width:198px\"\/><\/colgroup>\n<tbody valign=\"top\">\n<tr>\n<td vAlign=\"middle\" style=\"padding-top: 1px; padding-left: 1px; padding-bottom: 1px; padding-right: 1px\">\n<p style=\"text-align: center\"><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>Command<\/strong><\/span><\/p>\n<\/td>\n<td vAlign=\"middle\" style=\"padding-top: 1px; padding-left: 1px; padding-bottom: 1px; padding-right: 1px\">\n<p style=\"text-align: center\"><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>Example<\/strong><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td vAlign=\"middle\" style=\"padding-top: 1px; padding-left: 1px; padding-bottom: 1px; padding-right: 1px\">\n<p><span style=\"font-family:Courier New; font-size:10pt\">ssh <em>DSM admin account<\/em>@<em>DSM IP address<\/em> -p <em>SSH port number<\/em><\/span><\/p>\n<\/td>\n<td vAlign=\"middle\" style=\"padding-top: 1px; padding-left: 1px; padding-bottom: 1px; padding-right: 1px\">\n<p><span style=\"font-family:Courier New; font-size:10pt\">ssh myadmin@10.17.2.6 -p 22<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ul>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Enter the password of your DSM&#8217;s administrator account.<a href=\"https:\/\/www.synology.com\/\"><span style=\"color:blue; text-decoration:underline\"><sup>2<\/sup><\/span><\/a><br \/>\n\t\t\t<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Type <\/span><span style=\"font-family:Courier New; font-size:10pt\">sudo -i<\/span><span style=\"font-family:Times New Roman; font-size:12pt\"> and press Enter.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Enter the password of your DSM&#8217;s administrator account again, and press Enter.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">You are now signed in to your DSM with root privilege via SSH. <br \/><img decoding=\"async\" src=\"https:\/\/www.beseit.net\/wp-content\/uploads\/2021\/03\/030721_1804_HowcanIsign2.png\" alt=\"\"\/><br \/>\n\t\t\t<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>For DSM 5.2 or earlier\/SRM<\/strong><br \/>\n\t\t<\/span><\/p>\n<ul>\n<li>\n<div><span style=\"font-family:Times New Roman; font-size:12pt\">Launch the terminal application on your computer:<br \/>\n<\/span><\/div>\n<ul>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>Windows 10<\/strong>: Windows PowerShell<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>macOS<\/strong>: Terminal.app<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>Linux<\/strong>: Terminal<br \/>\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Type the following command and press Enter:<br \/>\n<\/span><\/li>\n<\/ul>\n<div style=\"margin-left: 36pt\">\n<table style=\"border-collapse:collapse\" border=\"0\">\n<colgroup>\n<col style=\"width:351px\"\/>\n<col style=\"width:190px\"\/><\/colgroup>\n<tbody valign=\"top\">\n<tr>\n<td vAlign=\"middle\" style=\"padding-top: 1px; padding-left: 1px; padding-bottom: 1px; padding-right: 1px\">\n<p style=\"text-align: center\"><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>Command<\/strong><\/span><\/p>\n<\/td>\n<td vAlign=\"middle\" style=\"padding-top: 1px; padding-left: 1px; padding-bottom: 1px; padding-right: 1px\">\n<p style=\"text-align: center\"><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>Example<\/strong><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td vAlign=\"middle\" style=\"padding-top: 1px; padding-left: 1px; padding-bottom: 1px; padding-right: 1px\">\n<p><span style=\"font-family:Courier New; font-size:10pt\">ssh root@<em>DSM\/SRM IP address<\/em> -p SSH <em>port number<\/em><\/span><\/p>\n<\/td>\n<td vAlign=\"middle\" style=\"padding-top: 1px; padding-left: 1px; padding-bottom: 1px; padding-right: 1px\">\n<p><span style=\"font-family:Courier New; font-size:10pt\">ssh root@10.17.2.5 -p 22<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ul>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Enter the password of the default account &#8220;admin&#8221;.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">You are now signed in to DSM\/SRM with root privilege via SSH. <br \/><img decoding=\"async\" src=\"https:\/\/www.beseit.net\/wp-content\/uploads\/2021\/03\/030721_1804_HowcanIsign3.png\" alt=\"\"\/><br \/>\n\t\t\t<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family:Times New Roman; font-size:13pt\"><strong>Sign in from earlier versions of Windows<br \/>\n<\/strong><\/span><\/p>\n<p><span style=\"font-family:Times New Roman; font-size:12pt\">Earlier versions of Windows (e.g., Windows 7) require a third-party software to establish SSH connections to Synology devices. We take the software <a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\" target=\"_blank\" rel=\"noopener\"><span style=\"color:blue; text-decoration:underline\">PuTTY<\/span><\/a> as an example in the following steps.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>For DSM 6.0 or later<\/strong><br \/>\n\t\t<\/span><\/p>\n<ol>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Launch PuTTY on your computer.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Enter &#8220;<em>DSM admin account<\/em>@<em>DSM IP address<\/em>&#8221; in the <strong>Host Name (or IP address)<\/strong> field, e.g., &#8220;myadmin@10.17.2.6&#8221;.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Enter the SSH port of your DSM in the <strong>Port<\/strong> field, e.g., 22.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Click <strong>Open<\/strong>. <br \/><img decoding=\"async\" src=\"https:\/\/www.beseit.net\/wp-content\/uploads\/2021\/03\/030721_1804_HowcanIsign4.png\" alt=\"\"\/><br \/>\n\t\t\t<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Enter the password of your DSM&#8217;s administrator account.<a href=\"https:\/\/www.synology.com\/\"><span style=\"color:blue; text-decoration:underline\"><sup>2<\/sup><\/span><\/a><br \/>\n\t\t\t<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Type <\/span><span style=\"font-family:Courier New; font-size:10pt\">sudo -i<\/span><span style=\"font-family:Times New Roman; font-size:12pt\"> and press Enter.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Enter the password of your DSM&#8217;s administrator account again, and press Enter.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">You are now signed in to your DSM with root privilege via SSH. <br \/><img decoding=\"async\" src=\"https:\/\/www.beseit.net\/wp-content\/uploads\/2021\/03\/030721_1804_HowcanIsign5.png\" alt=\"\"\/><br \/>\n\t\t\t<\/span><\/li>\n<\/ol>\n<p><span style=\"font-family:Times New Roman; font-size:12pt\"><strong>For DSM 5.2 or earlier\/SRM<\/strong><br \/>\n\t\t<\/span><\/p>\n<ol>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Launch PuTTY on your computer.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Enter &#8220;root@<em>DSM\/SRM IP address<\/em>&#8221; in the <strong>Host Name (or IP address)<\/strong> field, e.g., &#8220;root@10.17.2.5&#8221;.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Enter the SSH port of your Synology device in the <strong>Port<\/strong> field, e.g., 22.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Click <strong>Open<\/strong>. <br \/><img decoding=\"async\" src=\"https:\/\/www.beseit.net\/wp-content\/uploads\/2021\/03\/030721_1804_HowcanIsign6.png\" alt=\"\"\/><br \/>\n\t\t\t<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">Enter the password of the default account &#8220;admin&#8221;.<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">You are now signed in to your Synology device with root privilege via SSH. <br \/><img decoding=\"async\" src=\"https:\/\/www.beseit.net\/wp-content\/uploads\/2021\/03\/030721_1804_HowcanIsign7.png\" alt=\"\"\/><br \/>\n\t\t\t<\/span><\/li>\n<\/ol>\n<p><span style=\"font-family:Times New Roman; font-size:12pt\">Notes:<br \/>\n<\/span><\/p>\n<ul>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">To enhance the security of SSH connections, you can also avoid the ports listed in <a href=\"https:\/\/wikipedia.org\/wiki\/List_of_TCP_and_UDP_port_numbers\" target=\"_blank\" rel=\"noopener\"><span style=\"color:blue; text-decoration:underline\">this article<\/span><\/a>.<br \/>\n<\/span><\/li>\n<li>\n<div><span style=\"font-family:Times New Roman; font-size:12pt\">The following accounts are available for SSH logins with root privilege:<br \/>\n<\/span><\/div>\n<ul>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">DSM 6.0 and later: Users in the <strong>administrators<\/strong> group<br \/>\n<\/span><\/li>\n<li><span style=\"font-family:Times New Roman; font-size:12pt\">DSM 5.2 and earlier\/SRM: <strong>root<\/strong><br \/>\n\t\t\t\t\t<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Permission How can I sign in to DSM\/SRM with root privilege via SSH? Purpose This article guides you through how to sign in to DSM (DiskStation Manager) and SRM (Synology Router Manager) as root via SSH. Warning: Enabling SSH service &hellip; <a href=\"https:\/\/www.beseit.net\/?p=9387\">Continua llegint <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9387","post","type-post","status-publish","format-standard","hentry","category-bloc-de-notes"],"_links":{"self":[{"href":"https:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts\/9387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9387"}],"version-history":[{"count":6,"href":"https:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts\/9387\/revisions"}],"predecessor-version":[{"id":9400,"href":"https:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts\/9387\/revisions\/9400"}],"wp:attachment":[{"href":"https:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}