So, for example, we have 2200 port for SSH enabled on our remote server, then the command would be: ssh -L 8888:my-db-server.host:3306 -p 2200 Conclusion: Then we can run the following command: ssh -L 8888:my-db-server.host:3306 If SSH connection is enabled on a different port other than port number 22, then we can specify the port number in the above command using -p argument. If our DB server is my-db-server.host on which port 3306 is available for connection on the private network access to the remote SSH server my-remote-server.host, as shown in the picture below. Connect to Destination server via Remote Server: Next, let's see how to connect to a separate DB server via a remote server. This was the scenario where the DB server was running on the localhost of the remote server. pem file as the SSH key, run the following command for the above scenario: ssh -L 8888:127.0.0.1:3306 -i this case, you will not be asked for the password, as authentication will be done using your SSH key. If your remote server is an EC2 instance on AWS and you have a. Now, you will be able to access the MySQL server using 127.0.0.1:8888 address from your local machine. Once you do this, you will be prompted to enter the password for the user st-user, so enter the password and hit Enter, and the SSH tunnel will be created.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |