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.

Acker Permalink
May 13, 2014, 18:01

Your knowledge of this subject comes through clearly in this post. I love to read this kind of post, I hope you will update it. academic assignment.

June 05, 2014, 22:25

I am not able to figure out the advantage of this?

Thanks
Susan

July 18, 2014, 09:33

Is so amazing

July 28, 2014, 06:14

Ok it will be superb

September 12, 2014, 10:31

Its a great pleasure reading your post.
Its full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work.

October 28, 2014, 11:55

Oh. Thi is too hard for me. But i'll try)

Christopher Permalink
October 30, 2014, 03:17

Why do you allow links in your comments?

Leave a new comment

(why do I need your e-mail?)

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

Type the word "security": (just to make sure you're a human)

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

Advertisements