1

I would like to get $PGDATA from server with SSH connection under postgres user but I have some issues:

ssh postgres@myServer
postgres@myServer's password:

But I don't know the password and I don't want to use it or know it...

So I tried something else;

ssh -p NumPortOK postgres@myServer
ssh_exchange_identification: Connectionn closed by remote host

How can I connect with postgres and get $PGDATA please ?

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
Carlinto
  • 31
  • 1
  • 3

1 Answers1

2

I have the solution,

I'm connected with postgres user in my server sudo su - postgres

And I did that, to authorize the the local machine to connect in ssh:

mkdir .ssh chmod 700 .ssh touch .ssh/authorized_keys chmod 600 .ssh/authorized_keys

and take the public key from local machine: ssh-keygen -y and paste it in .ssh/authorized_keys in the server cat >> .ssh/authorized_keys -> Ctrl+D

Everything is okay to connect on ssh under postgres user :D (or any other user...)

Carlinto
  • 31
  • 1
  • 3