SERVERYou have a login on this server which we'll refer to as
SERVER_LOGINThe first step you must do is get access to the server through a public key. We will assume you have a decent terminal shell to use, such as a Linux shell or Cygwin on Windows.
$ ssh-keygen -t dsaThis will prompt for a passphrase and a place to store the public key (for which you will take the default). The easiest thing to do is to hit "Enter" three times. If you want a more secure public key access, you have to introduce a passphrase when prompted for it. View the results by typing:
$ ls ~/.ssh $ cat ~/.ssh/id_dsa the private key $ cat ~/.ssh/id_dsa.pub the public key
$ scp ~/.ssh/id_dsa.pub SERVER_LOGIN@SERVER: (note the terminating ":")
$ ssh -l SERVER_LOGIN SERVERThis should be the last time you'll need the login password. From your SERVER shell, in your home directory, check that the .ssh/ directory exists:
[SERVER]$ ls .sshIf not, create it:
[SERVER]$ mkdir .sshThen concatenate the contents of id_dsa.pub (sent from your client machine) onto the file ~/.ssh/authorized_keys2:
[SERVER]$ cat id_dsa.pub >> .ssh/authorized_keys2 [SERVER]$ rm id_dsa.pub [SERVER]$ exit
$ ssh -l SERVER_LOGIN SERVERIf your public key passphrase is empty, you'll go right in, otherwise provide the passphrase.
MySQL DBMS login: MYSQL_LOGIN MySQL DBMS password: MYSQL_PASSPress the Connection button to start making a new connection.
Use SSH Tunnel
Host name/IP address: SERVER
Port: 22
User name: SERVER_LOGIN
Authentication Method:
Private key: ./ssh/id_dsa (see below)
Passphrase: -- whatever you chose, leave empty if none --
Save Passphrase
The selection of the Private key may be a bit tricky because ".ssh" is a hidden directory.
Click the on the right to bring up the file selection dialog.
Navigate to the directory containing .ssh
you may be right where it is, but it's not showing!
and then type .ssh
into the File name field.
This should open up the .ssh directory and make id_dsa accessible.
Connection Name: SERVER-MYSQL_LOGIN (or whatever you like) Host name/IP address: localhost (not SERVER) Port: 3306 User name: MYSQL_LOGIN Password: MYSQL_PASS