UP | HOME

OpenSSH

1. Penggunaan

  • Operasi Umum
$ ssh user@hostname -p22
  • Tunnel SOCKS
$ ssh user@hostname -D 127.0.0.1:8000
  • Local Port Forward
$ ssh user@hostname -L [local-ip]:[local-port]:[remote-host]:[remote-ip]
$ ssh user@hostname -L 127.0.0.1:8888:www.google.com:80
  • Reverse Port Forwarding
$ ssh user@hostname -R [local-ip]:[local-port]:[remote-host]:[remote-ip]
$ ssh user@hostname -R 127.0.0.1:8888:server.system.com:80

2. Konfigurasi

Dalam penggunaan dengen frekuensi yang tinggi, bisa menggunakan konfigurasi file ~/.ssh/config

Host server
     HostName server.system.com
     Port 2222
     User root
     PasswordAuthentication no
     IdentitiesOnly yes
     IdentityFile ~/.ssh/server-key.pem

Kemudian dapat dipanggil dengan

$ ssh server

3. SSH di Ubuntu WSL

$ sudo ssh-keygen-A
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
$ sudo service ssh start
 * Starting OpenBSD Secure Shell server sshd [ OK ]
Aldo Ridhoni / 25-08-2023 20:49 WITA Emacs 28.2 (Org mode 9.5.5)