How to remotely access your MySQL in a secure manner Ako vzdialene pristupovať k MySQL bezpečným spôsobom

by Sukrit Dhandhania on April 22, 2009 používateľa Sukrit Dhandhania dňa 22.dubna 2009

LinuxBezpečnosť

These days there are a number of really cool MySQL front-end tools available for all platforms. V týchto dňoch existuje niekoľko naozaj cool MySQL front-end nástrojov sú k dispozícii pre všetky platformy. 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. Niektoré z nich sú založené web a môže byť nainštalovaný na serveri MySQL, zatiaľ čo tam sú iní, ktoré musia byť nainštalované na miestnej notebooku alebo stolnom počítači. 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. Ak máte MySQL server niekde mimo vašej lokálnej sieti, budete pravdepodobne potrebovať k prístupu do systému cez internet, aby si super cool MySQL desktopového klienta hovoriť k nemu. You might be tempted to allow the MySQL server to run openly over the Internet to allow you access. Možno ste v pokušení, aby MySQL server prevádzkovať otvorene cez internet, a umožní vám prístup. That would be an extremely bad idea. To by bol veľmi zlý nápad. Here's a much better solution to allow you access without compromising much on security. Tu je oveľa lepšie riešenie, ktoré vám umožní prístup bez kompromisov veľa na istotu.

Let's see how we can do this using an SSH tunnel based connection to your MySQL server. Uvidíme, ako to urobiť môžeme pomocou SSH tunel na pripojenie k MySQL serveru. There are two steps to do this. Existujú dva kroky, ako to dosiahnuť. 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. Prvým je vytvoriť SSH tunel z vášho počítača k MySQL serveru, zatiaľ čo potrubia dát do MySQL servera, ale SSH tunel. The next step is to make a MySQL connection to a local port and gain access to your remote MySQL server. Ďalším krokom je, aby MySQL pripojenie k miestnej prístav a získať prístup k vášmu vzdialenému serveru MySQL. The following command will create an ssh tunnel from remoteserver.net to your local computer. Nasledujúce položku vytvorí ssh tunel z remoteserver.net do miestneho počítača. It will forward the incoming and outgoing traffic to that computer's port 3306 to your local computer's port 6666 . Bude dopredu prichádzajúce a odchádzajúce prevádzku na tomto počítači port 3306 na lokálnom počítači na porte 6666.

ssh user@remoteserver.net -L 6666:localhost:3306 user@remoteserver.net ssh-L 6666: 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. Zmeniť príkaz je uvedené vyššie, nahradí user@remoteserver.net časti s poverenia svojho vzdialeného servera a L-6666 s port, na ktorom chcete MySQL na lokálnom počítači. 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. Akonáhle budete mať spustení tohto príkazu budete vyzvaní na zadanie hesla pre užívateľa, ktoré ste použili na prihlásenie aj na vzdialenom serveri. After you successfully enter the password your ssh tunnel should be up and running. Po úspešnom zadaní hesla si ssh tunel by mal byť v prevádzke.

Now launch your favorite MySQL client and make a connection with you remote MySQL server using the ssh tunnel you just created. Teraz odpáliť raketu tvoj obľúbenec MySQL klient a nadviazanie spojenia s vami vzdialený MySQL server pomocou ssh tunela, ktorý ste práve vytvorili. Assuming you setup the tunnel on port 6666 you will need to use the following credentials to connect. Za predpokladu, že nastavíte tunel na porte 6666, budete musieť použiť nasledujúce poverenia pre pripojenie.

host: 127.0.0.1 host: 127.0.0.1
port: 6666 port: 6666

You will need to use the database authentication that you use with your remote server. Budete musieť použiť databázu, autentizácia, ktoré používate so svojím vzdialeným serverom. If you did everything right you should now be able to see your remote databases in your MySQL client. Ak ste všetko správne, mali by ste byť teraz schopní vidieť vzdialenej databázy v MySQL klientovi. You are now on a secure remote connection. Teraz ste na bezpečné vzdialené pripojenie. Remember to close the ssh tunnel when you are done with using MySQL by quitting the ssh session you setup initially. Nezabudnite zatvoriť ssh tunela, keď ste hotoví s pomocou MySQL by opúšťať ssh nastavíte na začiatku.

Related Posts: Súvisiace zmeny:
  • How to SSH to your remote server without entering a password every time Ako na SSH k svojmu vzdialenému serveru bez zadanie hesla pri každom
  • How to reset a lost MySQL root password Ako obnoviť stratené heslo MySQL root
  • Getting started with iptables in Linux Začíname s iptables v Linuxe
  • Bash one liner – how to compress, move, and extract a directory Bash jedného liner - jak na kompresiu, presunúť a výpis adresáre
  • Using CrossLoop to remotely connect to, view and control another PC Naprieč pomocou vzdialeného pripojenia, zobrazenie a ovládanie iného počítača
  • Get Simple Help tutorials just like this one in your email inbox every day - for free! Get Help jednoduchá cvičenie, rovnako ako to vo vašej e-mailovej schránky každý deň - zadarmo! Just enter your email address below: Stačí zadať e-mailovú adresu:

    You can always opt out of this email subscription at any time. Vždy sa môžete odhlásiť z tohto e-mailu predplatného kedykoľvek.

    { 0 comments… (0 comments ... add one now pridať jednu teraz } )

    Leave a Comment Zanechať komentár

    You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Môžete použiť tieto HTML tagy a atribúty: href = "" <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> del datetime <em> <i> <q Cite=""> <strike> <strong>