Now, if you point your local machine database client to 127.0.0.1:3336, the connection will be forwarded to the db001.host:3306 MySQL server through the pub001.host machine that acts as an intermediate server. It is also a good idea to set up an SSH key-based authenticationĪnd connect to the server without entering a password. Once entered, you will be logged into the remote server, and the SSH tunnel will be established. To do so, you can forward the connection using the following command: ssh -L 3336:db001.host:3306 you run the command, you’ll be prompted to enter the remote SSH user password. Let’s say you have a MySQL database server running on machine db001.host on an internal (private) network, on port 3306, which is accessible from the machine pub001.host, and you want to connect using your local machine MySQL client to the database server. The destination hostname must be resolvable from the SSH server. If your SSH server is listening on a port other than 22 Ports numbers less than 1024 are privileged ports and can be used only by root. You can use any port number greater than 1024 as a LOCAL_PORT.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |