{"id":470,"date":"2023-06-28T21:03:02","date_gmt":"2023-06-28T21:03:02","guid":{"rendered":"https:\/\/techtutelage.net\/?p=470"},"modified":"2025-05-18T05:05:17","modified_gmt":"2025-05-18T05:05:17","slug":"enable-ssh-password-authentication","status":"publish","type":"post","link":"https:\/\/techtutelage.net\/?p=470","title":{"rendered":"Enable SSH Password Authentication"},"content":{"rendered":"\n<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/MKtXVGGLGx4\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n\n\n\n<p>Most major cloud providers such as AWS, OCI, Google Cloud, disable SSH password authentication method by default, allowing the users to only use private\/public key pair for authentication. Even though using private\/public keys is much safer method, some time you may need to be able to access your server using username and a password. To enable SSH password authentication, you need to make a few changes to the SSH server configuration file. Here&#8217;s a step-by-step guide:<\/p>\n\n\n\n<p>Connect to your SSH server as a user with administrative privileges. This can be done either by logging in directly or using a remote management tool like SSH or PuTTY. To connect with ssh run the commend below in your terminal window.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>ssh -i PATH\/TO\/PRIVATE.KEY USER@SERVER_ADDRESS<\/code><\/pre>\n\n\n\n<p>Once connected to your server, open the SSH server configuration file &#8220;sshd_config&#8221;. The location may vary depending on the operating system you are using, in most linux distributions it is located in &#8220;\/etc\/ssh\/&#8221;. To open the file with nano run the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>nano \/etc\/ssh\/sshd_config<\/code><\/pre>\n\n\n\n<p>To allow password authentication globally for all users (NOT RECOMMENDED!). In &#8220;sshd_config&#8221; Search for the line that begins with &#8220;PasswordAuthentication&#8221;. If password authentication is disabled, it will be set to &#8220;no&#8221;. To enable password authentication all you need to do is change the value to &#8220;yes&#8221;. Save and close the file, then restart your ssh service by running the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>service ssh restart<\/code><\/pre>\n\n\n\n<p>To  only allow password authentication for specific user  (RECOMMENDED!). Leave the &#8220;PasswordAuthentication&#8221; directive set to &#8220;no&#8221;. Go to the bottom of  &#8220;sshd_config&#8221; file and add the following two lines.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>Match User USERNAME_HERE\n    PasswordAuthentication yes<\/code><\/pre>\n\n\n\n<p>Save and close the file, then restart your ssh service by running the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-green-cyan-color has-black-background-color has-text-color has-background\"><code>service ssh restart<\/code><\/pre>\n\n\n\n<p>This will make an exception to the global SSH configuration and it will enable password authentication for the listed user.<\/p>\n\n\n\n<p>To see this tutorial in action check out my video tutorial on YouTube!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most major cloud providers such as AWS, OCI, Google Cloud, disable SSH password authentication method by default, allowing the users to only use private\/public key pair for authentication. Even though using private\/public keys is much safer method, some time you may need to be able to access your server using username and a password. To [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,1],"tags":[],"class_list":["post-470","post","type-post","status-publish","format-standard","hentry","category-tutorials","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=470"}],"version-history":[{"count":3,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/470\/revisions"}],"predecessor-version":[{"id":473,"href":"https:\/\/techtutelage.net\/index.php?rest_route=\/wp\/v2\/posts\/470\/revisions\/473"}],"wp:attachment":[{"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtutelage.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}