tools:ssh
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tools:ssh [2024/08/06 05:48] – external edit 127.0.0.1 | tools:ssh [2025/09/30 22:44] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{wst> | ||
- | |||
====== Secure Shell (SSH) ====== | ====== Secure Shell (SSH) ====== | ||
+ | **Secure Shell** //(or **SSH**)// is a cryptographic network protocol for operating network services securely over an unsecured network. It is usually used for remote login into [[tools: | ||
+ | |||
+ | |||
+ | ===== History & Concept ===== | ||
+ | |||
+ | SSH was designed for Unix-like operating systems as a replacement for Telnet and unsecured remote Unix shell protocols, such as the Berkeley Remote Shell (rsh) and the related rlogin and rexec protocols, which all use insecure, plaintext methods of authentication, | ||
+ | |||
+ | Since mechanisms like Telnet and Remote Shell are designed to access and operate remote computers, sending the authentication tokens //(e.g. username and password)// across a public network in an unsecured way poses a great risk of third parties obtaining the password and achieving the same level of access to the remote system as the telnet user. **Secure Shell** mitigates this risk through the use of encryption mechanisms that are intended to hide the contents of the transmission from an observer, even if the observer has access to the entire data stream. | ||
+ | |||
+ | |||
+ | ===== Implementations ===== | ||
+ | |||
+ | ==== Linux, BSD & MacOS ==== | ||
+ | |||
+ | MacOS and most *nix distros come with [[https:// | ||
+ | |||
+ | $ ssh username@domain.com | ||
+ | | ||
+ | or | ||
+ | | ||
+ | $ ssh username@123.123.123.123 | ||
+ | |||
+ | |||
+ | === Configuration === | ||
+ | |||
+ | Your SSH client' | ||
+ | |||
+ | * / | ||
+ | * **authorized_keys** //(list of public keys allowed to SSH into your account)// | ||
+ | * **config** //(file for storing common SSH servers as macros, see below)// | ||
+ | * **keys/** //(optional key directory for sample '' | ||
+ | * **known_hosts** //(caches info about servers you connect to, so you can be alerted if something changes)// | ||
+ | |||
+ | |||
+ | == Key Generation == | ||
+ | |||
+ | SSH can be further secured by using **public/ | ||
+ | |||
+ | $ ssh-keygen -t ed25519 -C " | ||
+ | |||
+ | Fill in the prompts, and it will generate a key pair. Use the '' | ||
+ | |||
+ | $ ssh-copy-id -i ~/ | ||
+ | |||
+ | To do this manually, just use a text editor to copy the contents of the public key (ending in '' | ||
+ | |||
+ | Once that is done, insert the path to the private key in your local user's '' | ||
+ | |||
+ | |||
+ | == Sample Configuration == | ||
+ | |||
+ | To make it easier to connect to servers without having to type a whole lot of bullshit every time, you can store a list of servers and keys in '' | ||
+ | |||
+ | <file txt config> | ||
+ | Host github | ||
+ | Hostname | ||
+ | User username | ||
+ | IdentityFile | ||
+ | |||
+ | Host site1 | ||
+ | Hostname | ||
+ | Port 22 | ||
+ | User username | ||
+ | IdentityFile | ||
+ | |||
+ | Host site2 | ||
+ | Hostname | ||
+ | Port 22 | ||
+ | User username | ||
+ | IdentityFile | ||
+ | </ | ||
+ | |||
+ | So rather than having to type '' | ||
+ | |||
+ | |||
+ | ==== Windows ==== | ||
+ | |||
+ | To quickly make SSH connections in Windows, install [[https:// | ||
+ | |||
+ | If you want the flexibility of running SSH from a full Linux shell, use the [[https:// | ||
+ | |||
+ | |||
+ | ===== Other Key Uses ==== | ||
+ | |||
+ | The same key pairs generated by '' | ||
+ | |||
+ | Some services might not support ed25519-based keys. To generate a more widely-compatible 4096 bit RSA key, run: | ||
+ | |||
+ | $ ssh-keygen -t rsa -b 4096 -C " | ||
+ | |||
+ | |||
+ | ===== File Transfer over SSH ===== | ||
+ | |||
+ | You can also use SSH to securely transfer files between machines, using the built-in '' | ||
+ | |||
+ | |||
+ | ===== Running SSH Servers ===== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | Make sure to install and configure [[tools: | ||
- | {{tag> | + | |
+ | {{tag> |
tools/ssh.1722923284.txt.gz · Last modified: (external edit)
Find this page online at: https://bestpoint.institute/tools/ssh
Find this page online at: https://bestpoint.institute/tools/ssh