code: def generate_ssh_key():
      
  
      key = rsa.generate_private_key(
          backend=default_backend(),
          public_exponent=65537,
          key_size=4096
          )
      private_key = key.private_bytes(
          serialization.Encoding.PEM,
          serialization.PrivateFormat.PKCS8,
          serialization.NoEncryption())
      public_key = key.public_key().public_bytes(
          serialization.Encoding.OpenSSH,
          serialization.PublicFormat.OpenSSH
      )
  
      return private_key, public_key
docs: Generates an SSH deploy public and private key.
  
      Returns (private key, public key), a tuple of byte strings.