■ Contents
xiv
Searching ���������������������������������������������������������������������������������������������������������������������������������������������������������� 284Manipulating Folders and Messages ����������������������������������������������������������������������������������������������������������������� 285Asynchrony �������������������������������������������������������������������������������������������������������������������������������������������������������� 286Summary ����������������������������������������������������������������������������������������������������������������������������������� 287
■ Chapter 16: Telnet and SSH �������������������������������������������������������������������������������������������289
Command-Line Automation �������������������������������������������������������������������������������������������������������289
Command-Line Expansion and Quoting������������������������������������������������������������������������������������������������������������� 290Unix Command Arguments Can Include (Almost) Any Character ����������������������������������������������������������������������� 291Quoting Characters for Protection ��������������������������������������������������������������������������������������������������������������������� 294The Terrible Windows Command Line ���������������������������������������������������������������������������������������������������������������� 295Things Are Different in a Terminal ��������������������������������������������������������������������������������������������������������������������� 295Terminals Do Buffering �������������������������������������������������������������������������������������������������������������������������������������� 298Telnet ����������������������������������������������������������������������������������������������������������������������������������������� 299
SSH: The Secure Shell ���������������������������������������������������������������������������������������������������������������303
An Overview of SSH ������������������������������������������������������������������������������������������������������������������������������������������� 304SSH Host Keys ��������������������������������������������������������������������������������������������������������������������������������������������������� 304SSH Authentication �������������������������������������������������������������������������������������������������������������������������������������������� 306Shell Sessions and Individual Commands ��������������������������������������������������������������������������������������������������������� 307SFTP: File Transfer Over SSH ����������������������������������������������������������������������������������������������������������������������������� 312Other Features ��������������������������������������������������������������������������������������������������������������������������������������������������� 314Summary ����������������������������������������������������������������������������������������������������������������������������������� 315
■ Chapter 17: FTP �������������������������������������������������������������������������������������������������������������317
What to Use Instead of FTP �������������������������������������������������������������������������������������������������������317
Communication Channels ���������������������������������������������������������������������������������������������������������������������������������� 318Using FTP in Python ������������������������������������������������������������������������������������������������������������������������������������������� 319ASCII and Binary Files���������������������������������������������������������������������������������������������������������������������������������������� 320Advanced Binary Downloading �������������������������������������������������������������������������������������������������������������������������� 321Uploading Data �������������������������������������������������������������������������������������������������������������������������������������������������� 323Advanced Binary Uploading ������������������������������������������������������������������������������������������������������������������������������� 324Handling Errors �������������������������������������������������������������������������������������������������������������������������������������������������� 325