This is going to be a super quick tutorial about how to access a Windows environment through ssh.

Step 1. Install cygwin, and make sure openssh and cygrunsrv packages are installed:


Make sure openssh is selected for installation


Make sure cygrunsrv is selected for installation

Step 2. Start cygwin and run ssh-host-config to configure ssh:


Run ssh-host-config to configure ssh

Step 3. Run cygrunsrv -S sshd to start sshd as a Windows service:


Run cygrunsrv -S sshd to start sshd

Step 4. Ssh into Windows using your favorite ssh client


Use putty to ssh into Windows

You can even set this up for your local workstation (if it happens to be Windows). Then you can forget about cmd.exe or PowerShell and use a real shell locally. Until next time.

Comments

January 27, 2014, 19:16

Another alternative that I would recommend is 'BitVise SSH Server'. It is free for personal use, but, unfortunately, not open source. By default, it is configured to run as a service at startup. I can even SSH to a freshly booted machine and log in using the SSH shell (I use mRemote / mRemoteNG [ http://www.mremoteng.org/ ] on the other side to access the SSH clients -- With its tabbed interface, it is easy to deal with multiple machines simultaneously).

January 27, 2014, 22:20

Thanks for the comment, didn't know about BitVise SSH Server and mRemote. Very useful!

Chris Permalink
January 27, 2014, 21:24

Why would you use SSH on a Windows server?

January 27, 2014, 22:19

Well to remotely manage the server though ssh and to deploy updates through ssh, and transfer files very quickly through scp, as well as having a better shell!

Chris Permalink
January 30, 2014, 01:32

I am not saying there is anything wrong with SSH, just that most all management of Windows can be done with PowerShell, remotely and securely...

And for secure file transfer you could enable Secure FTP which is also built-in and configurable through PowerShell...

March 26, 2014, 15:06

For us folks that are comfortable with the bash shell, this makes working in Windows from putty or a *nix host quite convenient. Powershell has its uses, but it really isn't any more secure than scp. And, IMHO, establishing sessions with the more secure public/private rsa keys via ssh-keygen is a lot easier than having to deal with Kerberos, CredSSP or certificate.
Technet article discussing WinRM and Powershell for remote management:
http://social.technet.microsoft.com/Forums/windowsserver/en-US/af988394-fff3-4b05-9fed-e85104f6856e/remote-powershell-security

Foo Permalink
January 28, 2014, 15:25

Because this particular windows machine is the only one *you* can access that can access another (linux) server through ssh? That's a real use case even if that seems a bit weird.

So with this you can ssh into windows, and then ssh into the 'target' server.

Otherwise you'd have to remote desktop into the windows machine, and then ssh from there into the target server.

Chris Permalink
January 30, 2014, 01:34

Sounds like you want to explore Remote Desktop Gateway which is included for free in Windows Server...

February 20, 2014, 05:37

Thanks Peteris for informative share! I really want to learn more about SSH for windows.

no_name Permalink
March 01, 2014, 11:40

I actually do the other way round; I got cygwin on my wintel box and from it I ssh/scp/sftp etc to UNIX boxes. Sshd/cygwin on wintel is nice if you need to admin wintels with strong UNIX background.

March 12, 2014, 10:52

professional essay writers It's exactly what I need! Thanks for sharing)

March 23, 2014, 02:31

this is great.thank you for sharing…

March 23, 2014, 04:04

thanks for this article, its very informative posting

April 14, 2014, 04:52

The massive technology core that keeps Amazon running is entirely Linux-based. As of 2005 swiss replica watches
, Amazon has the world's three largest Linux databases, with a total capacity of 7.8 terabytes (TB), 18.5 TB and 24.7 TB respectively [ref]. The central rolex datejust replica Amazon data warehouse is made up of 28 Hewlett Packard servers, with four CPUs per node, running Oracle 9i database software.

Leave a new comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.

Advertisements