The ForceCommand does exactly what I need. I wonder why I missed it when I
looked at the documentation...

Thank you all.

-Antonio


On Wed, Nov 13, 2013 at 2:04 PM, David Guntner <[email protected]> wrote:

> Antonio Paiva grabbed a keyboard and wrote:
> > Hi everyone,
> >
> > I would like to set up an ssh server such that, everytime someone tries
> to
> > connect to it, a script will be run to control certain aspects of the
> > connection. More specifically, I want to check if certain conditions are
> > met and, if they are not, refuse/abort the connection.
> >
> > I found that if a /etc/sshrc script exits, it will be run just before the
> > user's shell or command is invoked. However, how can I write the script
> > such that if the check fails, the ssh session is aborted? I'm told that
> if
> > the script exits due to an error (say, a syntax error), the SSH session
> > continues normally.
> >
> > I don't have to use the /etc/sshrc script. If you have an idea of an
> > alternative approach that would achieve the same goal, please let me
> know.
>
> What exactly is it that you're trying to accomplish?  What is it you
> want to check for?
>
>         --Dave
>
>
>
>

Reply via email to