Lab 12: Automation - eamonstackpole/my-tech-journal GitHub Wiki

Overview

SSH

  • ssh-keygen: creates a key pair protected by a passphrase
    • You should add one, even if it makes it take longer
  • ssh-copy-id user@host: gives out the public key to that user on that host
  • eval 'ssh-agent': enables the ssh-agent
    • check notes if having issues with agent
  • ssh-add: adds the private key
    • -t 1h: adds it for only 1 hour

Root Elevation

  • edit /etc/sudoers
  • remove comment marker from "Same Thing without a password" setting (the line below)

PSSH

  • pssh (Options) (Command): parallel ssh (allows to run ssh commands on multiple hosts at once)
    • -h: host file
    • -i: displays standard output and errors
    • -A: prompts the passphrase

Ansible

  • ansible all (Options) (Command): Runs as an ansible command
  • -i: inventory (list of hosts)
  • -b: run as if it were a sudo user
  • -a: module arguments

Notes

  • To fix issue of not connecting to agent, use exec ssh-agent bash to enable ssh-agent
  • Curl command - Enables data transfer to and from a web server

Sources