{ claus.conrad }

SSH (Secure Shell)



The Secure Shell Protocol (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network.[2] Its most notable applications are remote login and command-line execution.

Source: Wikipedia


Download a directory from a SSH server into an archive

scp -r username@hostname:/path/from/remote /path/to/local

Source: StackOverflow

Could not load host key: /etc/ssh/ssh_host_ed25519_key

If you’re getting this error message in the log file, you most likely have the ed25519 HostKey enabled in your sshd_config file but for some reason, no host key was generated for it.

Since openssh-6.4 you can run the ssh-keygen command to generate any missing host keys:

  ssh-keygen -A

Source: https://trick77.com/could-not-load-host-key-etcsshssh_host_ed25519_key/

Starting OpenSSH client from Python

  "ssh", # Path to ssh
  "-i", # Use private key file
  "~/.ssh/id_rsa", # Path to private key
  "user@hostname" # Host and username to connect with

Changing the comment field of an RSA key

All I had to do was

ssh-keygen -c -C "my new comment" -f ~/.ssh/my_ssh_key

Source: SuperUser

Switching directory automatically after connecting with SSH

Add an entry in the local SSH config:

  RemoteCommand cd DESIRED_DIRECTORY ; /usr/bin/env bash
  RequestTTY yes