5. Feb 2020 |

SSH keys in Ubuntu (basic commands)

Update and clean.

#! /usr/bin/bash

sudo apt-get update && sudo apt-get -y dist-upgrade && sudo apt-get -y autoremove --purge && sudo apt-get -y clean

Regular ones

ctrl+A – beginning
ctrl+E – end
alt+F – move cursor forwadr
alt+B – move cursor back
ctrl+G – exit ssh session or exit recursive search
ctrl+L – clear terminal
ctrl+U – clear line, if curson in the end
ctrl+K – clear line, if curson in the beginning
ctrl+D – logout

mv * .. – move everything one folder up

SSH keys

Located in: /home/robert/.ssh/id_rsa.pub
To generate keys: ssh-keygen
To display in terminal: cat ~/.ssh/id_rsa.pub
Give bash script permissions: chmod +x script.sh

Add additional keys to this file:
cat ~/.ssh/authorized_keys

New password for current user: sudo passwd root

Useful guide: https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys-on-ubuntu-1604

WSL (Windows subsystem for Linux)

explorer.exe . – opens current directory in Explorer.

sudo tcpflow -p -C -i lo port 8080 – listen to port 8080 and see the traffic