Re: psql remote shell command

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Dennis <dennisr(at)visi(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql remote shell command
Date: 2016-06-02 23:56:08
Message-ID: 20160602235608.GY21416@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* David G. Johnston (david(dot)g(dot)johnston(at)gmail(dot)com) wrote:
> On Thu, Jun 2, 2016 at 7:30 PM, Dennis <dennisr(at)visi(dot)com> wrote:
> > Is it possible to execute command in on system the is hosting postgresql
> > remotely using psql or other mechanism? I know I can use \! in psql but
> > that executes the commands on the host where I am running psql from. Also,
> > is it possible for a postgres login/user to stop or restart a running
> > postgres instance from in side psql or similar client. e.g. psql -c “pg_ctl
> > stop -D some_data_dir”
>
> ​ssh user(at)hostname ?
>
> You should ask your system administrator for help. Odds are if you cannot
> do "ssh user(at)hostname" then the person hosting the server doesn't want you
> to be able to execute arbitrary commands on the host.

To be fair, if the administrator really didn't want you to have access
to the postgres unix user account on the system, they shouldn't give you
a PG superuser account.

Thanks!

Stephen

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2016-06-03 00:10:09 Re: psql remote shell command
Previous Message Adrian Klaver 2016-06-02 23:55:05 Re: Slave claims requested WAL segment already removed - but it wasn't