Category Archives: Windows

Setting up SFTP/SSH on Windows

I’ve been wrestling with OpenSSH for Windows to set up an SFTP server. I’m still ironing out some of the fine detail, but the basic steps are below.

This article covers the initial setup:

  • Install the software
  • If the FTP user doesn’t already exist in Windows, create it.
  • Open a command prompt in the c:\program files\openssh directory (assuming that’s where it’s installed)
  • Set up the group file: mkgroup -l >> etc\group
  • Set up the passwd file: mkpasswd -l -u username >> etc\passwd
    The -l means local user. If it’s a domain user, use -d. Type just mkpasswd for help.
  • Create the home directory for your user. If following the IIS standard, that would be c:\inetpub\ftproot\username — but it can be anywhere
  • Edit the passwd file to put the home directory in. Load it in Notepad or another text editor. As with all the files to do with OpenSSH, passwd is in Unix format, so you may do better to use an editor that knows Unix end-of-line characters. Anyhow, change the second last field to match the home directory. Cygdrive notation needs to be used, eg for the above /cygdrive/c/inetpub/ftproot/username
  • For domain users, you’ll have to make sure the Domain Users group is added to the groups file. This can be done by doing a mkgroup > textfile.txt and then extracting the line for Domain Users from the file and adding it manually to the etc\groups file.
    Also double-check that the group ID (the third field in the groups file, which is delimited by colons) matches the ID your user(s) in the passwd file (the fourth field).
  • Start the OpenSSH service (note that when adding additional users, you do not need to restart the service

Continue reading

No Vista clean install for you!

Counting on buying an upgrade version of Windows Vista, but wiping the machine first of the old version so it’s a clean install? Bad luck, Microsoft’s made changes that will prevent it, unless you install onto an empty partition. Never mind that it’ll make a periodic re-install a right pain in the arse. What were they thinking?

PS. Tuesday: Ed Bott pours cold water on this, not saying it’s untrue, but saying “wait and see…”

SFTP from scheduled tasks

I was asked to set up a daily SFTP job to push files off a Windows box.

Windows has FTP built-in. But SFTP? Well there’s the free (and open-source) Putty implementation which provides a number of SSH tools, including SFTP. Free is good. I like free.

Putty SFTP is fairly straightforward to use from the command line; pretty similar to any other ftp client. Basically chuck everything into a directory and you can run it directly. Under Windows it caches public keys into the Windows Registry in HKEY_CURRENT_USER, and will ask about this the first time.

For batch use, you can create a BAT file that calls it like this

psftp -l [user] -pw [password] [host] -P [port] -b [scriptfile]

…and just put your FTP commands into the script file.

For running it as a scheduled task, you’d preferably want to run it under a special user, as you wouldn’t want it under your own user account. It seems not to like asking about caching unless you’re the person logged in. Even running with RUNAS didn’t work for me — it flashed up something lightning-fast, but immediately failed.

The only way around it I could find was to log on interactively as the scheduled task user. As expected it asked the first time. Subsequent times it didn’t ask, and worked happily as a scheduled task.

(Also found recently: How to set up an SFTP server on a Windows machine. Or a prefab one like FreeFtpD is also an option.)

Train Simulator 2 arriving soon

For all the geek train nuts out there, it’s been confirmed that Microsoft is working on a second version of Train Simulator. The lead developer, Rick Selby has surfaced with a blog so people can track progress. (I wonder if he knows there’s a Puffing Billy station named after him?) In fact, the official site links to numerous developers’ blogs.

I’ve played both Train Simulator and its main opposition, Trainz… to my mind, Trainz is probably better, and they’ve kept working on their product over the past few years, as TS has been somewhat neglected (and I haven’t had it installed in quite some time partially because it won’t run without Admin privileges).

Windows Vista imperialism?

There’s some disquiet about the Windows Vista Games menu, highlighting the fact that use of parental controls will mean any game without an ESRB rating won’t appear. The ratings apparently cost US$2000-3000 to obtain, which means they’re effectively out of the range of independent games developers.

So I guess Snood and the like wouldn’t appear on the Vista games menu.

What I want to know is — are the North American ESRB ratings going to be forced onto every user the world over who wants to use the parental controls?

I’m not going to claim for a moment that the Australian government’s Office of Film and Literature Classification is perfect, but I do want to know if the Vista games menu when used by Australians will be showing Australian ratings (G, G8+, M, MA) rather than the unfamiliar North American ratings (C, E, T, M, A). And likewise for every other country.

We have enough troubles with products constantly defaulting to US English. We don’t need another North American standard rammed down our throats.

Attachment manager

You learn something new every day. Or maybe every week. This week I learnt about Attachment Manager.

Remember how we wailed when, back in 2000, Microsoft patched Outlook to block extensions from dozens of file types that were useful, but dangerous err powerful. Initially the extra security was optional, but it came built into later versions of Outlook.

Some of us resorted to hacks like Attachment Options to tell Outlook to STFU and give us the attachment.

From XP SP2 they’ve replaced it with the Attachment Manager (via David), which provides an extra prompt when you try and open/run the file. The file attribute even survives the file being moved around, provided it’s on NTFS. And it covers numerous applications, including Outlook, IE and MSN IM.

In some cases it simply won’t let you open/extract the file. For those you need to go into the Properties and Unblock it manually. Just another hoop to jump through.

The free upgrade – dumping the old video card

The older of my PCs is a 1.7 Ghz Celeron with an Intel 845GL chipset and a 512Mb of RAM. It also has an old ancient Diamond Viper 550 (now owned by NVidia) graphics card in it, which under Windows 2000, it had seemed pretty zippy. Under XP, it’s not. It’s slow. And I’ve come to the conclusion that the XP drivers just aren’t up to scratch.

Over the weekend I got into the BIOS settings and switched back to the integrated graphics, with the frame buffer set to the max (8Mb). XP couldn’t figure out what it was looking at, so I had to go to the Intel web site and find the drivers. As it happens, up to that point I wasn’t even sure precisely what chipset it had (the manual has long been lost) but I figured out it was the 845GL just by looking at the initial prompts as the PC booted (and pressing Pause at the right time to jot down the precise details — which I later worked out I didn’t actually need).

In short, under XP, the integrated 845GL graphics whomps ye olde Diamond Viper 550. Suddenly scrolling the browser is back to a decent speed, and MAME doesn’t jutter. And incredibly the PC now boots up into XP faster than the newer 3 Ghz monster next to it — the latter has more software installed, including SQL Server.

The next test will be to see how 3D games perform with it, but general use looks much faster, so I’ll stick with it.

So while I had been considering putting more RAM and/or a new graphics card, I’ve just achieved what looks like a significant speed boost for $0 outlay. W00t!

Cool stuff for Windows

Easily block Flash animations in Firefox with Flashblock. Has a whitelist so you can let your favourite sites through. I’m finding it handy to stop advert-laden (mostly MSM) sites stealing inordinate amounts of CPU just to show their ads. (Though the Herald-Sun must use something else for its slow moving mid-page picture banner thingy.)

Could Democracy be the Firefox of media players? It looks pretty cool, and there’s a new version just out, though at the moment I’m using the Real and Quicktime alternatives from Free-codecs.com.

Looking for something like Co-pilot, but free? How about UltraVNC Single Click? (via Anthony)

More Vista ponderings

The Windows Vista Team blog has explained how the Windows Experience Index works, by evaluating your processor, memory, graphics, game graphics and hard disk, and giving each a ranking.

All well and good.

But this only happens when you install Windows Vista.

While I don’t plan to do it anytime soon, I wouldn’t mind knowing how my current PCs would perform with Windows Vista. I was hoping the Windows Vista Upgrade Advisor would provide this kind of information, but it doesn’t — it’s much more vague.

I know my old boxes do meet (and exceed) the minimum standard, but we all know that’s never a true indication of whether it’s going to be pleasant/productive to use.

By the way, would you believe Microsoft’s new Zune player is not Vista compatible? Nor does it play anything using Windows Media DRM. And Engadget says the Zune installation sucks (yes, it really does demand a Windows Live ID and your name, address and phone number before letting you use it). What a balls-up.

I’m not getting Vista, yet

Windows Vista has been released to manufacturing, and Ed Bott has a run-down, summarising reaction (mixed, mostly positive), the perils of installing it over old versions (nothing new there then; why would you subject yourself to that?!), noting how good it is on new installations, even on old hardware, and the key question of whether it’s worth upgrading.

I haven’t tried out any of the betas. I’ve read some of the reviews, but I haven’t used Windows Vista. My gut feeling is it’s probably a pretty good upgrade, but I must be getting more cautious in my old age, because I’m not going to touch it until at least SP1, or perhaps even SP2. Not only does that give MS the chance to get all the glitches under control, it also gives a bit of time for the hardware to catch up so that it provides nice performance.

In fact I have half a mind to buy a laptop at some stage to replace one of my desktop machines. Picture it, sitting in a hammock in the sun in the backyard working/surfing, a beer by my side. And if I do, I think I’d be looking to make sure it’s XP, not Vista. I don’t need the hassles of a new OS to learn, not for a couple of years.

This means though, that if I’m going to do this, I’ll have to be quick: “On January 30, you will be hard pressed to find a machine that doesn’t have Windows Vista available,” Mr Allchin said.

But hey, what I really want to know is… what are the built-in games in Vista? Looks like depending on which version you get, there’ll be the oldies: Freecell, Hearts, Solitaire, and Minesweeper, as well as Spider Solitaire, Shanghai, Purble Place (aimed at the kiddies), Mahjong, Inkball and Chess. What, no 3-D Pinball?!? Ripped off! I wonder if you’ll be able to copy the EXE across from an old version, like people did with Cardfile from Win3.1 to 95.

AVG IS still free

AVG is moving its free anti-virus from version 7.1 to 7.5. Never fear, it’s still free, despite the announcement implying that it won’t be after January 2007. What it’s actually saying is that version 7.1 won’t be supported after that time, but a lot of people are misreading it.

The optimist in me says it’s just worded badly. The cynic in me notes that some recall the switch from version 6 to 7 was worded in a similar way and it smells a little bit of the Real Player page that featured a big advert for the paid version, and a tiny link to the free one. But hey, the bottom line is AVG is still free, and millions of home users can continue to protect their PCs. Can’t really argue with that.

Free version 7.5 download here.

Other freebie anti-virus packages for Windows include Avast, Trend’s free adhoc (online) scan and the open-source ClamWin.