Skip to content

ssh

  • Create ssh key pair
ssh-keygen -t ed25519 -C some-name
  • Add or migrate existing ssh key
sudo chmod 400 id_ed25519
sudo chmod 400 id_ed25519.pub
eval `ssh-agent -s`
ssh-add id_ed25519
  • SSH tunneling

Let say some machine has access to certain domain or IP and you wanna access it from your machine

ssh -L local_port:remote_address:remote_port user@domain_or_ip

Access that port using curl or whatever for example curl http:127.0.0.1:local_port

Use tunnel to access mysql:

ssh -L 3306:mysql-server:3306 username@mysql-server