Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 186905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:43:45+00:00 2026-05-11T15:43:45+00:00

I have a PostgreSQL DB on a remote VPS server (CentOS 5) and I’d

  • 0

I have a PostgreSQL DB on a remote VPS server (CentOS 5) and I’d like to connect to have a Rails application connect to it from my local Mac laptop. On my laptop, I have the ActiveRecord PostgreSQL adapter installed — postgres (0.7.9.2008.01.28).

I read in the PostgreSQL docs:

The password-based authentication methods are md5, crypt, and password. These methods operate similarly except for the way that the password is sent across the connection: respectively, MD5-hashed, crypt-encrypted, and clear-text.

[…]

If you are at all concerned about password ‘sniffing’ attacks then md5 is preferred…Plain password should be avoided especially for connections over the open Internet (unless you use SSL, SSH, or another communications security wrapper around the connection).

In a standard Rails database.yml would have something like this for a localhost connection…

development:   adapter: postgresql   database: journalapp_development   username: xxx   password: yyy   host: localhost 

But there’s nothing in there about the authentication method discussed in the PostgreSQL docs. Is there as option to have something like ‘auth_method: md5‘?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:43:46+00:00Added an answer on May 11, 2026 at 3:43 pm

    Regardless of whether Postgres allows this functionality, you can enable a secure connection to a remote database by using SSH tunneling. Here’s the gratuitous Stack Overflow paste-in from the Web docs:

    First make sure that an SSH server is running properly on the same machine as the PostgreSQL server and that you can log in using ssh as some user. Then you can establish a secure tunnel with a command like this from the client machine:

    ssh -L 3333:foo.com:5432 joe@foo.com The first number in the -L argument, 3333, is the port number of your end of the tunnel; it can be chosen freely. The second number, 5432, is the remote end of the tunnel: the port number your server is using. The name or IP address between the port numbers is the host with the database server you are going to connect to. In order to connect to the database server using this tunnel, you connect to port 3333 on the local machine:

    psql -h localhost -p 3333 postgres To the database server it will then look as though you are really user joe@foo.com and it will use whatever authentication procedure was configured for connections from this user and host. Note that the server will not think the connection is SSL-encrypted, since in fact it is not encrypted between the SSH server and the PostgreSQL server. This should not pose any extra security risk as long as they are on the same machine.

    In case you want more, you can find it online by searching for ‘SSL tunnel’ or ‘postgres SSL tunnel’. Here’s the Postgres site where I got the above:

    http://www.postgresql.org/docs/current/static/ssh-tunnels.html

    To summarize for Rails, you would then do the following:

    1) In a terminal window, run the first ssh command above to establish the tunnel.

    2) Set your database props like so:

    development:   adapter: postgresql   database: journalapp_development   username: xxx   password: yyy   host: localhost   port: 3333 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a snippet to create a 'Like' button for our news site: <iframe
I have a project that adds elements to an AutoCad drawing. I noticed that
I have a script that appends some rows to a table. One of the
I have a new web app that is packaged as a WAR as part
I have several USB mass storage flash drives connected to a Ubuntu Linux computer
I have found this example on StackOverflow: var people = new List<Person> { new
I have a login.jsp page which contains a login form. Once logged in the
i have a input tag which is non editable, but some times i need
Let say I have the following desire, to simplify the IConvertible's to allow me
I want to have generalised email templates. Currently I have multiple email templates with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.