I'm using MySqldb with Python 2.7 to allow Python to make connections to another MySQL server import MySQLdb db = MySQLdb.connect(host="sql.domain.com", user="dev", passwd="*******", db="appdb") Instead of connecting normally like this, how can the connection be made through a SSH tunnel using SSH key pairs? The SSH tunnel should ideally be opened by Python. The SSH tunnel host and the MySQL server are the same machine. Continue reading...