<p>I'm looking at creating a server in python that I can run, and will work as an SSH server. This will then let different users login, and act as if they'd logged in normally, but only had access to one command.</p>

<p>I want to do this so that I can have a system where I can add users to without having to create a system wide account, so that they can then, for example, commit to a VCS branch, or similar.</p>

<p>While I can work out how to do this with conch to get it to a "custom" shell... I can't figure out how to make it so that the SSH stream works as if it were a real one (I'm preferably wanting to limit to /bin/bzr so that bzr+ssh will work.</p>

<p>It needs to be in python (which i can get to do the authorisation) but don't know how to do the linking to the app. </p>

<p>This needs to be in python to work within the app its designed for, and to be able to be used for those without access to add new users</p>

While Python really is my favorite language, I think you need not create you own server for this. When you look at the
OpenSSH Manualpage for sshd
you'll find the "command" options for the authorized keys file that lets you define a specific command to run on login.
Using keys, you can use one system account to allow many user to log in, just put their public keys in the account's authorized keys file.
We are using this to create SSH tunnels for SVN and it works just great.