Skip to content Skip to content


How to remotely access your MySQL in a secure manner Kā attālināti piekļūt savam MySQL drošā veidā

LinuxSecurity

These days there are a number of really cool MySQL front-end tools available for all platforms. Šajās dienās ir vairāki tiešām cool MySQL front-end instrumentus, kas pieejami visām platformām. Some are web based and can be installed on the MySQL server, while there are others which need to be installed on your local laptop or desktop computer. Dažas no tām ir interneta balstīts, un tos var uzstādīt uz MySQL servera, bet ir citi, kurus būtu nepieciešams uzstādīt uz jūsu vietējo klēpjdatoru vai galda datoru. If you have a MySQL server running somewhere outside your local network you will most likely need to access it over the Internet to allow your super cool MySQL desktop client talk to it. Ja Jums ir MySQL servera darbojas kaut kur ārpus jūsu lokālā tīkla jūs, visticamāk, jāpiekļūst to pa internetu, lai jūsu super atdzist MySQL desktop klients runā ar to. You might be tempted to allow the MySQL server to run openly over the Internet to allow you access. Jums varētu būt kārdinājums ļaut MySQL serverim, lai palaistu atklāti pa internetu, lai nodrošinātu jums piekļuvi. That would be an extremely bad idea. Tas būtu ļoti slikta doma. Here's a much better solution to allow you access without compromising much on security. Šeit ir daudz labāks risinājums ļauj piekļūt neapdraudot daudz par drošību.

Let's see how we can do this using an SSH tunnel based connection to your MySQL server. Paskatīsimies, kā mēs varam darīt to, izmantojot SSH tuneli balstoties savienojumu ar MySQL serveri. There are two steps to do this. Ir divi pasākumi, lai to izdarītu. The first is to create an SSH tunnel connection from your computer to your MySQL server while piping the data to and from the MySQL server though the SSH tunnel. Pirmais ir izveidot SSH tuneli savienojumu no datora uz Jūsu MySQL serveri, cauruļvadi un no MySQL servera datu kaut SSH tuneli. The next step is to make a MySQL connection to a local port and gain access to your remote MySQL server. Nākamais solis ir panākt, lai MySQL savienojumu ar vietējo ostu un piekļūt jūsu attālajā MySQL serveri. The following command will create an ssh tunnel from remoteserver.net to your local computer. Šādu komandu radīs ssh tuneli no remoteserver.net ir tavā datorā. It will forward the incoming and outgoing traffic to that computer's port 3306 to your local computer's port 6666 . Tie pārsūta ienākošo un izejošo plūsmu uz šī datora ostas 3.306 jūsu lokālā datora ostu 6.666.

ssh user@remoteserver.net -L 6666:localhost:3306 ssh user@remoteserver.net-L 6.666: localhost: 3306

Modify the command shown above, replacing the user@remoteserver.net part with the credentials of your remote server, and -L 6666 with the port on which you want to access MySQL on your local machine. Modificēt komandu norādīts iepriekš, aizstājot user@remoteserver.net daļa ar jūsu attālajā serverī pilnvaras, un-L 6.666 ar portu, ko jūs vēlaties piekļūt MySQL tavā datorā. Once you have run this command you will be asked to enter the password for the user you used to log in as on the remote server. Kad esat palaist šo komandu, jums būs jāievada parole, lai lietotājs jūs izmantojāt, lai pieteiktos kā uz attālināta servera. After you successfully enter the password your ssh tunnel should be up and running. Kad esat veiksmīgi ievadiet paroli jūsu SSH tuneli būtu izveidota un darbojas.

Now launch your favorite MySQL client and make a connection with you remote MySQL server using the ssh tunnel you just created. Tagad sākt savu iecienītāko MySQL klients un veikt savienojumu ar jums attàlo MySQL serveri, izmantojot ssh tuneli, kuru nupat izveidojāt. Assuming you setup the tunnel on port 6666 you will need to use the following credentials to connect. Pieņemot, ka jūs setup tuneļa 6.666 portu jums būs nepieciešams izmantot šādas akreditācijas savienojums.

host: 127.0.0.1 Host: 127.0.0.1
port: 6666 port: 6.666

You will need to use the database authentication that you use with your remote server. Jums būs nepieciešams izmantot datu bāzi, autentifikācijas, ka jūs izmantojat ar attàlo serveri. If you did everything right you should now be able to see your remote databases in your MySQL client. Ja jūs viss labi jums tagad varēs redzēt jūsu attālās datu bāzes Jūsu MySQL klientu. You are now on a secure remote connection. Jūs tagad uz drošu attālo savienojumu. Remember to close the ssh tunnel when you are done with using MySQL by quitting the ssh session you setup initially. Atcerēties aizvērt SSH tuneli, kad tas ir paveikts ar izmantojot MySQL, ko atmest ssh sesiju tu setup sākumā.

Posted in Posted in Linux Linux , , Security Security . .

Get Simple Help tutorials just like this one in your email inbox every day - for free! Get Simple Palīdzība konsultācijas tāpat kā šo vienu savā e-pastā ik dienas - bez maksas! Just enter your email address below: Vienkārši ievadiet savu e-pasta adresi:

You can always opt out of this email subscription at any time. Jūs vienmēr varat atteikties no šīs e-pasta abonementu jebkurā laikā.

0 Responses 0 Atbildes

Stay in touch with the conversation, subscribe to the Uzturēt kontaktus ar sarunu, abonēt RSS feed for comments on this post RSS barību komentārus par šo ziņu . .



Some HTML is OK Daži HTML ir OK

or, reply to this post via vai, atbildot uz šo ziņu izmantojot trackback Trackback . .