Aborting an ssh connection on sshrc execution failure

Erik Thuning thuning at dsv.su.se
Fri Sep 18 23:42:12 AEST 2020


It feels like there is an obvious answer to this that I'm not seeing, 
but I've been testing, reading manuals and googling for a while now and 
can't seem to get it to work.

I have an SSH server that mounts a windows share on login, to act as a 
SFTP proxy for windows home directories. The mounting of the users' 
homedirs is done via a call from /etc/ssh/sshrc. This mount sometimes 
fails, with the consequence that users get dumped into an empty homedir 
that they think is their actual windows homedir. This is bad.

What I would like to do is to abort the connection, preferrably with 
some kind of descriptive error, when my sshrc script returns a non-zero 
exit status. Is this possible?

Erik Thuning

More information about the openssh-unix-dev mailing list