In this article, we will demonstrate how to quickly and easily set up SSH tunneling or the different types of port forwarding in Linux. ![]() I am running locally my development database on: DB_HOST=127.0.0. SSH sessions permit tunneling network connections by default and there are three types of SSH port forwarding: local, remote and dynamic port forwarding. OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n ĭebug1: Reading configuration data /etc/ssh/ssh_configĭebug1: /etc/ssh/ssh_config line 19: Applying options for *ĭebug1: Connecting to xx.xx.xxx.xx port 22.ĭebug1: identity file /home/admin/.ssh/id_rsa type 0ĭebug1: key_load_public: No such file or directoryĭebug1: identity file /home/admin/.ssh/id_rsa-cert type -1ĭebug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3ĭebug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.1ĭebug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.1 pat OpenSSH* compat 0x04000000ĭebug1: Authenticating to xx.xx.xxx.xx:22 as 'root'ĭebug1: kex: algorithm: curve25519-sha256ĭebug1: kex: host key algorithm: ecdsa-sha2-nistp256ĭebug1: kex: server->client cipher: MAC: compression: noneĭebug1: kex: client->server cipher: MAC: compression: noneĭebug1: expecting SSH2_MSG_KEX_ECDH_REPLYĭebug1: Server host key: ecdsa-sha2-nistp256 SHA256:aaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaĭebug1: Host 'xx.xx.xxx.xx' is known and matches the ECDSA host key.ĭebug1: Found key in /home/admin/.ssh/known_hosts:1ĭebug1: kex_input_ext_info: server-sig-algs=ĭebug1: Authentications that can continue: publickey,passwordĭebug1: Next authentication method: publickeyĭebug1: Offering public key: RSA SHA256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /home/admin/.ssh/id_rsaĭebug1: Server accepts key: pkalg rsa-sha2-512 blen 279ĭebug1: Authentication succeeded (publickey).Īuthenticated to xx.xx.xxx.xx (:22).ĭebug1: Local connections to LOCALHOST:13307 forwarded to remote address 127.0.0.1:3306ĭebug1: Local forwarding listening on ::1 port 13307.ĭebug1: Local forwarding listening on 127.0.0.1 port 13307.Ĭhannel_setup_fwd_listener_tcpip: cannot listen to port: 13307ĭebug1: client_input_global_request: rtype want_reply 0ĭebug1: Remote: /root/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding (For example Source port: 5050) Next, In the Destination field, enter the destination address followed by the port number. In the Source port field, enter the port number to use on your local system. Select Local to define the type of SSH port forward. ![]() When running my ssh-command I get: /usr/bin/ssh -o StrictHostKe圜hecking=no -v -N -i /home/admin/.ssh/id_rsa -L 13307:127.0.0.1:3306 -p 22 Navigate to the Connection > SSH > Tunnels. ![]() My production database has the following credentials on my server: DB_HOST_PROD=127.0.0.1 I am running on my VPS Ubuntu 20.04.1 LTS and locally Ubuntu 18.04.3 LTS and I want to create a ssh-tunnel to connect to my database to run SELECT's for reporting in my laravel 6 application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |