What is the SSH command line tool? (OpenSsh)

Host Key Not Cached Putty

About

The ssh cli is the ssh client of openssh

Management

Installation

See OpenSSH installation

Configuration

  • user's private key location: ~/.ssh/id_rsa

ssh-agent

ssh-agent is a background process where you can store keys (encrypted by a passphrase or not).

ssh_config

You can check which configuration files is loaded by initiating a SSH connection with the verbose flag. Example

ssh -v badDestination # badDestination is a unknown hostname and will force ssh to stop early
OpenSSH_8.4p1 Debian-5+deb11u3, OpenSSL 1.1.1n  15 Mar 2022
debug1: Reading configuration data /Users/YOU/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *


As you can see with the above output, there are 2 standard loaded configurations

  • a User scoped at ~/.ssh/config
touch ~/.ssh/config
chmod 600 ~/.ssh/config
vim ~/.ssh/config
  • a System wide at /etc/ssh/ssh_config
# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

Host *
#   ForwardAgent no
#   ForwardX11 no
#   ForwardX11Trusted yes
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   IdentityFile ~/.ssh/id_ecdsa
#   IdentityFile ~/.ssh/id_ed25519
#   Port 22
#   Protocol 2
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials no


Connect / Login

ssh domain\username@servername  -p 3022

Logging with a private key

  • Posix Shell
ssh -i ~/.ssh/private_key.pem user@hostname
  • Powsershell
ssh -i $env:USERPROFILE\.ssh\private_key user@hostname

where:

Executing a remote command

ssh user@host "command -arg1 'arg1value' -arg2 'arg2 value'"

Don't forget the quote to bypass the expansion mechanism

Debug

ssh -vvv hostname





Discover More
Cryptography - SSH

in the context of cryptography. For authentication: Public Key on the server: Add it to the ~/.ssh/authorized_keys file Private Key on the client: Configure PuTTY to use your private key file...
Recaptcha
How can I protect myself from Bad Bot (Spambot, Attacker )?

Bad Bots are robots with bad intentions. They are also known as attackers. They walk through: web pages trying to find a form and to fill them trying: to send email in mass to create a fake...
Linux - Remote Client

How to connect to a linux system in a remote mode ? In console mode, with the help of this network protocol : ssh telnet In graphic mode: the X Windows System Virtual Network Computing (VNC)...
Map Of Internet 1973
What is the Application layer, level 7 of the OSI model?

What is the Application layer, level 7 of the OSI model? Application layer is the 7 layer of OSI model that contains all services/application that implements a functionality above the transport layer...
Windows Install Openssh
Openssh

OpenSSH OpenSSH () is a combination of command line utility to implement and use SSH ssh is the SSH client component that runs on the user's local system sshd is the SSH...
Card Puncher Data Processing
Oracle - RDA (Remote Diagnostic Agent)

RDA (Remote Diagnostic Agent) is: a set of command line, diagnostic and data collection scripts used to gather detailed diagnostic information an oracle environment and collect only: data for...
Mos Lifetime Support
Oracle Company - My Oracle Support (MOS)

MOS is an acronym for My Oracle Support. It's the single entry for the Oracle Support. You can touch it on this URL: Contact: Local...
Porte Cle Keystore Pem
Privacy-Enhanced Mail (PEM) (OpenSsh key format)

Privacy-Enhanced Mail (PEM) is a file formats for cryptographic material (key, certificate, ..). The PEM format is the DER format encoded in base64 with additional header and footer lines to be transported...
Ssh Agent Key Connection Putty
SSH - Agent Forwarding (Forward Key)

agent forwarding is a mechanism whereby an SSH client allows an SSH server to use the local agent on the server, the user logs into, as if it was local there. We say that the private key is forwarded...
Host Key Not Cached Putty
SSH - Authentication Agent

An authentication agent is a component of the public key authentication scheme that permits you to be authenticated op basis of a key file. It is a background process that stores your private keys in...



Share this page:
Follow us:
Task Runner