Linux socket-to-socket tunnel (MySQL example)

socat "UNIX-LISTEN:/tmp/mysqld.temp.sock,reuseaddr,fork" EXEC:"ssh username@remoteserver.com 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 username@remoteserver.com -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 http://www.commandlinefu.com/commands/view/9436/socat-tcp-listen5500-execssh-userremotehost-socat-stdio-unix-connectvarrunmysqldmysqld.sock

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

What Others Think

hi
sattamatkatips · 243 weeks and 4 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 · 123 weeks 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 · 122 weeks and 4 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 https://tspiglobal.com the manner in which that the assessment about them wreck the event and annihilate all fulfillment.
Katrinaields · 117 weeks and 4 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 · 114 weeks and 5 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 · 114 weeks 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 · 95 weeks and 5 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 · 94 weeks and 3 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 · 94 weeks 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 · 94 weeks 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 · 89 weeks and 3 days ago
If you are looking for thanksgiving wishes visit https://onsumo.com/thanksgiving-wishes-greetings-messages/
zaidavargas · 82 weeks and 3 days ago
Thanksgiving is coming so send thanksgiving wishes to your family and friends
zaidavargas · 82 weeks and 3 days ago
Find the perfect weed killers and preventers http://weedeater2020.simplesite.com/">organic weed killer
Charles231 · 79 weeks and 1 day ago
Find the perfect weed killers and preventers http://weedeater2020.simplesite.com/
Charles231 · 79 weeks and 1 day ago
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it. houston embroidery service
muneerahmed · 79 weeks 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. Premium Tax Credit
muneerahmed · 75 weeks and 1 day ago
Great article with excellent idea!Thank you for such a valuable article. I really appreciate for this great information.. http://worldandus.co.uk/members/jonydeepcustom34/activity/118940/">http://worldandus.co.uk/members/jonydeepcustom34/activity/118940/
muneerahmed · 75 weeks ago
Untuk panduan poker, kunjungi https://onlinepokertips.wixsite.com/pokeronline
zaidavargas · 74 weeks and 3 days ago
any new recent updates with the forum?? dentalimplantsfortwaynein.com
Killersmile · 59 weeks ago
Thanks for the info. https://www.bloglovin.com/@waqasjamal/how-to-make-your-own-chinese-traditional
zaidavargas · 56 weeks and 6 days ago
Visit our review about PGAnabolics
zaidavargas · 53 weeks and 3 days ago
Buy instagram verificationhttp://getverifiedbadge.iwopop.com/">? from us on cheap rate
zaidavargas · 44 weeks and 3 days ago
where to get shrooms dried mushrooms african pyramid mushroom african transkei mushroom albino penis envy b+ mushrooms blue meanies mushroom brazilian magic mushroom burmese mushroom golden teacher mushroom ko samui super strain malabar coast martinique mexican mushroom mushroom british columbia super thai mushroom nepalese chitwan mushroom penis envy texas penis envy 6 texas yellow caps vietnamese white jedi mind fuck tri coloured ecuadorian mushroom magic mushsroom edibles mexican cubensis psychedelic chocolate bar where to get shrooms dried mushrooms african pyramid mushroom african transkei mushroom albino penis envy b+ mushrooms blue meanies mushroom brazilian magic mushroom burmese mushroom golden teacher mushroom ko samui super strain malabar coast martinique mexican mushroom mushroom british columbia super thai mushroom nepalese chitwan mushroom penis envy texas penis envy 6 texas yellow caps vietnamese white jedi mind fuck tri coloured ecuadorian mushroom magic mushsroom edibles mexican cubensis psychedelic chocolate bar midnight mint psychedelic chocolate bar origin mango psilo gummies 0.25g-1g origin strawberry psilo gummies 0.25g-1g penis envy psychedelic chocolate bar psilocybin cube gummies vegan dark chocolate psychedelic chocolate bar microdoses brain capsules 50mg-200mg chill capsules 50mg-200mg clarity capsules 50mg-200mg health capsules 50mg-200mg love capsules 50mg-200mg mood capsules 50mg-200mg pure capsules 50mg-200mg social capsules 30 pack 350mg social capsules 5 pack 350mg buy weed online without medical card marijuana flowers types of concentrates cannabis cartridges buy edibles online legal marijuana shatter cannabis wax marijuana hash buy psychedelic online tinctures for anxiety cannabis seeds bank weed smoker accessories birthday cake kush acdc strain ace killer og strain ak 47 strain alaskan thunder fuck alien kush strain ambrosia kush strain atomik moon rocks cbd 40.57% atomik moon rocks diamond 58.77% banana og strain bc big bud strain birthday cake kush blue cheese strain blue dream og kush blue moonrock kush blue rhino strain blueberry kush strain bruce banner strain cannabis trim cherry pie strain cannatonic strain citrix strain dark star kush durban poison strain eleven roses strain g13 haze strain gelato strain girl scout cookies flavors girl scout cookies online granddad purple strain grape nana weed strains grape pie strain green crack strain guava kush strain hawaiian skunk jack herer strain mendo breath weed mighty mango mr nice guy weed blue mystic strain northern lights strain northern lights moon rock platinum og kush gas og strain pink og kush platinum hawaiian strain pootie tang strain purple mimosa strain purple white widow strain smart buds sour diesel weed strain sour moonrock strain space monkey tins strawberry banana weed sun rocks super citrus haze strain super silver haze wedding cake strain exotic white widows strain zombie kush strain
johnson20007 · 15 weeks and 1 day 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?

commandlinefu.com 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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: