ssh in to Microsoft Windows

by Todd Ogasawara

freesshd.gif

I was just reading Chris Travers'...

Technical Analysis: Remote Administration of Windows Systems with SSH (9 page PDF)

...which discusses using SSHWindows in a minimal installation of Cygwin. I've always felt a little uncomfortable installing Cygwin for just a single function (even one as important as allowing secure SSH access). But, Chris' analysis makes it worthwhile to look at this method if you want to use SSH to work with a remote Microsoft Windows system.

There is an alternative, however. freeSSHd is a freeware ssh server for Microsoft Windows. It seems a little unstable. So, I wouldn't recommend it for serious systems work at this stage of its development. However, it does not need Cygwin to be installed to work and seems to work well enough when it is up and running (it has crashed on me a few times). I'm going to keep my eye on future freeSSHd development and hope it becomes more stable in the near future.

One other item: In his closing thoughts section of the paper, Chris says: SSH is not as useful on Windows as it is on Linux, in part due the differences between how remote access to graphical applications is handled, and in part due to the fact that Windows is not generally as command-line oriented as Linux.

While I agree with Chris in general, I think that Microsoft PowerShell is a game changer. Microsoft PowerShell gives system administrators deep system access at the command line level. It basically makes a command line window a usable shell in the way UNIX/Linux shells are. I found that I could start PowerShell up after logging in to a Windows XP box. xterm looked a little odd after starting PowerShell. However, switching the xterm color scheme from black-on-white to white-on-black (old school terminal look) took care of most of the viewing problems (though not all).

I'm may have a bit more free time than usual in July and August. So, I may take more time looking at remotely managing Windows workstations and servers from a command line (shelled in through SSH) using PowerShell. I think this is the way I will prefer to manage Windows servers in the future (especially since that is the way I work with Linux boxes right now).

FYI: The screen-cap above is a CentOS 4 Linux installing running in a Virtual PC 2007 virtual machine accessing the host Windows XP through an ssh session to freeSSHd running on XP.

6 Comments

Dustin Puryear
2008-06-18 09:33:14
Hi Todd! Yeah, a SSH server on Windows isn't *as* useful as it is on Linux, but it's still pretty damn useful. So we both agree there.


PowerShell is a pretty big changer, but even being able to run normal Windows shell scripts via SSH is important (e.g., to take down a Service prior to a backup running).


Todd Ogasawara
2008-06-19 00:50:58
Hey, Dustin: Yep, being able to run simple Windows batch commands in an ssh shell can be useful. But, PowerShell really provides a lot of power from the command line not available from the old CMD.exe box. I wish Windows Server 2003 Core Edition could run PowerShell natively (no .Net Framework there). That would be really interesting. There is a workaround to get PowerShell on Core. But, that is another blog item :-)
Aaron Trevena
2008-06-19 05:14:11
Based on my past experience powershell won't change a huge ammount - few Non-MS windows servers or applications have a commandline API, and without cygwin, curses, and an X Window Server it doesn't come close to remotely administering a *nix box.


If Bash, Perl or Python were included in Powershell as standard that would be handy.

Todd Ogasawara
2008-06-19 09:01:49
Aaron: My guess is that you haven't looked at PowerShell. It provides full access to the .Net Framework. This means you have full access to information and controls in that framework (e.g., get environmental information like temperature and fan speed from sensors). And, you can use it much as you would Python or Ruby in a Linux terminal shell. Moreover, IronPython is available right now and is a first class citizen from the .Net perspective. IronRuby will be available in an easy to install form in the near future (source available now) and also has full access to the .Net Framework.
Mahesh
2008-06-21 00:17:48
Hi Todd,


There is another FREE+Open-Source alternative for SSH (client and server) on Windows. It is based on the Cygwin OpenSSH, but, does NOT require the installation of the whole Cygwin.


The OpenSSh for Windows can be found here: http://sshwindows.sourceforge.net/.


Here's my blog entry containing reference to SSH for Windows: http://srmrt.blogspot.com/2008/06/few-things-to-do-after-fresh-xp-install.html


I have a couple of Linux boxes at home. I use my Windows notebooks as a clients to these boxes. So, I did install the free SSH for windows that I have mentioned. I am not a Windows power user and I am not used to Windows commands, so I haven't necessarily tried all the server features of the mentioned SSH. But, if/when you get a chance do try it out.


Regards
Mahesh


Todd Ogasawara
2008-06-21 10:44:20
Hey, Mahesh: Thanks for the comment. SSHWindows (aka OpenSSH for Windows) is the solution Chris Travers writes about in the Port 25 Technical Analysis paper linked above. You might want to grab the PDF of his article if you want some good additional info about the tool you already use.