Skip to Content
Twisted Network Programming Essentials, 2nd Edition
book

Twisted Network Programming Essentials, 2nd Edition

by Abe Fettig, Jessica McKellar
March 2013
Beginner content levelBeginner
191 pages
4h 9m
English
O'Reilly Media, Inc.
Content preview from Twisted Network Programming Essentials, 2nd Edition

Chapter 14. SSH

SSH, the Secure SHell, is an essential tool for many developers and administrators. SSH provides a way to establish encrypted, authenticated connections. The most common use of an SSH connection is to get a remote shell, but it’s possible to do many other things through SSH as well, including transferring files and tunneling other connections.

The twisted.conch package adds SSH support to Twisted. This chapter shows how you can use the modules in twisted.conch to build SSH servers and clients.

SSH Servers

The command line is an incredibly efficient interface for certain tasks. System administrators love the ability to manage applications by typing commands without having to click through a graphical user interface. An SSH shell is even better, as it’s accessible from anywhere on the Internet.

You can use twisted.conch to create an SSH server that provides access to a custom shell with commands you define. This shell will even support some extra features, like command history, so that you can scroll through the commands you’ve already typed.

A Basic SSH Server

To write an SSH server, implement a subclass of twisted.conch.recvline.HistoricRecvLine that implements your shell protocol. HistoricRecvLine is similar to twisted.protocols.basic.LineReceiver, but with higher-level features for controlling the terminal.

To make your shell available through SSH, you need to implement a few different classes that twisted.conch needs to build an SSH server. First, you need ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Twisted Network Programming Essentials

Twisted Network Programming Essentials

Abe Fettig
Learning Python Networking - Second Edition

Learning Python Networking - Second Edition

José Manuel Ortega, Dr. M. O. Faruque Sarker, Sam Washington
Network Routing, 2nd Edition

Network Routing, 2nd Edition

Deep Medhi, Karthik Ramasamy
Expert Twisted: Event-Driven and Asynchronous Programming with Python

Expert Twisted: Event-Driven and Asynchronous Programming with Python

Mark Williams, Cory Benfield, Brian Warner, Moshe Zadka, Dustin Mitchell, Kevin Samuel, Pierre Tardy

Publisher Resources

ISBN: 9781449326104Errata PageSupplemental Content