Python - How to use Conch to create a virtual SSH server

I am looking for a python server creation that I can run and will work as an SSH server. This will allow other users to log in and act as if they were logged in, but had access to only one team.

I want to do this so that I have a system in which I can add users without creating a system account so that they can, for example, make a transition to the VCS branch or similar.

For now, I can figure out how to do this with conch to get it in a "custom" shell ... I cannot figure out how to make the SSH stream work as if it were real (I prefer to restrict / bin / bzr so bzr + ssh works.

It should be in python (which I can get for authorization), but I don’t know how to link to the application.

This should be in python to work in an application designed for it, and for use by those who do not have access to add new users.

+5
source share
2 answers

When you write a Conch server, you can control what happens when a client makes a shell request by implementing ISession.openShell. The Conch server will request IConchUserfrom your area, and then adapt the received avatar to ISession, to call openShellon it, if necessary.

Task

ISession.openShell - , , .

, openShell, , IProcessProtocol. , makeConnection, IProcessTransport. , IProcessProtocol writeToChild , makeConnection. , childDataReceived.

, IProcessProtocol, . , IProcessProtocol, , , , .

, , . , stdio bzr, SSH-.

+7

Python , , . OpenSSH Manualpage sshd, "command" , .

, , , .

SSH SVN, .

-2

All Articles