Use Match in sshd_config to detect SCP connection
Posted
by
Garreth McDaid
on Server Fault
See other posts from Server Fault
or by Garreth McDaid
Published on 2014-06-12T14:28:56Z
Indexed on
2014/06/12
15:28 UTC
Read the original article
Hit count: 181
ssh
I use the following directive in sshd_config to detect if the user trying to login to a server is called developer, and issue a bash script to the user if that is the case:
Match User developer
ForceCommand /bin/dev_login
However, when the user tries to upload a file using SCP, they can't, as the dev_login script is interrupting the process.
Is it possible to use the
Match
directive to detect if the connection is SCP rather than a request to open a shell?
© Server Fault or respective owner