{"id":537,"date":"2025-05-28T09:19:36","date_gmt":"2025-05-28T09:19:36","guid":{"rendered":"https:\/\/faq.powervps.ru\/?p=537"},"modified":"2025-05-28T09:19:36","modified_gmt":"2025-05-28T09:19:36","slug":"how-to-install-and-change-ssh-port-for-openssh-server-on-windows-10","status":"publish","type":"post","link":"https:\/\/faq.powervps.ru\/?p=537","title":{"rendered":"How to Install and Change SSH Port for OpenSSH Server on Windows 10"},"content":{"rendered":"<h2>How to Install and Change SSH Port for OpenSSH Server on Windows 10<\/h2>\n<p>Follow these steps to install OpenSSH Server on your Windows 10 machine and change the SSH port to <strong>2222<\/strong>.<\/p>\n<h3>1. Install OpenSSH Server on Windows 10<\/h3>\n<ol>\n<li>Open <strong>Settings \u2192 Apps \u2192 Optional Features<\/strong>.<\/li>\n<li>Scroll down and click <strong>Add a feature<\/strong>.<\/li>\n<li>Find <strong>OpenSSH Server<\/strong> in the list and click <strong>Install<\/strong>.<\/li>\n<\/ol>\n<p>If you prefer PowerShell, run:<\/p>\n<pre><code>Add-WindowsCapability -Online -Name OpenSSH.Server<\/code><\/pre>\n<h3>2. Start and Enable OpenSSH Service<\/h3>\n<p>Open PowerShell or Command Prompt <strong>as Administrator<\/strong> and run:<\/p>\n<pre><code>Start-Service sshd\r\nSet-Service -Name sshd -StartupType 'Automatic'<\/code><\/pre>\n<h3>3. Allow SSH Port in Windows Firewall<\/h3>\n<p>Allow the default SSH port (22):<\/p>\n<pre><code>New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22<\/code><\/pre>\n<h3>4. Test the SSH Connection<\/h3>\n<p>Try connecting from another computer:<\/p>\n<pre><code>ssh your_username@your_windows_ip<\/code><\/pre>\n<h3>5. Change SSH Port to 2222<\/h3>\n<ol>\n<li>Go to <code>C:\\ProgramData\\ssh\\<\/code>.<\/li>\n<li>Open the file <code>sshd_config<\/code> with Notepad as Administrator.<\/li>\n<li>Find the line <code>#Port 22<\/code>, remove the <code>#<\/code>, and change <code>22<\/code> to <code>2222<\/code>:<\/li>\n<\/ol>\n<pre><code>Port 2222<\/code><\/pre>\n<p>Save the file.<\/p>\n<h3>6. Open Port 2222 in Windows Firewall<\/h3>\n<pre><code>New-NetFirewallRule -Name sshd2222 -DisplayName 'OpenSSH Server (sshd) 2222' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 2222<\/code><\/pre>\n<h3>7. Restart the SSH Service<\/h3>\n<pre><code>Restart-Service sshd<\/code><\/pre>\n<h3>8. Connect to the New SSH Port<\/h3>\n<p>Now, connect using the new port:<\/p>\n<pre><code>ssh your_username@your_windows_ip -p 2222<\/code><\/pre>\n<p>Or specify port <strong>2222<\/strong> in your SSH client (e.g., PuTTY).<\/p>\n<hr \/>\n<p>If you have any issues during these steps, feel free to ask for help in the comments!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Install and Change SSH Port for OpenSSH Server on Windows 10 Follow these steps to install OpenSSH Server on your Windows 10 machine and change the SSH port to 2222. 1. Install OpenSSH Server on Windows 10 Open Settings \u2192 Apps \u2192 Optional Features. Scroll down and click Add a feature. Find OpenSSH [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[30],"class_list":["post-537","post","type-post","status-publish","format-standard","hentry","category-1","tag-openssh-server"],"_links":{"self":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts\/537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=537"}],"version-history":[{"count":1,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts\/537\/revisions"}],"predecessor-version":[{"id":538,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts\/537\/revisions\/538"}],"wp:attachment":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}