From a6bc2c946015eaddc5b4d84caccdf4a89f6df600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Fernandes?= Date: Sat, 25 Oct 2025 14:10:21 +0000 Subject: [PATCH] modified: README.md --- README.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 036413b..671fdea 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,43 @@ -# ssh +# SSH +## Create key + +```bash +ssh-keygen -t ecdsa -b 521 +#or +ssh-keygen -t ecdsa -b 521 -f ~/.ssh/key-ecdsa + +``` + +## Copy public key + +```bash +ssh-add ~/.ssh/id_ed25519 +ssh-copy-id -i ~/.ssh//ey-ecdsa.pub example_user@192.0.2.4 +``` + +## Add existing Key + +```bash +ssh-add ~/.ssh/key-ecdsa +``` + +## Alias + +```bash +Host srv01 + HostName srv01.lan + User john + RemoteCommand cd ~/; exec bash --login + RequestTTY yes +``` + +## Port Binding + +Bind local port 8001 to target-server port 80 using jump-machine.local. +_(local machine without direct access to target-server)_ + +```bash +ssh -f -N -L localhost:8001:target-server:80 usr@jump-machine.local +```