{"id":2246,"date":"2022-11-16T08:53:01","date_gmt":"2022-11-16T13:53:01","guid":{"rendered":"https:\/\/increasec.com\/?p=2246"},"modified":"2022-11-29T10:14:43","modified_gmt":"2022-11-29T15:14:43","slug":"ssh-on-windows-10-works-on-non-domain","status":"publish","type":"post","link":"https:\/\/increasec.com\/?p=2246","title":{"rendered":"SSH on Windows 10+  works on non-domain"},"content":{"rendered":"\n<p>doing updates on a network that doesn&#8217;t have a domain, yet.  Want to physically touch each PC as little as possible due to requirements for masks, hairnets, jumpsuits, steel toes, hard hats etc.  The plan is to use PsExec to get a cmd shell on each PC and setup SSH from there.<\/p>\n\n\n\n<p>Install the Microsoft SysInternals package on a PC on the same subnet<\/p>\n\n\n\n<p>Install the WakeMeOnLan software on your workstation PC, run it a few times during the day to collect MAC address information.  We will use this after hours to wake up PCs that have gone to sleep.<\/p>\n\n\n\n<p>Use psexec64 to connect to each PC<\/p>\n\n\n\n<p>.\\PsExec64.exe -i \\$RemoteServer -h -u UserOnTargetPc -p SuperSecurePasswrd cmd<\/p>\n\n\n\n<p>Install the OpenSSH service<\/p>\n\n\n\n<p>dism \/Online \/Add-Capability \/CapabilityName:OpenSSH.Server~~~~0.0.1.0<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"847\" height=\"231\" src=\"https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image.png\" alt=\"\" class=\"wp-image-2247\" srcset=\"https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image.png 847w, https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image-300x82.png 300w, https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image-768x209.png 768w\" sizes=\"auto, (max-width: 847px) 100vw, 847px\" \/><\/figure>\n\n\n\n<p>this is not fast,  assume 3min or more if bandwidth is low.   and occasionally it asks if you want to restart the PC.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Set the shell that OpenSSH uses to Powershell as we can already use PsExec to get a cmd.exe shell.  <\/p>\n\n\n\n<p>reg add HKLM\\SOFTWARE\\OpenSSH \/v DefaultShell \/t REG_SZ \/d &#8220;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe&#8221;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>now we need to start the service, 2nd command sets it to auto-start<\/p>\n\n\n\n<p>net start &#8220;OpenSSH SSH Server&#8221;<\/p>\n\n\n\n<p>Set-Service -Name sshd -StartupType automatic      (powershell)<\/p>\n\n\n\n<p>OR<\/p>\n\n\n\n<p>sc config sshd start=auto       (cmd)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>We can now use Putty or whatever to SSH.   Notice the prompt includes PS for PowerShell<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"637\" height=\"189\" src=\"https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image-1.png\" alt=\"\" class=\"wp-image-2249\" srcset=\"https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image-1.png 637w, https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image-1-300x89.png 300w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Looking at the SSHD service we can see that it takes about 3MB of RAM, when someone is actively using the service.  <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"499\" height=\"118\" src=\"https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image-2.png\" alt=\"\" class=\"wp-image-2250\" srcset=\"https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image-2.png 499w, https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image-2-300x71.png 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/figure>\n\n\n\n<p>Lets compare that to TeamViewer with nobody using the service, which takes 15MB<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"502\" height=\"190\" src=\"https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image-3.png\" alt=\"\" class=\"wp-image-2251\" srcset=\"https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image-3.png 502w, https:\/\/increasec.com\/wp-content\/uploads\/2022\/11\/image-3-300x114.png 300w\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" \/><\/figure>\n\n\n\n<p>the footprint of the running service is important to my situation as some of the tablets in use have only 4GB of RAM<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>more info here    https:\/\/theitbros.com\/ssh-into-windows\/<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Change the PCs Windows Product Key;   as home versions can&#8217;t join a domain  (tried this multiple times, never seems to work)<\/p>\n\n\n\n<p>slmgr.vbs \/ipk xxxx-xxxx-xxxx-xxxx-xxxx<br>slmgr.vbs \/ato<br>slmgr.vbs \/dli<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Join to a domain using the following    **problem, this asks for credentials**<\/p>\n\n\n\n<p>add-computer \u2013domainname &#8220;YourDomainName&#8221; -restart<\/p>\n","protected":false},"excerpt":{"rendered":"<p>doing updates on a network that doesn&#8217;t have a domain, yet. Want to physically touch each PC as little as possible due to requirements for masks, hairnets, jumpsuits, steel toes,&#8230;<\/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":[67],"class_list":["post-2246","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-windows10"],"_links":{"self":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/2246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2246"}],"version-history":[{"count":17,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/2246\/revisions"}],"predecessor-version":[{"id":2283,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/2246\/revisions\/2283"}],"wp:attachment":[{"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}