{"id":8575,"date":"2022-02-18T16:34:35","date_gmt":"2022-02-18T21:34:35","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=8575"},"modified":"2022-02-18T16:34:35","modified_gmt":"2022-02-18T21:34:35","slug":"accessing-postgresql-server-through-ssh-tunnel","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=8575","title":{"rendered":"Accessing Postgresql Server Through SSH Tunnel"},"content":{"rendered":"<p>Development servers can be accessed directly, but access to our production Postgresql servers is restricted. To use a SQL client from the VPN network, you need to connect through an SSH tunnel.<\/p>\n<p>In the connection configuration for a database connect, click the &#8220;SSH&#8221; tab.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"686\" height=\"538\" class=\"wp-image-8576\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image.png 686w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-300x235.png 300w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/p>\n<p>You can one-off configure an SSH tunnel for a connection, but the most efficient approach for setting up the SSH tunnel used to connect to all of our production databases is to create a tunnel <em>profile<\/em>. The profile lets you type connection info in one time and use it for multiple servers; and, when you need to update a setting, you only have one configuration set to update.<\/p>\n<p>To create a profile, click the pencil to the right of the profile drop-down box.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"743\" height=\"302\" class=\"wp-image-8577\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-1.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-1.png 743w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-1-300x122.png 300w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/><\/p>\n<p>Under the &#8220;Network Profiles&#8221; section, click &#8220;Create&#8221; to create a new profile.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"442\" height=\"203\" class=\"wp-image-8578\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-2.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-2.png 442w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-2-300x138.png 300w\" sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/p>\n<p>Give the profile a descriptive name and click &#8220;OK&#8221;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"303\" height=\"145\" class=\"wp-image-8579\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-3.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-3.png 303w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-3-300x144.png 300w\" sizes=\"auto, (max-width: 303px) 100vw, 303px\" \/><\/p>\n<p>Check the &#8220;Use SSH Tunnel&#8221; box, enter the hostname (one of the ETL dev boxes is a good choice in our case \u2013 ltrkarkvm553.mgmt.windstream.net. Supply the username for the connection. You can use password authentication or, if you have a key exchange set up for authentication, select public key authentication. Click &#8220;Apply and Close&#8221; to save the profile.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"985\" height=\"554\" class=\"wp-image-8580\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-4.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-4.png 985w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-4-300x169.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-4-768x432.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-4-750x422.png 750w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-4-480x270.png 480w\" sizes=\"auto, (max-width: 985px) 100vw, 985px\" \/><\/p>\n<p>Your profile will appear in the profile drop-down \u2013 select the profile &#8230;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"694\" height=\"558\" class=\"wp-image-8581\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-5.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-5.png 694w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-5-300x241.png 300w\" sizes=\"auto, (max-width: 694px) 100vw, 694px\" \/><\/p>\n<p>And all of the settings will pop in \u2013 they&#8217;re grayed out here, if you need to update the SSH tunnel profile settings, click the little pencil again.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"684\" height=\"541\" class=\"wp-image-8582\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-6.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-6.png 684w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/02\/word-image-6-300x237.png 300w\" sizes=\"auto, (max-width: 684px) 100vw, 684px\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Development servers can be accessed directly, but access to our production Postgresql servers is restricted. To use a SQL client from the VPN network, you need to connect through an SSH tunnel. In the connection configuration for a database connect, click the &#8220;SSH&#8221; tab. You can one-off configure an SSH tunnel for a connection, but &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1522],"tags":[953,1523,1348,1349,1524],"class_list":["post-8575","post","type-post","status-publish","format-standard","hentry","category-postgresql","tag-database","tag-dbeaver","tag-postgres","tag-postgresql","tag-sql-client"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8575"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8575\/revisions"}],"predecessor-version":[{"id":8583,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8575\/revisions\/8583"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}