{"id":644,"date":"2024-06-28T18:12:35","date_gmt":"2024-06-28T12:42:35","guid":{"rendered":"https:\/\/vpswebhostingindia.com\/blog\/?p=644"},"modified":"2024-06-28T18:12:36","modified_gmt":"2024-06-28T12:42:36","slug":"reset-directadmin-password-from-ssh","status":"publish","type":"post","link":"https:\/\/vpswebhostingindia.com\/blog\/reset-directadmin-password-from-ssh\/","title":{"rendered":"How to reset directadmin password from SSH ?"},"content":{"rendered":"\n<p>To reset DirectAdmin password from SSH, you will need to access your<a href=\"https:\/\/www.vpswebhostingindia.com\/vps-hosting\/\"> server as a root<\/a> user.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Here are the steps to do this:<\/h2><nav><ul><li class=\"\"><a href=\"#step-1-access-your-server-via-ssh\">Step 1: Access Your Server via SSH<\/a><\/li><li class=\"\"><a href=\"#step-2-retrieve-the-current-admin-password\">Step 2: Retrieve the Current Admin Password<\/a><\/li><li class=\"\"><a href=\"#step-3-reset-directadmin-password-from-ssh\">Step 3: Reset directadmin password from SSH<\/a><\/li><li class=\"\"><a href=\"#step-4-update-direct-admin-configuration\">Step 4: Update DirectAdmin Configuration<\/a><\/li><li class=\"\"><a href=\"#step-5-restart-direct-admin\">Step 5: Restart DirectAdmin<\/a><\/li><li class=\"\"><a href=\"#alternative-method-using-direct-admin-commands\">Alternative Method: Using DirectAdmin Commands<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-1-access-your-server-via-ssh\">Step 1: Access Your Server via SSH<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open your terminal or SSH client.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"437\" height=\"433\" src=\"http:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/05\/image-10.png\" alt=\"reset directadmin password from SSH\" class=\"wp-image-613\" srcset=\"https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/05\/image-10.png 437w, https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/05\/image-10-202x200.png 202w, https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/05\/image-10-150x150.png 150w\" sizes=\"auto, (max-width: 437px) 100vw, 437px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Connect to your server using the root user. For example:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>   ssh root@your_server_ip<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-2-retrieve-the-current-admin-password\">Step 2: Retrieve the Current Admin Password<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Once you are logged in, you can retrieve the current DirectAdmin admin password by running the following command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">   cat \/usr\/local\/directadmin\/scripts\/setup.txt | grep adminpass<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"905\" height=\"104\" src=\"https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-4.png\" alt=\"\" class=\"wp-image-645\" srcset=\"https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-4.png 905w, https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-4-300x34.png 300w, https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-4-768x88.png 768w\" sizes=\"auto, (max-width: 905px) 100vw, 905px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>This command will display a line similar to:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">   adminpass=your_current_password<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-3-reset-directadmin-password-from-ssh\">Step 3: Reset directadmin password from SSH<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>To reset the admin password, use the following command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   passwd admin<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>You will be prompted to enter the new password and confirm it.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"963\" height=\"163\" src=\"https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-5.png\" alt=\"\" class=\"wp-image-646\" srcset=\"https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-5.png 963w, https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-5-300x51.png 300w, https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-5-768x130.png 768w\" sizes=\"auto, (max-width: 963px) 100vw, 963px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-4-update-direct-admin-configuration\">Step 4: Update DirectAdmin Configuration<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After resetting the admin password, you need to update the DirectAdmin configuration with the new password. Run the following command:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>   echo \"adminpass=new_password\" &gt;&gt; \/usr\/local\/directadmin\/scripts\/setup.txt<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-5-restart-direct-admin\">Step 5: Restart DirectAdmin<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Finally, restart DirectAdmin to ensure the changes take effect:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   service directadmin restart<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"913\" height=\"198\" src=\"https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-6.png\" alt=\"\" class=\"wp-image-647\" srcset=\"https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-6.png 913w, https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-6-300x65.png 300w, https:\/\/vpswebhostingindia.com\/blog\/wp-content\/uploads\/2024\/06\/image-6-768x167.png 768w\" sizes=\"auto, (max-width: 913px) 100vw, 913px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"alternative-method-using-direct-admin-commands\">Alternative Method: Using DirectAdmin Commands<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>You can also use DirectAdmin&#8217;s internal command to reset the admin password. Run the following:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   \/usr\/local\/directadmin\/directadmin set admin_pass new_password<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>Restart DirectAdmin:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   service directadmin restart<\/code><\/pre>\n\n\n\n<p>Make sure to replace <code>new_password<\/code> with the actual password you want to set.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To reset DirectAdmin password from SSH, you will need to access your server as a root user. Step 1: Access Your Server via SSH Step 2: Retrieve the Current Admin Password cat \/usr\/local\/directadmin\/scripts\/setup.txt | grep adminpass adminpass=your_current_password Step 3: Reset directadmin password from SSH Step 4: Update DirectAdmin Configuration Step 5: Restart DirectAdmin Alternative Method: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":651,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,36],"tags":[35],"class_list":["post-644","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-control-panel","category-direct-admin","tag-reset-directadmin-password-from-ssh"],"_links":{"self":[{"href":"https:\/\/vpswebhostingindia.com\/blog\/wp-json\/wp\/v2\/posts\/644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpswebhostingindia.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vpswebhostingindia.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vpswebhostingindia.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/vpswebhostingindia.com\/blog\/wp-json\/wp\/v2\/comments?post=644"}],"version-history":[{"count":4,"href":"https:\/\/vpswebhostingindia.com\/blog\/wp-json\/wp\/v2\/posts\/644\/revisions"}],"predecessor-version":[{"id":652,"href":"https:\/\/vpswebhostingindia.com\/blog\/wp-json\/wp\/v2\/posts\/644\/revisions\/652"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpswebhostingindia.com\/blog\/wp-json\/wp\/v2\/media\/651"}],"wp:attachment":[{"href":"https:\/\/vpswebhostingindia.com\/blog\/wp-json\/wp\/v2\/media?parent=644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpswebhostingindia.com\/blog\/wp-json\/wp\/v2\/categories?post=644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpswebhostingindia.com\/blog\/wp-json\/wp\/v2\/tags?post=644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}