{"id":14288,"date":"2024-10-02T11:17:28","date_gmt":"2024-10-02T11:17:28","guid":{"rendered":"https:\/\/truehost.com\/support\/?post_type=docs&#038;p=14288"},"modified":"2024-10-07T08:56:19","modified_gmt":"2024-10-07T08:56:19","password":"","slug":"how-to-change-ssh-passwords","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/","title":{"rendered":"How to change SSH passwords for root and non-root user"},"content":{"rendered":"\n<p>Managing user passwords is a key part of server administration to ensure security. <\/p>\n\n\n\n<p>If you need to change the SSH password for either the <strong>root<\/strong> and <strong>sudo<\/strong> users on your server, this guide will walk you through the process.<\/p>\n\n\n\n<p><strong>Note<\/strong>: This is guide is will help someone who already has access to SSH, either by <strong>root<\/strong> user or a <strong>sudo<\/strong> user, and needs to change the password. If you have no SSH access at all, please contact our <strong><a href=\"https:\/\/wa.me\/19726743814\" target=\"_blank\" rel=\"noreferrer noopener\">support team<\/a> <\/strong>for help.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><h3>Prerequisites:<\/h3><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Root or sudo SSH<\/strong> <strong>access<\/strong> to your server.<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 1: Log in to the Server<\/strong><\/h5>\n\n\n\n<p>To begin, log in to your server via SSH using the existing credentials. You can refer to <strong><a href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-access-a-server-via-ssh-terminal\/\" target=\"_blank\" rel=\"noreferrer noopener\">this<\/a><\/strong> guide<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 2: Change the Root Password<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Once logged in as the <strong>root<\/strong> user or a user with <strong>sudo privileges<\/strong>, you can change the <strong>root<\/strong> password by typing the following command:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>passwd<\/strong><\/code><\/pre>\n\n\n\n<p>If you&#8217;re logged in as a sudo user and want to change the root password, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>sudo passwd root\n<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You will be prompted to enter and confirm a new password for the root user.<\/li>\n\n\n\n<li><strong>Enter new password<\/strong>: Type the new root password and press Enter.<\/li>\n\n\n\n<li><strong>Retype new password<\/strong>: Re-type the password to confirm and press Enter.<\/li>\n\n\n\n<li>If successful, you will see a confirmation message below;<\/li>\n<\/ul>\n\n\n\n<p><code>passwd: all authentication tokens updated successfully.<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"536\" height=\"212\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-53.png\" alt=\"\" class=\"wp-image-14332\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-53.png 536w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-53-300x119.png 300w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 3: Change the Password for a Sudo User<\/strong><\/h5>\n\n\n\n<p>If you want to change the password for a <strong>sudo user<\/strong>, the process is very similar:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you are logged in as the <strong>root<\/strong> user, you can change the password for any sudo user by running the command below. Replace <code><strong><em>sudo_user<\/em><\/strong><\/code> with the actual username of the sudo user whose password you want to change.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>passwd sudo_user\n<\/code><\/pre>\n\n\n\n<p>E.g to change the password of a user called tkeugene, you will run  <strong>passwd tkeugene<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You will be prompted to enter and confirm a new password for the sudo user.<\/li>\n\n\n\n<li><strong>Enter new password<\/strong>: Type the new  password for the user and press Enter.<\/li>\n\n\n\n<li><strong>Retype new password<\/strong>: Re-type the password to confirm and press Enter.<\/li>\n\n\n\n<li>If successful, you will see a confirmation message below;<\/li>\n<\/ul>\n\n\n\n<p><code>passwd: all authentication tokens updated successfully.<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"544\" height=\"179\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-54.png\" alt=\"\" class=\"wp-image-14333\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-54.png 544w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-54-300x99.png 300w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 4: Verify the Changes<\/strong><\/h5>\n\n\n\n<p>To ensure the changes have taken effect, you can test the new password by <a href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-access-a-server-via-ssh-terminal\/\" target=\"_blank\" rel=\"noreferrer noopener\">logging into the server<\/a> using updated credentials, but from a different terminal session while keeping the current one for use, just in case you face a challenge.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Managing user passwords is a key part of server administration to ensure security. If you need to change the SSH password for either the root and sudo users on your server, this guide will walk you through the process. Note: This is guide is will help someone who already has access to SSH, either by [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[1820,2132,1822,1878,2120,2121,1824,1879,2128],"doc_tag":[],"class_list":["post-14288","docs","type-docs","status-publish","hentry","doc_category-cloud-servers-in-kenya","doc_category-cloudpanel","doc_category-cpanel","doc_category-get-all-your-cpanel-help","doc_category-cwp-panel","doc_category-cyberpanel","doc_category-dedicated-servers","doc_category-servers","doc_category-vps-servers"],"year_month":"2026-06","word_count":402,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Eugene","author_nicename":"eugene","author_url":"https:\/\/truehost.com\/support\/author\/eugene\/"},"doc_category_info":[{"term_name":"Cloud servers in Kenya","term_url":"https:\/\/truehost.com\/support\/docs-category\/cloud-servers-in-kenya\/"},{"term_name":"Cloudpanel","term_url":"https:\/\/truehost.com\/support\/docs-category\/cloudpanel\/"},{"term_name":"Cpanel","term_url":"https:\/\/truehost.com\/support\/docs-category\/cpanel\/"},{"term_name":"Cpanel","term_url":"https:\/\/truehost.com\/support\/docs-category\/get-all-your-cpanel-help\/"},{"term_name":"CWP Panel","term_url":"https:\/\/truehost.com\/support\/docs-category\/cwp-panel\/"},{"term_name":"Cyberpanel","term_url":"https:\/\/truehost.com\/support\/docs-category\/cyberpanel\/"},{"term_name":"dedicated servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/dedicated-servers\/"},{"term_name":"Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/servers\/"},{"term_name":"VPS-Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/vps-servers\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to change SSH passwords for root and non-root user -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to change SSH passwords for root and non-root user -\" \/>\n<meta property=\"og:description\" content=\"Managing user passwords is a key part of server administration to ensure security. If you need to change the SSH password for either the root and sudo users on your server, this guide will walk you through the process. Note: This is guide is will help someone who already has access to SSH, either by [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-07T08:56:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-53.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-change-ssh-passwords\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-change-ssh-passwords\\\/\",\"name\":\"How to change SSH passwords for root and non-root user -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-change-ssh-passwords\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-change-ssh-passwords\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-53.png\",\"datePublished\":\"2024-10-02T11:17:28+00:00\",\"dateModified\":\"2024-10-07T08:56:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-change-ssh-passwords\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-change-ssh-passwords\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-change-ssh-passwords\\\/#primaryimage\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-53.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-53.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-change-ssh-passwords\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to change SSH passwords for root and non-root user\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to change SSH passwords for root and non-root user -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/","og_locale":"en_US","og_type":"article","og_title":"How to change SSH passwords for root and non-root user -","og_description":"Managing user passwords is a key part of server administration to ensure security. If you need to change the SSH password for either the root and sudo users on your server, this guide will walk you through the process. Note: This is guide is will help someone who already has access to SSH, either by [&hellip;]","og_url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/","article_modified_time":"2024-10-07T08:56:19+00:00","og_image":[{"url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-53.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/","url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/","name":"How to change SSH passwords for root and non-root user -","isPartOf":{"@id":"https:\/\/truehost.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/#primaryimage"},"image":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/#primaryimage"},"thumbnailUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-53.png","datePublished":"2024-10-02T11:17:28+00:00","dateModified":"2024-10-07T08:56:19+00:00","breadcrumb":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/#primaryimage","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-53.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-53.png"},{"@type":"BreadcrumbList","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-passwords\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to change SSH passwords for root and non-root user"}]},{"@type":"WebSite","@id":"https:\/\/truehost.com\/support\/#website","url":"https:\/\/truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/14288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=14288"}],"version-history":[{"count":3,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/14288\/revisions"}],"predecessor-version":[{"id":14547,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/14288\/revisions\/14547"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=14288"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=14288"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=14288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}