Archive for October, 2013

Cygwin’s sshd mysteriously stops working; “operation not permitted”

October 24th, 2013 | Category: JHUAPL,Work

This is a technical post just for reference, and hopefully to help out any others who have had this problem.

Several months ago, many PCs on which I have Cygwin’s SSHD installed refused to let me in.  The symptom: when logging in, either remotely or from localhost, my password would be accepted and I’d see the MOTD, but then without ceremony, I’d be logged out without ever seeing a command prompt or an error.  On the server’s windows event log, I saw “operation not permitted.”

After thrashing about for a really long time (months!) I finally hit upon the solution.

First, the problem: it’s something the IT people at work did to my systems.  Every PC presenting this problem had previously worked just fine until some IT department update, after which they all stopped working.  The IT help desk was of no help whatsoever; a problem has to be incredibly obvious before they notice it.  On every PC without the security package, sshd continued to work fine.  I used the same installer for every single PC, so my setup and config was the same – it was something my IT people did that broke it.

Fortunately, there is a way to modify the system to allow it to work again.  I don’t know if it will work in every instance, but in my case, the default owner of a specific directory was at fault, but I couldn’t see this because of the rather cryptic way that cygwin sshd messages are logged by default.

The solution: Change the owner of the directory, and also put sshd log messages in a unix-y place where you can read them from the command line. Here’s the proceedure:

  1. Setup cygwin’s sshd normally by invoking: ssh-host-config -y (If you have been thrashing about trying to solve this problem and have changed permissions and config files, just run the script again to ensure that your setup is reasonable)
  2. DON’T START sshd.
  3. Issue “chown SYSTEM /var/empty”
  4. Uninstall the default sshd service by invoking: cygrunsrv –remove sshd
  5. Reinstall the service and make the sshd output go to /var/log/sshd.log by invoking: cygrunsrv -I sshd -d “Cygwin sshd” -p /usr/sbin/sshd -a ‘-D -e’

I hope this works for you.

6 comments

Ant Colony Casts

October 13th, 2013 | Category: animals