SSH tunnelling: Difference between revisions

Ask for a port number to be assigned before you try to connect
(Trying to generalize these instructions away from Jupyter)
(Ask for a port number to be assigned before you try to connect)
Line 186: Line 186:


== Example for connecting to a database server on Cedar from your desktop == <!--T:46-->
== Example for connecting to a database server on Cedar from your desktop == <!--T:46-->
In the following "PORT" is an arbitrary port number which should be opened in the firewall of Cedar's head node.
Before trying this, please contact [[Technical support]] and we will assign a port number to you.
This is so that more than one user can use the database server at the same time.


<!--T:47-->
<!--T:47-->
Line 195: Line 199:


<!--T:48-->
<!--T:48-->
These commands move your localhost:PORT to cedar.computecanada.ca:PORT and bind it with cedar-pgsql-vm.int.cedar.computecanada.ca:5432. "someuser" in this example is your username on computecanada. By running one of these commands you will be connected to Cedar (like any other SSH connection). The only difference between this connection and an ordinary SSH connection is that you can now use another terminal to connect to the database server directly from your desktop. Here are the commands for PostgreSQL and MySQL connections:
These commands connect your localhost:PORT to cedar.computecanada.ca:PORT and bind it with cedar-pgsql-vm.int.cedar.computecanada.ca:5432. "someuser" in this example is your Compute Canada username. The difference between this connection and an ordinary SSH connection is that you can now use another terminal to connect to the database server directly from your desktop. On your desktop run one of these commands, for PostgreSQL or MySQL as appropriate:


<!--T:49-->
<!--T:49-->
Line 204: Line 208:


<!--T:50-->
<!--T:50-->
The connection requires a password for both MySQL and PostgreSQL. However, for PostgreSQL the password is your Compute Canada password and for MySQL the password is stored in your ".my.cnf" located in your home directory on Cedar. The connections will remain open as long as you have the SSH connection. In this example "PORT" is an arbitrary number and it should be opened in the firewall of Cedar's head node. Before running this command, please contact [[Technical support]] and we will assign a port number to you.
Both MySQL and PostgreSQL will require a password.  
* For PostgreSQL the password is your Compute Canada password.
* For MySQL the password is stored in your ".my.cnf" located in your home directory on Cedar.  
The database connection will remain open as long as the SSH connection remains open.


</translate>
</translate>
Bureaucrats, cc_docs_admin, cc_staff
2,879

edits