You can force that with the command= flag in the authorized_keys file on the server side. From man sshd:
command="command"
Specifies that the command is executed whenever this key is used for authentication. The command supplied by the
user (if any) is ignored. The command is run on a pty if the client requests a pty; otherwise it is run without a
tty. If an 8-bit clean channel is required, one must not request a pty or should specify no-pty. A quote may be
included in the command by quoting it with a backslash.
This option might be useful to restrict certain public keys to perform just a specific operation. An example might
be a key that permits remote backups but nothing else. Note that the client may specify TCP and/or X11 forwarding
unless they are explicitly prohibited, e.g. using the restrict key option.
The command originally supplied by the client is available in the SSH_ORIGINAL_COMMAND environment variable. Note
that this option applies to shell, command or subsystem execution. Also note that this command may be superseded
by a sshd_config(5) ForceCommand directive.
If a command is specified and a forced-command is embedded in a certificate used for authentication, then the certificate will be accepted only if the two commands are identical.
You'll find lots of examples for this in tutorials on settings up git, bzr, and friends, for ssh access, where you want them to do nothing but access the version control.
Note there's also a sshd_config directive ForceCommand, which does mostly the same thing ("Forces the execution of the command specified by ForceCommand, ignoring any command supplied by the client and ~/.ssh/rc if present. The command is invoked by using the user's login shell with the -c option."), but also works if you use password-based login and can be restricted to certain source IPs. It will need to go into the global server configuration, though, so it doesn't scale well.