Separating OpenSSH's Privileges For Safety
Niels Provos writes: "Even though I should be working on my disseration proposal right now, I got side tracked with a little project.
Markus and I have been working on a 'Privilege Separated OpenSSH.' The basic idea is that OpenSSH starts two processes, one privileged and one unprivileged. The unprivileged process deals with all the network data processing, while the privileged process monitors and decides if authentication was successful. This reduces the impact that bugs in for example third party libraries can have on OpenSSH. We hope that any privilege escalation will not be possible any more in the future." This privilege separation should show up in future versions of OpenSSH, including the portable version.
Since all is silent here, I'll post a word of encouragement:
This is a fine idea. Separation of roles is good both for keeping code tidy and for security. Carry on!
...then don't fix it!!
OpenSSH ends up looking like Qmail with each discrete task running as a separate program under a different user?
This sounds a lot like twoftpd, which seems like a great idea.
I tink it would be cool to have a version of sshd that would ONLY allow secure file transfer.
/usr/local/bin/sftp-server and channels all the session stuff to it.
I've done some porting work with ssh 2 and the protocol supports several types of "channels". Many of them deal with login and remote execution: "shell", "pty-req" and "exec".
However, when you run scp or sftp (included with ssh2), the daemon uses ssh to invokes a "subsystem" channel request, with the subsystem of "sftp". (At least with versionn2 of the protocol, I don't think this happens with ssh version 1). This usually starts a daemon sub-process
It would be cool if this was the only function available, and that the sftp directory was chosen on the fly per-user and chroot'd or something so that only a subset of files was available somehow. This would allow you to have a bunch of secure directories for your friends, or even anonymous sftp, without having to let people log into your machine.
This sounds a bit like the trusted and untrusted code thing in Microsoft's .NET, only more hassle because you have to go to the trouble of creating actual users for different security contexts, rather than it being done automatically.