Linux socket-to-socket tunnel (MySQL example)

socat "UNIX-LISTEN:/tmp/mysqld.temp.sock,reuseaddr,fork" EXEC:"ssh [email protected] socat STDIO UNIX-CONNECT\:/var/run/mysqld/mysqld.sock"
Won't work with password login. You must add your RSA key to the server's authorizedkeys file, or change the ssh command adding the -i option for a custom RSA key: socat "UNIX-LISTEN:/tmp/mysqld.temp.sock,reuseaddr,fork" EXEC:"ssh [email protected] -i /home/user/rsa-keys/id_rsa socat STDIO UNIX-CONNECT\:/var/run/mysqld/mysqld.sock" --- /tmp/mysqld.temp.sock will be created locally by socat, don't create it yourself. The folder it lives must be writable. Connect your MySQL client to this socket, with database and username set properly. --- In case you need to forward a remote socket to a LOCAL PORT instead, check

By: paulera
2017-07-27 11:32:19

What Others Think

sattamatkatips · 162 weeks and 5 days ago
Example for coding is now here. If you are waiting to different coding then you must have to take some examples here which tell you more for essaypro review. I know all these things helping us to make our coding work perfect and we have to make our work best after taking help from here.
Brookeeyes · 42 weeks and 1 day ago
Command and all tips of the joy are filled for the enhancement of the goals. The objective of the research paper help is assured for the improvement of the goals. The struggle is difficult. The potent oil is filed for future items. The theory is explained by humans.
KennethOrozco · 41 weeks and 5 days ago
This article is massively delighting and orchestrated to research you said the right we never do the trade on the whole issues and religion in any event or gathering the manner in which that the assessment about them wreck the event and annihilate all fulfillment.
Katrinaields · 36 weeks and 5 days ago
This brief article will discuss the nature of a compression fracture and how to treat this diagnosis. One such way is to best spine doctor near me use a well-made brace that can help you promote the healing process. We will discuss more in this article.
PriscillaScott · 33 weeks and 6 days ago
One had the perfect traits of a boxer - quick hands, unparalleled foot speed, great reach. The ability to avoid, and later take most punches, all with the grace of a gazelle. The little caesars hot and ready other had all the fine makings of a singer: perfect pitch, vibrato, presence, incredible phrasing, a finger-snapping style. He was, in short, the voice.
ChandraHill · 33 weeks and 1 day ago
I'm constantly searching on the internet for posts that will help me. Too much is clearly to learn about this. Custom Patches I believe you created good quality items in Functions also. Keep working, congrats!
muneerahmed · 14 weeks and 6 days ago
You have done a great job. I will definitely dig it and personally recommend to my friends. keyword search I am confident they will be benefited from this site.
muneerahmed · 13 weeks and 4 days ago
Excellent article plus its information and I positively bookmark to this site because here I always get an amazing knowledge as I expect. Custom Embroidered Patches Thanks for this to share with us
muneerahmed · 13 weeks and 1 day ago
So luck to come across your excellent blog. Your blog brings me a great deal of fun.. digitizing embroidery service Good luck with the site.
muneerahmed · 13 weeks and 1 day ago
I am extremely delighted in for this web journal. Its a useful subject. It help me all that much to take care of a few issues. Its chance are so awesome and working style so rapid. buy neopets items
muneerahmed · 8 weeks and 4 days ago
If you are looking for thanksgiving wishes visit
zaidavargas · 1 week and 4 days ago
Thanksgiving is coming so send thanksgiving wishes to your family and friends
zaidavargas · 1 week and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: