How to send EOF to stdin in paramiko? Call shutdown() (or shutdown_write()) on the channel. Call the method: channel.shutdown_write().