Search notes:

Paramiko

Paramiko is a pure-Python (3.6+) implementation of the SSHv2 protocol
sudo pip3 install paramiko
import paramiko

local_file      = 'path/to/file'
remote_host     = 'foo.bar.baz'
remote_path     = 'remote/path/to/file'
remote_user     = '…'
remote_password = '…'

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

try:
    ssh.connect(remote_host, username=remote_user, password=remote_password)
    sftp = ssh.open_sftp()
    sftp.put(local_file, remote_path)
    sftp.close()
    print(f'File {local_file} uploaded successfully.')

except Exception as e:
    print(f'Error uploading {local_file}. Reason: {str(e)}')

finally:
    ssh.close()

See also

SSH
Fabric is the high-level SSH library recommended for common client use-cases such as running remote shell commands or transferring files.
The Python standard library netrc.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758204578, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Python/libraries/Paramiko(70): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78