m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/ssh.md
blob: fd624963def9feaf25fe1fd273268e1a811ebfa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# SSH

## Key generation

    ssh-keygen -t rsa -C "email@addres.com" -b 4096

Change password for key:

    ssh-keygen -p <keyname>

## Setup login with public key

    ssh-copy-id [user@]host

## Execute commands and start shell

    ssh -t host 'commands; bash'

## Port tunneling

    ssh -N host -L <client port>:<address:port from server's POV>

`-N` is to not start an SSH session.