Python and SSH

pehr anderson pehr at pehr.net
Wed Jul 12 02:15:28 EDT 2000


I'm guessing you want somebody to ssh to your box, and instead of 
their normal bash shell,
they see your python app instead. 
This is easily doable by creating a new user
and setting it's shell to be the name of your
python app in /etc/passwd.

If you look at /etc/passwd you will notice that
most accounts have /bin/bash as the last argument.
Just change that to be an absolute path to your
python script! You move from this:


ssh -- client
 |
BIG BAD INTERNET
 |
sshd -- daemon
 |
bash -- user shell to do general stuff


to this:


ssh -- client
 |
BIG BAD INTERNET
 |
sshd -- daemon
 |
your app as the user's default shell.


Does this help?

	-pehr

Cary O'Brien wrote:
> 
> I'd like to have a running python process ACCEPT an incoming SSH
> connection.  Any ideas on how I could do this?
> 
> -- cary



More information about the Python-list mailing list