SSH
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
Section titled “Download a directory from a SSH server into an archive”scp -r username@hostname:/path/from/remote /path/to/localSource: StackOverflow
Could not load host key: /etc/ssh/ssh_host_ed25519_key
Section titled “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 -ASource: https://trick77.com/could-not-load-host-key-etcsshssh_host_ed25519_key/
Starting OpenSSH client from Python
Section titled “Starting OpenSSH client from Python” subprocess.call([ "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
Section titled “Changing the comment field of an RSA key”All I had to do was
Terminal window ssh-keygen -c -C "my new comment" -f ~/.ssh/my_ssh_key
Source: SuperUser
Switching directory automatically after connecting with SSH
Section titled “Switching directory automatically after connecting with SSH”Add an entry in the local SSH config:
Host SOME_HOSTNAME RemoteCommand cd DESIRED_DIRECTORY ; /usr/bin/env bash RequestTTY yesAgent forwarding on a connection basis
Section titled “Agent forwarding on a connection basis”ssh -A user@hostUse local aliases on SSH servers
Section titled “Use local aliases on SSH servers”Resources
Section titled “Resources”- ArchWiki: SSH keys
- Howto secure openssh-6.x
- How to Harden SSH with Identities and Certificates
- OpenSSH - MozillaWiki
The goal of this document is to help operational teams with the configuration of OpenSSH server and client.
- new openssh key format and bcrypt pbkdf
- OpenSSH key management on Windows 10, Windows Server 2019 and Windows Server 2022